]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
build: fix dependency tracking for preprocessed files
authorJan Beulich <jbeulich@suse.com>
Mon, 8 Jun 2020 08:25:40 +0000 (10:25 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 8 Jun 2020 08:25:40 +0000 (10:25 +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>
Release-acked-by: Paul Durrant <paul@xen.org>
xen/Rules.mk
xen/arch/arm/Makefile
xen/arch/x86/Makefile

index 2e28c572305aab95e03814267657814457b8e106..ebfd40caff63da4eb2a68a601ab012b6dad0330b 100644 (file)
@@ -201,13 +201,13 @@ $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): %.init.o: %.o FORCE
        $(call if_changed,obj_init_o)
 
 quiet_cmd_cpp_i_c = CPP     $@
-cmd_cpp_i_c = $(CPP) $(filter-out -Wa$(comma)%,$(c_flags)) $< -o $@
+cmd_cpp_i_c = $(CPP) $(filter-out -Wa$(comma)%,$(c_flags)) -MQ $@ -o $@ $<
 
 quiet_cmd_cc_s_c = CC      $@
 cmd_cc_s_c = $(CC) $(filter-out -Wa$(comma)%,$(c_flags)) -S $< -o $@
 
 quiet_cmd_s_S = CPP     $@
-cmd_s_S = $(CPP) $(filter-out -Wa$(comma)%,$(a_flags)) $< -o $@
+cmd_s_S = $(CPP) $(filter-out -Wa$(comma)%,$(a_flags)) -MQ $@ -o $@ $<
 
 %.i: %.c FORCE
        $(call if_changed,cpp_i_c)
index c1a1b5e803632e1ce23020b69056406e4758f280..7e82b2178cd77e95ef7417e65395fdef888e8220 100644 (file)
@@ -123,9 +123,7 @@ asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c
        $(CC) $(filter-out -flto,$(c_flags)) -S -o $@ $<
 
 xen.lds: xen.lds.S
-       $(CC) -P -E -Ui386 $(a_flags) -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 $(a_flags) -MQ $@ -o $@ $<
 
 dtb.o: $(CONFIG_DTB_FILE)
 
index 07eeefbf8247dc6d92ce06214abe0b3381608faf..b388861679de24e03ce3a549f11d3ba94f00a458 100644 (file)
@@ -244,9 +244,7 @@ $(BASEDIR)/include/asm-x86/asm-macros.h: asm-macros.i Makefile
 
 efi.lds: AFLAGS-y += -DEFI
 xen.lds efi.lds: xen.lds.S
-       $(CC) -P -E -Ui386 $(filter-out -Wa$(comma)%,$(a_flags)) -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)%,$(a_flags)) -MQ $@ -o $@ $<
 
 boot/mkelf32: boot/mkelf32.c
        $(HOSTCC) $(HOSTCFLAGS) -o $@ $<