]> xenbits.xensource.com Git - xen.git/commitdiff
build: fix dependency tracking for preprocessed files
authorJan Beulich <jbeulich@suse.com>
Wed, 24 Jun 2020 15:15:53 +0000 (17:15 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 24 Jun 2020 15:15:53 +0000 (17:15 +0200)
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

xen/Rules.mk
xen/arch/arm/Makefile
xen/arch/x86/Makefile

index a151b3f625bc5500c8c2b5fd40e87e70ff1a1c30..dc0632ddf5163006906371ffab8332ce74f873d9 100644 (file)
@@ -217,13 +217,13 @@ $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): %.init.o: %.o Makefile
        $(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)
index 872a155b60767773fe73cf76e23b94ca7c4439b9..6b29e45bbeb18612bb315e4b3766951ac76f2df5 100644 (file)
@@ -123,9 +123,7 @@ asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c
        $(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)
 
index a53bdcf979ae0aa3a8f16044b8cc6b989e924691..beaa5ec016e110550bc035755a6a1f562e399543 100644 (file)
@@ -233,14 +233,10 @@ $(BASEDIR)/include/asm-x86/asm-macros.h: asm-macros.i Makefile
        $(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 $@ $<