]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests/nolibc: determine $(srctree) first
authorThomas Weißschuh <linux@weissschuh.net>
Wed, 7 Aug 2024 21:51:45 +0000 (23:51 +0200)
committerThomas Weißschuh <linux@weissschuh.net>
Mon, 12 Aug 2024 20:22:14 +0000 (22:22 +0200)
The nolibc-test Makefile includes various other Makefiles from the tree.
At first these are included with relative paths like
"../../../build/Build.include" but as soon as $(srctree) is set up,
the inclusions use that instead to build full paths.

To keep the style of inclusions consistent, perform the setup
$(srctree) as early as possible and use it for all inclusions.

Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20240807-nolibc-llvm-v2-9-c20f2f5fc7c2@weissschuh.net
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
tools/testing/selftests/nolibc/Makefile

index 46dfbb50fae54d7f46b37ba51f2fd6092a2402e1..803a4e1bbe24745b92c95e5122b53ec87fc2b9f6 100644 (file)
@@ -1,9 +1,14 @@
 # SPDX-License-Identifier: GPL-2.0
 # Makefile for nolibc tests
-include ../../../scripts/Makefile.include
-include ../../../scripts/utilities.mak
+# we're in ".../tools/testing/selftests/nolibc"
+ifeq ($(srctree),)
+srctree := $(patsubst %/tools/testing/selftests/,%,$(dir $(CURDIR)))
+endif
+
+include $(srctree)/tools/scripts/Makefile.include
+include $(srctree)/tools/scripts/utilities.mak
 # We need this for the "cc-option" macro.
-include ../../../build/Build.include
+include $(srctree)/tools/build/Build.include
 
 ifneq ($(O),)
 ifneq ($(call is-absolute,$(O)),y)
@@ -11,11 +16,6 @@ $(error Only absolute O= parameters are supported)
 endif
 endif
 
-# we're in ".../tools/testing/selftests/nolibc"
-ifeq ($(srctree),)
-srctree := $(patsubst %/tools/testing/selftests/,%,$(dir $(CURDIR)))
-endif
-
 ifeq ($(ARCH),)
 include $(srctree)/scripts/subarch.include
 ARCH = $(SUBARCH)