@@ -1072,12 +1072,21 @@ headers_check: headers_install
$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1
# ---------------------------------------------------------------------------
-# Kernel selftest
+# Kernel selftest targets
+
+# Default base path for kselftest install
+INSTALL_KSFT_PATH = $(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE)
+export INSTALL_KSFT_PATH
PHONY += kselftest
kselftest:
$(Q)$(MAKE) -C tools/testing/selftests run_tests
+# Kernel selftest install
+PHONY += kselftest_install
+kselftest_install:
+ $(Q)$(MAKE) -C tools/testing/selftests install
+
# ---------------------------------------------------------------------------
# Modules
@@ -1286,6 +1295,9 @@ help:
@echo ' Build, install, and boot kernel before'
@echo ' running kselftest on it'
@echo ''
+ @echo ' kselftest_install - Install Kselftests to INSTALL_KSFT_PATH'
+ @echo ' default: $(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE)'
+ @echo ''
@echo 'Kernel packaging:'
@$(MAKE) $(build)=$(package-dir) help
@echo ''
Add a new make target to install to install kernel selftests. This new target will build and install selftests. kselftest target now depends on kselftest_install and runs the generated kselftest script to reduce duplicate work and for common look and feel when running tests. make kselftest_target: -- exports kselftest INSTALL_KSFT_PATH default $(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE) -- exports INSTALL_KSFT_PATH -- runs selftests make install target: Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com> --- Makefile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)