diff mbox series

[XEN,v8,40/47] RFC, no-VPATH: prepend $(srctree) to source prerequisite

Message ID 20211125134006.1076646-41-anthony.perard@citrix.com (mailing list archive)
State Superseded
Headers show
Series xen: Build system improvements, now with out-of-tree build! | expand

Commit Message

Anthony PERARD Nov. 25, 2021, 1:39 p.m. UTC
From: Anthony PERARD <anthony.perard@gmail.com>

Prefix many prerequisite with $(srctree) or replace $(src) with
$(srcdir) to not have to rely on VPATH=$(srctree).

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 xen/arch/arm/Makefile      | 2 +-
 xen/arch/x86/Makefile      | 4 ++--
 xen/arch/x86/boot/Makefile | 2 +-
 xen/arch/x86/efi/Makefile  | 2 +-
 xen/build.mk               | 6 +++---
 xen/include/Makefile       | 2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index ae7a2f907540..8b340affbe38 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -111,7 +111,7 @@  $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
 .PHONY: include
 include:
 
-$(obj)/xen.lds: $(src)/xen.lds.S FORCE
+$(obj)/xen.lds: $(srcdir)/xen.lds.S FORCE
 	$(call if_changed,cpp_lds_S)
 
 $(obj)/dtb.o: $(patsubst "%",%,$(CONFIG_DTB_FILE))
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 5fb7f1408768..9e5195f58d3b 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -236,7 +236,7 @@  include: $(objtree)/arch/x86/include/asm/asm-macros.h
 
 $(obj)/asm-macros.i: CFLAGS-y += -D__ASSEMBLY__ -P
 
-$(objtree)/arch/x86/include/asm/asm-macros.h: $(obj)/asm-macros.i $(src)/Makefile
+$(objtree)/arch/x86/include/asm/asm-macros.h: $(obj)/asm-macros.i $(srcdir)/Makefile
 	$(call filechk,asm-macros.h)
 
 define filechk_asm-macros.h
@@ -254,7 +254,7 @@  define filechk_asm-macros.h
 endef
 
 $(obj)/efi.lds: AFLAGS-y += -DEFI
-$(obj)/xen.lds $(obj)/efi.lds: $(src)/xen.lds.S FORCE
+$(obj)/xen.lds $(obj)/efi.lds: $(srcdir)/xen.lds.S FORCE
 	$(call if_changed_dep,cpp_lds_S)
 
 clean-files := \
diff --git a/xen/arch/x86/boot/Makefile b/xen/arch/x86/boot/Makefile
index 4fc6b1d8ffc2..ccba2e281dfc 100644
--- a/xen/arch/x86/boot/Makefile
+++ b/xen/arch/x86/boot/Makefile
@@ -47,7 +47,7 @@  $(head-objs): %.S: %.bin
 	$(OBJCOPY) -O binary -R .got.plt $< $@
 
 
-%.lnk: %.o $(src)/build32.lds
+%.lnk: %.o $(srcdir)/build32.lds
 	$(LD) $(LDFLAGS_DIRECT) -N -T $(filter %.lds,$^) -o $@ $<
 
 clean-files := cmdline.S reloc.S *.lnk *.bin
diff --git a/xen/arch/x86/efi/Makefile b/xen/arch/x86/efi/Makefile
index 81fda12a70ea..7af96629294a 100644
--- a/xen/arch/x86/efi/Makefile
+++ b/xen/arch/x86/efi/Makefile
@@ -3,7 +3,7 @@  include $(srctree)/common/efi/efi_common.mk
 quiet_cmd_objcopy_o_ihex = OBJCOPY $@
 cmd_objcopy_o_ihex = $(OBJCOPY) -I ihex -O binary $< $@
 
-$(obj)/%.o: $(src)/%.ihex FORCE
+$(obj)/%.o: $(srcdir)/%.ihex FORCE
 	$(call if_changed,objcopy_o_ihex)
 
 $(obj)/boot.init.o: $(obj)/buildid.o
diff --git a/xen/build.mk b/xen/build.mk
index 65d8dbc13828..7b48b7eb1404 100644
--- a/xen/build.mk
+++ b/xen/build.mk
@@ -8,7 +8,7 @@  define cmd_banner
     mv -f $@.tmp $@
 endef
 
-.banner: tools/xen.flf FORCE
+.banner: $(srctree)/tools/xen.flf FORCE
 	$(call if_changed,banner)
 
 targets += .banner
@@ -33,14 +33,14 @@  define cmd_compile.h
     fi
 endef
 
-include/xen/compile.h: include/xen/compile.h.in .banner FORCE
+include/xen/compile.h: $(srctree)/include/xen/compile.h.in .banner FORCE
 	@cat .banner
 	$(call if_changed,compile.h)
 
 targets += include/xen/compile.h
 
 -include $(wildcard .asm-offsets.s.d)
-asm-offsets.s: arch/$(TARGET_ARCH)/$(TARGET_SUBARCH)/asm-offsets.c
+asm-offsets.s: $(srctree)/arch/$(TARGET_ARCH)/$(TARGET_SUBARCH)/asm-offsets.c
 	$(CC) $(call cpp_flags,$(c_flags)) -S -g0 -o $@.new -MQ $@ $<
 	$(call move-if-changed,$@.new,$@)
 
diff --git a/xen/include/Makefile b/xen/include/Makefile
index a3977a8bfccd..9fbe9f0de772 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -52,7 +52,7 @@  $(obj)/compat/%.h: $(obj)/compat/%.i $(srcdir)/Makefile $(srctree)/tools/compat-
 $(obj)/compat/%.i: $(obj)/compat/%.c $(srcdir)/Makefile
 	$(CPP) $(filter-out -Wa$(comma)% -include %/include/xen/config.h,$(XEN_CFLAGS)) $(cppflags-y) -o $@ $<
 
-$(obj)/compat/%.c: $(src)/public/%.h $(srcdir)/xlat.lst $(srcdir)/Makefile $(srctree)/tools/compat-build-source.py
+$(obj)/compat/%.c: $(srcdir)/public/%.h $(srcdir)/xlat.lst $(srcdir)/Makefile $(srctree)/tools/compat-build-source.py
 	mkdir -p $(@D)
 	$(PYTHON) $(srctree)/tools/compat-build-source.py $(srcdir)/xlat.lst <$< >$@.new
 	mv -f $@.new $@