diff mbox series

[XEN,v8,43/47] WIP, no-VPATH: build object from generated assembly source file

Message ID 20211125134006.1076646-44-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:40 p.m. UTC
gen-objs-c and gen-objs-S can't have the list of targets.

Alternative, merge both list and use $(filter ).

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 xen/Rules.mk | 6 ++++++
 xen/build.mk | 7 +++++++
 2 files changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/xen/Rules.mk b/xen/Rules.mk
index 44af005fd57e..2d8d32f5fd72 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -26,6 +26,7 @@  lib-y :=
 targets :=
 ## targets made from generated sources
 gen-objs-c :=
+gen-objs-S :=
 subdir-y :=
 CFLAGS-y :=
 AFLAGS-y :=
@@ -99,6 +100,7 @@  lib-y           := $(addprefix $(obj)/,$(lib-y))
 obj-y           := $(addprefix $(obj)/,$(obj-y))
 obj-bin-y       := $(addprefix $(obj)/,$(obj-bin-y))
 gen-objs-c      := $(addprefix $(obj)/,$(gen-objs-c))
+gen-objs-S      := $(addprefix $(obj)/,$(gen-objs-S))
 subdir-y        := $(addprefix $(obj)/,$(subdir-y))
 nocov-y         := $(addprefix $(obj)/,$(nocov-y))
 noubsan-y       := $(addprefix $(obj)/,$(noubsan-y))
@@ -255,6 +257,10 @@  $(obj)/%.o: $(srctree)/$(src)/%.c FORCE
 quiet_cmd_cc_o_S = CC      $@
 cmd_cc_o_S = $(CC) $(a_flags) -c $< -o $@
 
+ifdef building_out_of_srctree
+$(gen-objs-S): $(obj)/%.o: $(obj)/%.S FORCE
+	$(call if_changed_dep,cc_o_S)
+endif
 $(obj)/%.o: $(src)/%.S FORCE
 	$(call if_changed_dep,cc_o_S)
 
diff --git a/xen/build.mk b/xen/build.mk
index 7b48b7eb1404..2f2cbbbeabf8 100644
--- a/xen/build.mk
+++ b/xen/build.mk
@@ -83,6 +83,13 @@  prelink.o: $(ALL_OBJS) $(ALL_LIBS) FORCE
 	$(call if_changed,ld)
 endif
 
+# Source generated in arch/*/Makefile to build $(TARGET)-syms
+gen-objs-S += .$(TARGET)-syms.0.o
+gen-objs-S += .$(TARGET)-syms.1.o
+# Source generated in arch/*/Makefile to build $(TARGET).efi
+gen-objs-S += .$(TARGET).efi.0r.o .$(TARGET).efi.0s.o
+gen-objs-S += .$(TARGET).efi.1r.o .$(TARGET).efi.1s.o
+
 targets += prelink.o
 
 $(TARGET): prelink.o FORCE