aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/lib.mk
diff options
context:
space:
mode:
authorMickaël Salaün <mic@digikod.net>2022-09-09 12:34:02 +0200
committerMickaël Salaün <mic@digikod.net>2022-09-14 16:37:38 +0200
commita52540522c9541bfa3e499d2edba7bc0ca73a4ca (patch)
tree4e199afc17570dec845afd9d031abf8ce829228f /tools/testing/selftests/lib.mk
parentLinux 6.0-rc5 (diff)
downloadlinux-dev-a52540522c9541bfa3e499d2edba7bc0ca73a4ca.tar.xz
linux-dev-a52540522c9541bfa3e499d2edba7bc0ca73a4ca.zip
selftests/landlock: Fix out-of-tree builds
These changes simplify the Makefile and handle these 5 ways to build Landlock tests: - make -C tools/testing/selftests/landlock - make -C tools/testing/selftests TARGETS=landlock gen_tar - make TARGETS=landlock kselftest-gen_tar - make TARGETS=landlock O=build kselftest-gen_tar - make -C /tmp/linux TARGETS=landlock O=/tmp/build kselftest-gen_tar This also makes $(KHDR_INCLUDES) available to other test collections when building in their directory. Fixes: f1227dc7d041 ("selftests/landlock: fix broken include of linux/landlock.h") Fixes: 3bb267a36185 ("selftests: drop khdr make target") Cc: Anders Roxell <anders.roxell@linaro.org> Cc: Guillaume Tucker <guillaume.tucker@collabora.com> Cc: Mark Brown <broonie@kernel.org> Cc: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Mickaël Salaün <mic@digikod.net> Link: https://lore.kernel.org/r/20220909103402.1501802-1-mic@digikod.net
Diffstat (limited to 'tools/testing/selftests/lib.mk')
-rw-r--r--tools/testing/selftests/lib.mk4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index d44c72b3abe3..9d4cb94cf437 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -42,6 +42,10 @@ endif
selfdir = $(realpath $(dir $(filter %/lib.mk,$(MAKEFILE_LIST))))
top_srcdir = $(selfdir)/../../..
+ifeq ($(KHDR_INCLUDES),)
+KHDR_INCLUDES := -isystem $(top_srcdir)/usr/include
+endif
+
# The following are built by lib.mk common compile rules.
# TEST_CUSTOM_PROGS should be used by tests that require
# custom build rule and prevent common build rule use.