Merge branches 'intel_pstate', 'pm-cpufreq' and 'pm-cpufreq-sched'
[sfrench/cifs-2.6.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
18
19 TEST_PROGS := test_kmod.sh
20
21 include ../lib.mk
22
23 BPFOBJ := $(OUTPUT)/libbpf.a
24
25 $(TEST_GEN_PROGS): $(BPFOBJ)
26
27 .PHONY: force
28
29 # force a rebuild of BPFOBJ when its dependencies are updated
30 force:
31
32 $(BPFOBJ): force
33         $(MAKE) -C $(BPFDIR) OUTPUT=$(OUTPUT)/
34
35 CLANG ?= clang
36
37 %.o: %.c
38         $(CLANG) -I. -I./include/uapi -I../../../include/uapi \
39                 -I../../../../samples/bpf/ \
40                 -Wno-compare-distinct-pointer-types \
41                 -O2 -target bpf -c $< -o $@