2017-02-11 23:20:23 +01:00
|
|
|
LIBDIR := ../../../lib
|
2017-03-19 23:03:14 -07:00
|
|
|
BPFDIR := $(LIBDIR)/bpf
|
2017-03-31 02:24:04 +02:00
|
|
|
APIDIR := ../../../include/uapi
|
|
|
|
|
GENDIR := ../../../../include/generated
|
|
|
|
|
GENHDR := $(GENDIR)/autoconf.h
|
2017-02-11 23:20:23 +01:00
|
|
|
|
2017-03-31 02:24:04 +02:00
|
|
|
ifneq ($(wildcard $(GENHDR)),)
|
|
|
|
|
GENFLAGS := -DHAVE_GENHDR
|
|
|
|
|
endif
|
|
|
|
|
|
2017-04-06 07:25:07 -07:00
|
|
|
CFLAGS += -Wall -O2 -I$(APIDIR) -I$(LIBDIR) -I$(GENDIR) $(GENFLAGS) -I../../../include
|
2017-03-30 21:45:41 -07:00
|
|
|
LDLIBS += -lcap -lelf
|
2016-10-17 14:28:36 +02:00
|
|
|
|
2017-05-10 11:43:51 -07:00
|
|
|
TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_lpm_map test_progs \
|
|
|
|
|
test_align
|
2017-03-30 21:45:41 -07:00
|
|
|
|
2017-06-13 15:52:14 -07:00
|
|
|
TEST_GEN_FILES = test_pkt_access.o test_xdp.o test_l4lb.o test_tcp_estats.o test_obj_id.o \
|
|
|
|
|
test_pkt_md_access.o
|
2016-10-17 14:28:36 +02:00
|
|
|
|
2016-11-29 19:55:47 +08:00
|
|
|
TEST_PROGS := test_kmod.sh
|
2016-10-17 14:28:36 +02:00
|
|
|
|
2017-03-19 23:03:14 -07:00
|
|
|
include ../lib.mk
|
|
|
|
|
|
2017-03-30 21:45:41 -07:00
|
|
|
BPFOBJ := $(OUTPUT)/libbpf.a
|
2017-03-19 23:03:14 -07:00
|
|
|
|
|
|
|
|
$(TEST_GEN_PROGS): $(BPFOBJ)
|
2017-03-10 22:05:55 -08:00
|
|
|
|
2017-03-19 23:03:14 -07:00
|
|
|
.PHONY: force
|
2017-02-11 23:20:23 +01:00
|
|
|
|
|
|
|
|
# force a rebuild of BPFOBJ when its dependencies are updated
|
|
|
|
|
force:
|
|
|
|
|
|
|
|
|
|
$(BPFOBJ): force
|
2017-03-19 23:03:14 -07:00
|
|
|
$(MAKE) -C $(BPFDIR) OUTPUT=$(OUTPUT)/
|
2017-03-30 21:45:41 -07:00
|
|
|
|
|
|
|
|
CLANG ?= clang
|
|
|
|
|
|
|
|
|
|
%.o: %.c
|
2017-05-11 12:00:50 -07:00
|
|
|
$(CLANG) -I. -I./include/uapi -I../../../include/uapi \
|
2017-05-02 21:14:43 -07:00
|
|
|
-Wno-compare-distinct-pointer-types \
|
2017-03-30 21:45:41 -07:00
|
|
|
-O2 -target bpf -c $< -o $@
|