Skip to content

Commit 1a1200b

Browse files
committed
selftests/nolibc: determine $(srctree) first
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 <[email protected]> Acked-by: Willy Tarreau <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Thomas Weißschuh <[email protected]>
1 parent f1a58f6 commit 1a1200b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tools/testing/selftests/nolibc/Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# SPDX-License-Identifier: GPL-2.0
22
# Makefile for nolibc tests
3-
include ../../../scripts/Makefile.include
4-
include ../../../scripts/utilities.mak
3+
# we're in ".../tools/testing/selftests/nolibc"
4+
ifeq ($(srctree),)
5+
srctree := $(patsubst %/tools/testing/selftests/,%,$(dir $(CURDIR)))
6+
endif
7+
8+
include $(srctree)/tools/scripts/Makefile.include
9+
include $(srctree)/tools/scripts/utilities.mak
510
# We need this for the "cc-option" macro.
6-
include ../../../build/Build.include
11+
include $(srctree)/tools/build/Build.include
712

813
ifneq ($(O),)
914
ifneq ($(call is-absolute,$(O)),y)
1015
$(error Only absolute O= parameters are supported)
1116
endif
1217
endif
1318

14-
# we're in ".../tools/testing/selftests/nolibc"
15-
ifeq ($(srctree),)
16-
srctree := $(patsubst %/tools/testing/selftests/,%,$(dir $(CURDIR)))
17-
endif
18-
1919
ifeq ($(ARCH),)
2020
include $(srctree)/scripts/subarch.include
2121
ARCH = $(SUBARCH)

0 commit comments

Comments
 (0)