Skip to content

Commit be8e754

Browse files
bjorn-rivosborkmann
authored andcommitted
selftests/bpf: Include build flavors for install target
When using the "install" or targets depending on install, e.g. "gen_tar", the BPF machine flavors weren't included. A command like: | make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- O=/workspace/kbuild \ | HOSTCC=gcc FORMAT= SKIP_TARGETS="arm64 ia64 powerpc sparc64 x86 sgx" \ | -C tools/testing/selftests gen_tar would not include bpf/no_alu32, bpf/cpuv4, or bpf/bpf-gcc. Include the BPF machine flavors for "install" make target. Signed-off-by: Björn Töpel <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 6a86b5b commit be8e754

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tools/testing/selftests/bpf/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,17 @@ TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_lpm_map test
5050
test_cgroup_storage \
5151
test_tcpnotify_user test_sysctl \
5252
test_progs-no_alu32
53+
TEST_INST_SUBDIRS := no_alu32
5354

5455
# Also test bpf-gcc, if present
5556
ifneq ($(BPF_GCC),)
5657
TEST_GEN_PROGS += test_progs-bpf_gcc
58+
TEST_INST_SUBDIRS += bpf_gcc
5759
endif
5860

5961
ifneq ($(CLANG_CPUV4),)
6062
TEST_GEN_PROGS += test_progs-cpuv4
63+
TEST_INST_SUBDIRS += cpuv4
6164
endif
6265

6366
TEST_GEN_FILES = test_lwt_ip_encap.bpf.o test_tc_edt.bpf.o
@@ -714,3 +717,12 @@ EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(SCRATCH_DIR) $(HOST_SCRATCH_DIR) \
714717

715718
# Delete partially updated (corrupted) files on error
716719
.DELETE_ON_ERROR:
720+
721+
DEFAULT_INSTALL_RULE := $(INSTALL_RULE)
722+
override define INSTALL_RULE
723+
$(DEFAULT_INSTALL_RULE)
724+
@for DIR in $(TEST_INST_SUBDIRS); do \
725+
mkdir -p $(INSTALL_PATH)/$$DIR; \
726+
rsync -a $(OUTPUT)/$$DIR/*.bpf.o $(INSTALL_PATH)/$$DIR;\
727+
done
728+
endef

0 commit comments

Comments
 (0)