[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230705113926.751791-3-bjorn@kernel.org>
Date: Wed, 5 Jul 2023 13:39:26 +0200
From: Björn Töpel <bjorn@...nel.org>
To: Andrii Nakryiko <andrii@...nel.org>,
Mykola Lysenko <mykolal@...com>,
bpf@...r.kernel.org,
netdev@...r.kernel.org
Cc: Björn Töpel <bjorn@...osinc.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
linux-kselftest@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org
Subject: [PATCH bpf-next 2/2] selftests/bpf: Honor $(O) when figuring out paths
From: Björn Töpel <bjorn@...osinc.com>
When building the kselftests out-of-tree, e.g.
| make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- \
| O=/tmp/kselftest headers
| make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- \
| O=/tmp/kselftest HOSTCC=gcc FORMAT= \
| SKIP_TARGETS="arm64 ia64 powerpc sparc64 x86 sgx" \
| -C tools/testing/selftests gen_tar
the kselftest build would not pick up the correct GENDIR path, and
therefore not including autoconf.h.
Correct that by taking $(O) into consideration when figuring out the
GENDIR path.
Signed-off-by: Björn Töpel <bjorn@...osinc.com>
---
tools/testing/selftests/bpf/Makefile | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index ad6b585e0d7c..daccc1b8573a 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -12,7 +12,11 @@ BPFDIR := $(LIBDIR)/bpf
TOOLSINCDIR := $(TOOLSDIR)/include
BPFTOOLDIR := $(TOOLSDIR)/bpf/bpftool
APIDIR := $(TOOLSINCDIR)/uapi
+ifneq ($(O),)
+GENDIR := $(O)/include/generated
+else
GENDIR := $(abspath ../../../../include/generated)
+endif
GENHDR := $(GENDIR)/autoconf.h
HOSTPKG_CONFIG := pkg-config
--
2.39.2
Powered by blists - more mailing lists