summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorJiayuan Chen <mrpre@163.com>2024-12-24 15:59:57 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-08 10:01:35 +0100
commit159b45d84b3d7f59d6d11b3a8e1b3770b0d0dec7 (patch)
tree8f81d838a9818ec52a6f60d517b30f6b4b54b952 /tools/testing
parentf5e5828036ff042107a68ed9e7b00ddfa80fce4d (diff)
downloadlinux-159b45d84b3d7f59d6d11b3a8e1b3770b0d0dec7.tar.gz
linux-159b45d84b3d7f59d6d11b3a8e1b3770b0d0dec7.tar.bz2
linux-159b45d84b3d7f59d6d11b3a8e1b3770b0d0dec7.zip
selftests/bpf: Avoid generating untracked files when running bpf selftests
[ Upstream commit 73b9075f334f5debf28646884a320b796b27768d ] Currently, when we run the BPF selftests with the following command: make -C tools/testing/selftests TARGETS=bpf SKIP_TARGETS="" The command generates untracked files and directories with make version less than 4.4: ''' Untracked files: (use "git add <file>..." to include in what will be committed) tools/testing/selftests/bpfFEATURE-DUMP.selftests tools/testing/selftests/bpffeature/ ''' We lost slash after word "bpf". The reason is slash appending code is as follow: ''' OUTPUT := $(OUTPUT)/ $(eval include ../../../build/Makefile.feature) OUTPUT := $(patsubst %/,%,$(OUTPUT)) ''' This way of assigning values to OUTPUT will never be effective for the variable OUTPUT provided via the command argument [1] and BPF makefile is called from parent Makfile(tools/testing/selftests/Makefile) like: ''' all: ... $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET ''' According to GNU make, we can use override Directive to fix this issue [2]. [1] https://www.gnu.org/software/make/manual/make.html#Overriding [2] https://www.gnu.org/software/make/manual/make.html#Override-Directive Fixes: dc3a8804d790 ("selftests/bpf: Adapt OUTPUT appending logic to lower versions of Make") Signed-off-by: Jiayuan Chen <mrpre@163.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Jiri Olsa <jolsa@kernel.org> Link: https://lore.kernel.org/bpf/20241224075957.288018-1-mrpre@163.com Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/bpf/Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 7eeb3cbe18c7..8d206266d98c 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -203,9 +203,9 @@ ifeq ($(shell expr $(MAKE_VERSION) \>= 4.4), 1)
$(let OUTPUT,$(OUTPUT)/,\
$(eval include ../../../build/Makefile.feature))
else
-OUTPUT := $(OUTPUT)/
+override OUTPUT := $(OUTPUT)/
$(eval include ../../../build/Makefile.feature)
-OUTPUT := $(patsubst %/,%,$(OUTPUT))
+override OUTPUT := $(patsubst %/,%,$(OUTPUT))
endif
endif