Skip to content

Commit d498f87

Browse files
l0koddavem330
authored andcommitted
bpf: Rebuild bpf.o for any dependency update
This is needed to force a rebuild of bpf.o when one of its dependencies (e.g. uapi/linux/bpf.h) is updated. Add a phony target. Signed-off-by: Mickaël Salaün <mic@digikod.net> Cc: Alexei Starovoitov <ast@fb.com> Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: David S. Miller <davem@davemloft.net> Cc: Wang Nan <wangnan0@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent cdc6a4b commit d498f87

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

tools/testing/selftests/bpf/Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
1-
CFLAGS += -Wall -O2 -lcap -I../../../include/uapi -I../../../lib
1+
LIBDIR := ../../../lib
2+
BPFOBJ := $(LIBDIR)/bpf/bpf.o
3+
4+
CFLAGS += -Wall -O2 -lcap -I../../../include/uapi -I$(LIBDIR)
25

36
test_objs = test_verifier test_tag test_maps test_lru_map test_lpm_map
47

58
TEST_PROGS := $(test_objs) test_kmod.sh
69
TEST_FILES := $(test_objs)
710

11+
.PHONY: all clean force
12+
813
all: $(test_objs)
914

10-
$(test_objs): ../../../lib/bpf/bpf.o
15+
# force a rebuild of BPFOBJ when its dependencies are updated
16+
force:
17+
18+
$(BPFOBJ): force
19+
$(MAKE) -C $(dir $(BPFOBJ))
20+
21+
$(test_objs): $(BPFOBJ)
1122

1223
include ../lib.mk
1324

0 commit comments

Comments
 (0)