2 BPFDIR := $(LIBDIR)/bpf
3 APIDIR := ../../../include/uapi
4 GENDIR := ../../../../include/generated
5 GENHDR := $(GENDIR)/autoconf.h
7 ifneq ($(wildcard $(GENHDR)),)
8 GENFLAGS := -DHAVE_GENHDR
11 CFLAGS += -Wall -O2 -I$(APIDIR) -I$(LIBDIR) -I$(GENDIR) $(GENFLAGS) -I../../../include
14 TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_lpm_map test_progs \
17 TEST_GEN_FILES = test_pkt_access.o test_xdp.o test_l4lb.o test_tcp_estats.o test_obj_id.o \
20 TEST_PROGS := test_kmod.sh
24 BPFOBJ := $(OUTPUT)/libbpf.a
26 $(TEST_GEN_PROGS): $(BPFOBJ)
30 # force a rebuild of BPFOBJ when its dependencies are updated
34 $(MAKE) -C $(BPFDIR) OUTPUT=$(OUTPUT)/
39 $(CLANG) -I. -I./include/uapi -I../../../include/uapi \
40 -I../../../../samples/bpf/ \
41 -Wno-compare-distinct-pointer-types \
42 -O2 -target bpf -c $< -o $@