summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>2025-09-18 11:56:36 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-15 12:03:35 +0200
commita8933a19c39b4d11d97360881d0d5ef50b0dbaac (patch)
tree8fb57fefd72ec82e5c355b9040c35c2c013f5e52 /tools
parent1e6e29aaac1a86e22ddcbe7b6e6e3ac8215a34c1 (diff)
downloadlinux-a8933a19c39b4d11d97360881d0d5ef50b0dbaac.tar.gz
linux-a8933a19c39b4d11d97360881d0d5ef50b0dbaac.tar.bz2
linux-a8933a19c39b4d11d97360881d0d5ef50b0dbaac.zip
selftests: always install UAPI headers to the correct directory
[ Upstream commit 2c55daf7de07158df2ab3835321086beca25a691 ] Currently the UAPI headers are always installed into the source directory. When building out-of-tree this doesn't work, as the include path will be wrong and it dirties the source tree, leading to complains by kbuild. Make sure the 'headers' target installs the UAPI headers in the correctly. The real target directory can come from multiple places. To handle them all extract the target directory from KHDR_INCLUDES. Link: https://lore.kernel.org/r/20250918-kselftest-uapi-out-of-tree-v1-1-f4434f28adcd@linutronix.de Reported-by: Jason Gunthorpe <jgg@nvidia.com> Closes: https://lore.kernel.org/lkml/20250917153209.GA2023406@nvidia.com/ Fixes: 1a59f5d31569 ("selftests: Add headers target") Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/lib.mk5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 530390033929..a448fae57831 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -228,7 +228,10 @@ $(OUTPUT)/%:%.S
$(LINK.S) $^ $(LDLIBS) -o $@
endif
+# Extract the expected header directory
+khdr_output := $(patsubst %/usr/include,%,$(filter %/usr/include,$(KHDR_INCLUDES)))
+
headers:
- $(Q)$(MAKE) -C $(top_srcdir) headers
+ $(Q)$(MAKE) -f $(top_srcdir)/Makefile -C $(khdr_output) headers
.PHONY: run_tests all clean install emit_tests gen_mods_dir clean_mods_dir headers