selftests/bpf: add a test case to check verifier pointer arithmetic
[linux-2.6/btrfs-unstable.git] / tools / testing / selftests / bpf / Makefile
blobf4341e160de6e4580deadc129f4c84d2172fe4d3
1 LIBDIR := ../../../lib
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
9 endif
11 CFLAGS += -Wall -O2 -I$(APIDIR) -I$(LIBDIR) -I$(GENDIR) $(GENFLAGS) -I../../../include
12 LDLIBS += -lcap -lelf
14 TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_lpm_map test_progs
16 TEST_GEN_FILES = test_pkt_access.o test_xdp.o test_l4lb.o test_tcp_estats.o
18 TEST_PROGS := test_kmod.sh
20 include ../lib.mk
22 BPFOBJ := $(OUTPUT)/libbpf.a
24 $(TEST_GEN_PROGS): $(BPFOBJ)
26 .PHONY: force
28 # force a rebuild of BPFOBJ when its dependencies are updated
29 force:
31 $(BPFOBJ): force
32 $(MAKE) -C $(BPFDIR) OUTPUT=$(OUTPUT)/
34 CLANG ?= clang
36 %.o: %.c
37 $(CLANG) -I../../../include/uapi -I../../../../samples/bpf/ \
38 -D__x86_64__ -Wno-compare-distinct-pointer-types \
39 -O2 -target bpf -c $< -o $@