]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - tools/testing/selftests/bpf/Makefile
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[mirror_ubuntu-artful-kernel.git] / tools / testing / selftests / bpf / Makefile
1 LIBDIR := ../../../lib
2 BPFDIR := $(LIBDIR)/bpf
3 APIDIR := ../../../include/uapi
4 GENDIR := ../../../../include/generated
5 GENHDR := $(GENDIR)/autoconf.h
6
7 ifneq ($(wildcard $(GENHDR)),)
8 GENFLAGS := -DHAVE_GENHDR
9 endif
10
11 CFLAGS += -Wall -O2 -I$(APIDIR) -I$(LIBDIR) -I$(GENDIR) $(GENFLAGS) -I../../../include
12 LDLIBS += -lcap -lelf
13
14 TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_lpm_map test_progs \
15 test_align
16
17 TEST_GEN_FILES = test_pkt_access.o test_xdp.o test_l4lb.o test_tcp_estats.o test_obj_id.o \
18 test_pkt_md_access.o
19
20 TEST_PROGS := test_kmod.sh
21
22 include ../lib.mk
23
24 BPFOBJ := $(OUTPUT)/libbpf.a
25
26 $(TEST_GEN_PROGS): $(BPFOBJ)
27
28 .PHONY: force
29
30 # force a rebuild of BPFOBJ when its dependencies are updated
31 force:
32
33 $(BPFOBJ): force
34 $(MAKE) -C $(BPFDIR) OUTPUT=$(OUTPUT)/
35
36 CLANG ?= clang
37
38 %.o: %.c
39 $(CLANG) -I. -I./include/uapi -I../../../include/uapi \
40 -Wno-compare-distinct-pointer-types \
41 -O2 -target bpf -c $< -o $@