[PATCH v2 1/6] selftests: Create directory when OUTPUT specified

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When OUTPUT specified, it may encounter no directory error if there is
subdir in $TARGET for any of TEST_GEN_PROGS, TEST_GEN_PROGS_EXTENDED, or
TEST_GEN_FILES.

This issue is found by running

	make OUTPUT=/path/to/output

in tools/testing/selftests/kvm

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

diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 1c8a1963d03f..78fb00bdf5c4 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -20,6 +20,16 @@ TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS))
 TEST_GEN_PROGS_EXTENDED := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS_EXTENDED))
 TEST_GEN_FILES := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_FILES))
 
+ifneq ($(TEST_GEN_PROGS),)
+$(shell mkdir -p $(sort $(dir $(TEST_GEN_PROGS))))
+endif
+ifneq ($(TEST_GEN_PROGS_EXTENDED),)
+$(shell mkdir -p $(sort $(dir $(TEST_GEN_PROGS_EXTENDED))))
+endif
+ifneq ($(TEST_GEN_FILES),)
+$(shell mkdir -p $(sort $(dir $(TEST_GEN_FILES))))
+endif
+
 ifdef KSFT_KHDR_INSTALL
 top_srcdir ?= ../../../..
 include $(top_srcdir)/scripts/subarch.include
-- 
2.20.1




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux