0001
0002 include ../../../scripts/Makefile.include
0003
0004 top_srcdir = $(abspath ../../../..)
0005 APIDIR := $(top_scrdir)/include/uapi
0006 TEST_GEN_FILES = action.o
0007
0008 include ../lib.mk
0009
0010 PROBE := $(shell $(LLC) -march=bpf -mcpu=probe -filetype=null /dev/null 2>&1)
0011
0012 ifeq ($(PROBE),)
0013 CPU ?= probe
0014 else
0015 CPU ?= generic
0016 endif
0017
0018 CLANG_SYS_INCLUDES := $(shell $(CLANG) -v -E - </dev/null 2>&1 \
0019 | sed -n '/<...> search starts here:/,/End of search list./{ s| \(/.*\)|-idirafter \1|p }')
0020
0021 CLANG_FLAGS = -I. -I$(APIDIR) \
0022 $(CLANG_SYS_INCLUDES) \
0023 -Wno-compare-distinct-pointer-types
0024
0025 $(OUTPUT)/%.o: %.c
0026 $(CLANG) $(CLANG_FLAGS) \
0027 -O2 -target bpf -emit-llvm -c $< -o - | \
0028 $(LLC) -march=bpf -mcpu=$(CPU) $(LLC_FLAGS) -filetype=obj -o $@
0029
0030 TEST_PROGS += ./tdc.sh
0031 TEST_FILES := tdc*.py Tdc*.py plugins plugin-lib tc-tests