linux/tools/testing/selftests/bpf/Makefile
<<
>>
Prefs
   1LIBDIR := ../../../lib
   2BPFDIR := $(LIBDIR)/bpf
   3APIDIR := ../../../include/uapi
   4GENDIR := ../../../../include/generated
   5GENHDR := $(GENDIR)/autoconf.h
   6
   7ifneq ($(wildcard $(GENHDR)),)
   8  GENFLAGS := -DHAVE_GENHDR
   9endif
  10
  11CFLAGS += -Wall -O2 -I$(APIDIR) -I$(LIBDIR) -I$(GENDIR) $(GENFLAGS) -I../../../include
  12LDLIBS += -lcap -lelf
  13
  14TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_lpm_map test_progs \
  15        test_align
  16
  17TEST_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
  20TEST_PROGS := test_kmod.sh
  21
  22include ../lib.mk
  23
  24BPFOBJ := $(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
  31force:
  32
  33$(BPFOBJ): force
  34        $(MAKE) -C $(BPFDIR) OUTPUT=$(OUTPUT)/
  35
  36CLANG ?= 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 $@
  42