mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-02 03:03:00 +09:00
[ Upstream commit 26e6dd1072 ]
selftests/bpf/Makefile includes lib.mk. With the following command
make -j60 LLVM=1 LLVM_IAS=1 <=== compile kernel
make -j60 -C tools/testing/selftests/bpf LLVM=1 LLVM_IAS=1 V=1
some files are still compiled with gcc. This patch
fixed lib.mk issue which sets CC to gcc in all cases.
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210413153413.3027426-1-yhs@fb.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
43 lines
1.1 KiB
Makefile
43 lines
1.1 KiB
Makefile
# This mimics the top-level Makefile. We do it explicitly here so that this
|
|
# Makefile can operate with or without the kbuild infrastructure.
|
|
ifneq ($(LLVM),)
|
|
CC := clang
|
|
else
|
|
CC := $(CROSS_COMPILE)gcc
|
|
endif
|
|
|
|
define RUN_TESTS
|
|
@for TEST in $(TEST_PROGS); do \
|
|
(./$$TEST && echo "selftests: $$TEST [PASS]") || echo "selftests: $$TEST [FAIL]"; \
|
|
done;
|
|
endef
|
|
|
|
run_tests: all
|
|
$(RUN_TESTS)
|
|
|
|
define INSTALL_RULE
|
|
@if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then \
|
|
mkdir -p ${INSTALL_PATH}; \
|
|
echo "rsync -a $(TEST_DIRS) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/"; \
|
|
rsync -a $(TEST_DIRS) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/; \
|
|
fi
|
|
endef
|
|
|
|
install: all
|
|
ifdef INSTALL_PATH
|
|
$(INSTALL_RULE)
|
|
else
|
|
$(error Error: set INSTALL_PATH to use install)
|
|
endif
|
|
|
|
define EMIT_TESTS
|
|
@for TEST in $(TEST_PROGS); do \
|
|
echo "(./$$TEST && echo \"selftests: $$TEST [PASS]\") || echo \"selftests: $$TEST [FAIL]\""; \
|
|
done;
|
|
endef
|
|
|
|
emit_tests:
|
|
$(EMIT_TESTS)
|
|
|
|
.PHONY: run_tests all clean install emit_tests
|