Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: Adapt OUTPUT appending logic to lower versions of Make

The $(let ...) function is only supported by GNU Make version 4.4 [0]
and above, otherwise the following exception file or directory will be
generated:

tools/testing/selftests/bpfFEATURE-DUMP.selftests
tools/testing/selftests/bpffeature/

Considering that the GNU Make version of most Linux distributions is
lower than 4.4, let us adapt the corresponding logic to it.

Link: https://lists.gnu.org/archive/html/info-gnu/2022-10/msg00008.html [0]
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Pu Lehui <pulehui@huawei.com>
Link: https://lore.kernel.org/r/20240905081401.1894789-2-pulehui@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Pu Lehui and committed by
Alexei Starovoitov
dc3a8804 bd4d67f8

+6
+6
tools/testing/selftests/bpf/Makefile
··· 187 187 FEATURE_DISPLAY := $(FEATURE_TESTS) 188 188 189 189 # Makefile.feature expects OUTPUT to end with a slash 190 + ifeq ($(shell expr $(MAKE_VERSION) \>= 4.4), 1) 190 191 $(let OUTPUT,$(OUTPUT)/,\ 191 192 $(eval include ../../../build/Makefile.feature)) 193 + else 194 + OUTPUT := $(OUTPUT)/ 195 + $(eval include ../../../build/Makefile.feature) 196 + OUTPUT := $(patsubst %/,%,$(OUTPUT)) 197 + endif 192 198 endif 193 199 194 200 ifeq ($(feature-llvm),1)