]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/landlock: Fix out-of-tree builds
authorMickaël Salaün <mic@digikod.net>
Fri, 9 Sep 2022 10:34:02 +0000 (12:34 +0200)
committerMickaël Salaün <mic@digikod.net>
Wed, 14 Sep 2022 14:37:38 +0000 (16:37 +0200)
commit195d8e9dfe259a9d26870bf7100a34bd57fa74eb
tree4e199afc17570dec845afd9d031abf8ce829228f
parent6b608845df329724a323dfecf18882dddd8d9e95
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: 8fd1d10ea50a ("selftests/landlock: fix broken include of linux/landlock.h")
Fixes: 24dbcfc68f5f ("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
tools/testing/selftests/landlock/Makefile
tools/testing/selftests/lib.mk