Skip to content

Commit fbb075c

Browse files
committed
tools headers arm64: Fix references to top srcdir in Makefile
Aishwarya reports that KVM selftests for arm64 fail with the following error: | make[4]: Entering directory '/tmp/kci/linux/tools/testing/selftests/kvm' | Makefile:270: warning: overriding recipe for target | '/tmp/kci/linux/build/kselftest/kvm/get-reg-list' | Makefile:265: warning: ignoring old recipe for target | '/tmp/kci/linux/build/kselftest/kvm/get-reg-list' | make -C ../../../../tools/arch/arm64/tools/ | make[5]: Entering directory '/tmp/kci/linux/tools/arch/arm64/tools' | Makefile:10: ../tools/scripts/Makefile.include: No such file or directory | make[5]: *** No rule to make target '../tools/scripts/Makefile.include'. | Stop. It would appear that this only affects builds from the top-level Makefile (e.g. make kselftest-all), as $(srctree) is set to ".". Work around the issue by shadowing the kselftest naming scheme for the source tree variable. Reported-by: Aishwarya TCV <aishwarya.tcv@arm.com> Fixes: 0359c94 ("tools headers arm64: Update sysreg.h with kernel sources") Link: https://lore.kernel.org/r/20231027005439.3142015-2-oliver.upton@linux.dev Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
1 parent 54a9ea7 commit fbb075c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tools/arch/arm64/tools/Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# SPDX-License-Identifier: GPL-2.0
22

3-
ifeq ($(srctree),)
4-
srctree := $(patsubst %/,%,$(dir $(CURDIR)))
5-
srctree := $(patsubst %/,%,$(dir $(srctree)))
6-
srctree := $(patsubst %/,%,$(dir $(srctree)))
7-
srctree := $(patsubst %/,%,$(dir $(srctree)))
3+
ifeq ($(top_srcdir),)
4+
top_srcdir := $(patsubst %/,%,$(dir $(CURDIR)))
5+
top_srcdir := $(patsubst %/,%,$(dir $(top_srcdir)))
6+
top_srcdir := $(patsubst %/,%,$(dir $(top_srcdir)))
7+
top_srcdir := $(patsubst %/,%,$(dir $(top_srcdir)))
88
endif
99

10-
include $(srctree)/tools/scripts/Makefile.include
10+
include $(top_srcdir)/tools/scripts/Makefile.include
1111

1212
AWK ?= awk
1313
MKDIR ?= mkdir
@@ -19,10 +19,10 @@ else
1919
Q = @
2020
endif
2121

22-
arm64_tools_dir = $(srctree)/arch/arm64/tools
22+
arm64_tools_dir = $(top_srcdir)/arch/arm64/tools
2323
arm64_sysreg_tbl = $(arm64_tools_dir)/sysreg
2424
arm64_gen_sysreg = $(arm64_tools_dir)/gen-sysreg.awk
25-
arm64_generated_dir = $(srctree)/tools/arch/arm64/include/generated
25+
arm64_generated_dir = $(top_srcdir)/tools/arch/arm64/include/generated
2626
arm64_sysreg_defs = $(arm64_generated_dir)/asm/sysreg-defs.h
2727

2828
all: $(arm64_sysreg_defs)

0 commit comments

Comments
 (0)