diff --cc tools/testing/selftests/bpf/Makefile index c7816fe60feb,058351b0694f..000000000000 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@@ -1,26 -1,7 +1,20 @@@ -CFLAGS += -Wall -O2 -I../../../../usr/include +LIBDIR := ../../../lib +BPFOBJ := $(LIBDIR)/bpf/bpf.o -TEST_GEN_PROGS = test_verifier test_maps test_lru_map +CFLAGS += -Wall -O2 -lcap -I../../../include/uapi -I$(LIBDIR) + - test_objs = test_verifier test_tag test_maps test_lru_map test_lpm_map ++TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_lpm_map - TEST_PROGS := $(test_objs) test_kmod.sh - TEST_FILES := $(test_objs) + TEST_PROGS := test_kmod.sh +.PHONY: all clean force + - all: $(test_objs) - +# force a rebuild of BPFOBJ when its dependencies are updated +force: + +$(BPFOBJ): force + $(MAKE) -C $(dir $(BPFOBJ)) + +$(test_objs): $(BPFOBJ) + include ../lib.mk - - clean: - $(RM) $(test_objs)