diff mbox series

[for-next,1/2] selftests/Makefile: Create BUILD_TARGET directory for INSTALL_DEP_TARGETS

Message ID 20241219085803.1145606-2-lizhijian@fujitsu.com
State New
Headers show
Series selftests: Fix run_tests and install for net TARGET | expand

Commit Message

Li Zhijian Dec. 19, 2024, 8:58 a.m. UTC
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@fujitsu.com>
---
 tools/testing/selftests/Makefile | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

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)) \