diff mbox series

[kvm-unit-tests,GIT,PULL,17/18] s390x/Makefile: Make sure the linker script is generated in the build directory

Message ID 20250203083606.22864-18-nrb@linux.ibm.com (mailing list archive)
State New
Headers show
Series [kvm-unit-tests,GIT,PULL,01/18] s390x: Split and rework cpacf query functions | expand

Commit Message

Nico Boehr Feb. 3, 2025, 8:35 a.m. UTC
From: Marc Hartmayer <mhartmay@linux.ibm.com>

This change makes sure that the 'flat.lds' linker script is actually
generated in the build directory and not source directory - this makes a
difference in case of an out-of-source build.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Nico Boehr <nrb@linux.ibm.com>
Link: https://lore.kernel.org/r/20250128100639.41779-2-mhartmay@linux.ibm.com
[ nrb: use TEST_DIR instead of s390x, wrap commit msg ]
Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
---
 s390x/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/s390x/Makefile b/s390x/Makefile
index 8970a85b..eb3d5431 100644
--- a/s390x/Makefile
+++ b/s390x/Makefile
@@ -167,8 +167,8 @@  lds-autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d -MT $@
 	$(CC) $(CFLAGS) -c -o $@ $< -DPROGNAME=\"$(@:.aux.o=.elf)\"
 
 .SECONDEXPANSION:
-%.elf: $(FLATLIBS) $(asmlib) $(SRCDIR)/s390x/flat.lds $$(snippets-obj) $$(snippet-hdr-obj) %.o %.aux.o
-	@$(CC) $(LDFLAGS) -o $@ -T $(SRCDIR)/s390x/flat.lds \
+%.elf: $(FLATLIBS) $(asmlib) $(TEST_DIR)/flat.lds $$(snippets-obj) $$(snippet-hdr-obj) %.o %.aux.o
+	@$(CC) $(LDFLAGS) -o $@ -T $(TEST_DIR)/flat.lds \
 		$(filter %.o, $^) $(FLATLIBS) $(snippets-obj) $(snippet-hdr-obj) || \
 		{ echo "Failure probably caused by missing definition of gen-se-header executable"; exit 1; }
 	@chmod a-x $@