[PATCH for-next 1/2] selftests/Makefile: Create BUILD_TARGET directory for INSTALL_DEP_TARGETS
From: Li Zhijian
Date: Thu Dec 19 2024 - 03:58:58 EST
Similar to 'all' which will create BUILD_TARGET for TARGETS, we should
create BUILD_TARGET directory for INSTALL_DEP_TARGETS before generate
the binaries.
This helps to fix the following error for net target during
kselftest-install:
$ make O=$build/ kselftest-install TARGETS=net V=1
...
/usr/bin/ld: cannot open output file $O/kselftest/net/lib/csum: No such file or directory
Signed-off-by: Li Zhijian <lizhijian@xxxxxxxxxxx>
---
tools/testing/selftests/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 2401e973c359..fcaebd122d64 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -263,6 +263,7 @@ ifdef INSTALL_PATH
@ret=1; \
for TARGET in $(TARGETS) $(INSTALL_DEP_TARGETS); do \
BUILD_TARGET=$$BUILD/$$TARGET; \
+ mkdir $$BUILD_TARGET -p; \
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET install \
INSTALL_PATH=$(INSTALL_PATH)/$$TARGET \
SRC_PATH=$(shell readlink -e $$(pwd)) \
--
2.44.0