Skip to content

Commit 1ec4332

Browse files
musamaanjumNobody
authored andcommitted
selftests: Fix build when $(O) points to a relative path
Build of bpf and tc-testing selftests fails when the relative path of the build directory is specified. make -C tools/testing/selftests O=build0 make[1]: Entering directory '/linux_mainline/tools/testing/selftests/bpf' ../../../scripts/Makefile.include:4: *** O=build0 does not exist. Stop. make[1]: Entering directory '/linux_mainline/tools/testing/selftests/tc-testing' ../../../scripts/Makefile.include:4: *** O=build0 does not exist. Stop. Makefiles of bpf and tc-testing include scripts/Makefile.include file. This file has sanity checking inside it which checks the output path. The output path is not relative to the bpf or tc-testing. The sanity check fails. Expand the output path to get rid of this error. The fix is the same as mentioned in commit 150a273 ("bpf, preload: Fix build when $(O) points to a relative path"). Signed-off-by: Muhammad Usama Anjum <[email protected]>
1 parent 7435e75 commit 1ec4332

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/testing/selftests/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,16 @@ all: khdr
165165
BUILD_TARGET=$$BUILD/$$TARGET; \
166166
mkdir $$BUILD_TARGET -p; \
167167
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET \
168+
O=$(abs_objtree) \
168169
$(if $(FORCE_TARGETS),|| exit); \
169170
ret=$$((ret * $$?)); \
170171
done; exit $$ret;
171172

172173
run_tests: all
173174
@for TARGET in $(TARGETS); do \
174175
BUILD_TARGET=$$BUILD/$$TARGET; \
175-
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests;\
176+
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests \
177+
O=$(abs_objtree); \
176178
done;
177179

178180
hotplug:
@@ -223,6 +225,7 @@ ifdef INSTALL_PATH
223225
for TARGET in $(TARGETS); do \
224226
BUILD_TARGET=$$BUILD/$$TARGET; \
225227
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install \
228+
O=$(abs_objtree) \
226229
$(if $(FORCE_TARGETS),|| exit); \
227230
ret=$$((ret * $$?)); \
228231
done; exit $$ret;

0 commit comments

Comments
 (0)