[v2,4/6] selftests: Create variable INSTALL_HDR_PATH if need to install linux headers to $(OUTPUT)/usr
diff mbox series

Message ID 20200325140133.103236-5-xiaoyao.li@intel.com
State New
Headers show
Series
  • Fix errors when try to build kvm selftests on specified output
Related show

Commit Message

Xiaoyao Li March 25, 2020, 2:01 p.m. UTC
So sub TARGETs of selftest can know where the linux headers installed by
checking INSTALL_HDR_PATH.

Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
---
 tools/testing/selftests/lib.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 78fb00bdf5c4..b51ff93da4de 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -35,6 +35,12 @@  top_srcdir ?= ../../../..
 include $(top_srcdir)/scripts/subarch.include
 ARCH		?= $(SUBARCH)
 
+ifndef KSFT_KHDR_INSTALL_DONE
+ifneq (1,$(DEFAULT_INSTALL_HDR_PATH))
+INSTALL_HDR_PATH := $(OUTPUT)/usr
+endif
+endif
+
 # set default goal to all, so make without a target runs all, even when
 # all isn't the first target in the file.
 .DEFAULT_GOAL := all
@@ -59,7 +65,7 @@  ifndef KSFT_KHDR_INSTALL_DONE
 ifeq (1,$(DEFAULT_INSTALL_HDR_PATH))
 	make --no-builtin-rules ARCH=$(ARCH) -C $(top_srcdir) headers_install
 else
-	make --no-builtin-rules INSTALL_HDR_PATH=$$OUTPUT/usr \
+	make --no-builtin-rules INSTALL_HDR_PATH=$(INSTALL_HDR_PATH) \
 		ARCH=$(ARCH) -C $(top_srcdir) headers_install
 endif
 endif