[kvm-unit-tests PATCH v2 8/8] s390x/Makefile: add an extra `%.aux.o` target

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It's unusual to create multiple files in one target rule, therefore
let's create an extra target for `%.aux.o`. As a side effect, this
change fixes the dependency tracking of the prerequisites of `.aux.o`
(lib/auxinfo.c wasn't listed before).

Signed-off-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxx>
---
 s390x/Makefile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/s390x/Makefile b/s390x/Makefile
index 9a8e2af1b2be..6fa62416c0e9 100644
--- a/s390x/Makefile
+++ b/s390x/Makefile
@@ -162,13 +162,14 @@ $(SNIPPET_DIR)/c/%.gbin: $(SNIPPET_DIR)/c/%.o $(snippet_lib) $(FLATLIBS) $(SNIPP
 %.lds: %.lds.S $(asm-offsets)
 	$(CPP) $(autodepend-flags) $(CPPFLAGS) -P -C -o $@ $<
 
+%.aux.o: $(SRCDIR)/lib/auxinfo.c
+	$(CC) $(CFLAGS) -c -o $@ $^ -DPROGNAME=\"$(@:.aux.o=.elf)\"
+
 .SECONDEXPANSION:
-%.elf: $(FLATLIBS) $(asmlib) $(SRCDIR)/s390x/flat.lds $$(snippets-obj) $$(snippet-hdr-obj) %.o
-	$(CC) $(CFLAGS) -c -o $(@:.elf=.aux.o) $(SRCDIR)/lib/auxinfo.c -DPROGNAME=\"$@\"
+%.elf: $(FLATLIBS) $(asmlib) $(SRCDIR)/s390x/flat.lds $$(snippets-obj) $$(snippet-hdr-obj) %.o %.aux.o
 	@$(CC) $(LDFLAGS) -o $@ -T $(SRCDIR)/s390x/flat.lds \
-		$(filter %.o, $^) $(FLATLIBS) $(snippets-obj) $(snippet-hdr-obj) $(@:.elf=.aux.o) || \
+		$(filter %.o, $^) $(FLATLIBS) $(snippets-obj) $(snippet-hdr-obj) || \
 		{ echo "Failure probably caused by missing definition of gen-se-header executable"; exit 1; }
-	$(RM) $(@:.elf=.aux.o)
 	@chmod a-x $@
 
 # Secure Execution Customer Communication Key file
-- 
2.34.1




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux