selftests/nolibc: anchor paths in $(srcdir) if possible
authorThomas Weißschuh <linux@weissschuh.net>
Tue, 31 Oct 2023 20:36:59 +0000 (21:36 +0100)
committerThomas Weißschuh <linux@weissschuh.net>
Mon, 11 Dec 2023 21:38:15 +0000 (22:38 +0100)
It is easier to recognize paths from their well-known location in the
source tree than having to resolve the relative path in ones head.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20231031-nolibc-out-of-tree-v1-2-47c92f73590a@weissschuh.net
tools/testing/selftests/nolibc/Makefile

index 28e616d6461240a6f8212c29c8482b089fe949d5..be89a4fe0e2301ca687f26ecad7834134a0bf0b0 100644 (file)
@@ -174,7 +174,7 @@ sysroot: sysroot/$(ARCH)/include
 sysroot/$(ARCH)/include:
        $(Q)rm -rf sysroot/$(ARCH) sysroot/sysroot
        $(QUIET_MKDIR)mkdir -p sysroot
-       $(Q)$(MAKE) -C ../../../include/nolibc ARCH=$(ARCH) OUTPUT=$(CURDIR)/sysroot/ headers_standalone
+       $(Q)$(MAKE) -C $(srctree)/tools/include/nolibc ARCH=$(ARCH) OUTPUT=$(CURDIR)/sysroot/ headers_standalone
        $(Q)mv sysroot/sysroot sysroot/$(ARCH)
 
 ifneq ($(NOLIBC_SYSROOT),0)
@@ -184,7 +184,7 @@ nolibc-test: nolibc-test.c nolibc-test-linkage.c sysroot/$(ARCH)/include
 else
 nolibc-test: nolibc-test.c nolibc-test-linkage.c
        $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ \
-         -nostdlib -static -include ../../../include/nolibc/nolibc.h nolibc-test.c nolibc-test-linkage.c -lgcc
+         -nostdlib -static -include $(srctree)/tools/include/nolibc/nolibc.h nolibc-test.c nolibc-test-linkage.c -lgcc
 endif
 
 libc-test: nolibc-test.c nolibc-test-linkage.c