lkml.org 
[lkml]   [2020]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 1/6] selftests: Create directory when OUTPUT specified
Date
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@intel.com>
---
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
\
 
 \ /
  Last update: 2020-03-25 15:20    [W:0.107 / U:8.644 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site