While the issue is more general, I noticed that asm-macros.i not getting
re-generated as needed. This was due to its .*.d file mentioning
asm-macros.o instead of asm-macros.i. Use -MQ here as well, and while at
it also use -MQ to avoid the somewhat fragile sed-ary on the *.lds
dependency tracking files. While there, further avoid open-coding $(CPP)
and drop the bogus (Arm) / stale (x86) -Ui386.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Julien Grall <jgrall@amazon.com>
master commit:
75131ad75bb3c91717b5dfda6881e61c52bfd22e
master date: 2020-06-08 10:25:40 +0200
$(OBJCOPY) $(foreach s,$(SPECIAL_DATA_SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@
%.i: %.c Makefile
- $(CPP) $(filter-out -Wa$(comma)%,$(CFLAGS)) $< -o $@
+ $(CPP) $(filter-out -Wa$(comma)%,$(CFLAGS)) -MQ $@ -o $@ $<
%.s: %.c Makefile
$(CC) $(filter-out -Wa$(comma)%,$(CFLAGS)) -S $< -o $@
# -std=gnu{89,99} gets confused by # as an end-of-line comment marker
%.s: %.S Makefile
- $(CPP) $(filter-out -Wa$(comma)%,$(AFLAGS)) $< -o $@
+ $(CPP) $(filter-out -Wa$(comma)%,$(AFLAGS)) -MQ $@ -o $@ $<
-include $(DEPS_INCLUDE)
$(CC) $(filter-out -flto,$(CFLAGS)) -S -o $@ $<
xen.lds: xen.lds.S
- $(CC) -P -E -Ui386 $(AFLAGS) -o $@ $<
- sed -e 's/xen\.lds\.o:/xen\.lds:/g' <.xen.lds.d >.xen.lds.d.new
- mv -f .xen.lds.d.new .xen.lds.d
+ $(CPP) -P $(AFLAGS) -MQ $@ -o $@ $<
dtb.o: $(CONFIG_DTB_FILE)
$(call move-if-changed,$@.new,$@)
xen.lds: xen.lds.S
- $(CC) -P -E -Ui386 $(filter-out -Wa$(comma)%,$(AFLAGS)) -o $@ $<
- sed -e 's/.*\.lds\.o:/$(@F):/g' <.$(@F).d >.$(@F).d.new
- mv -f .$(@F).d.new .$(@F).d
+ $(CPP) -P $(filter-out -Wa$(comma)%,$(AFLAGS)) -MQ $@ -o $@ $<
efi.lds: xen.lds.S
- $(CC) -P -E -Ui386 -DEFI $(filter-out -Wa$(comma)%,$(AFLAGS)) -o $@ $<
- sed -e 's/.*\.lds\.o:/$(@F):/g' <.$(@F).d >.$(@F).d.new
- mv -f .$(@F).d.new .$(@F).d
+ $(CPP) -P -DEFI $(filter-out -Wa$(comma)%,$(AFLAGS)) -MQ $@ -o $@ $<
boot/mkelf32: boot/mkelf32.c
$(HOSTCC) $(HOSTCFLAGS) -o $@ $<