WIP FPC-III support
[linux/fpc-iii.git] / tools / testing / selftests / tc-testing / Makefile
blob91fee5c43274568d17511e20f8a11038c1b13330
1 # SPDX-License-Identifier: GPL-2.0
3 top_srcdir = $(abspath ../../../..)
4 APIDIR := $(top_scrdir)/include/uapi
5 TEST_GEN_FILES = action.o
7 KSFT_KHDR_INSTALL := 1
8 include ../lib.mk
10 CLANG ?= clang
11 LLC ?= llc
12 PROBE := $(shell $(LLC) -march=bpf -mcpu=probe -filetype=null /dev/null 2>&1)
14 ifeq ($(PROBE),)
15 CPU ?= probe
16 else
17 CPU ?= generic
18 endif
20 CLANG_SYS_INCLUDES := $(shell $(CLANG) -v -E - </dev/null 2>&1 \
21 | sed -n '/<...> search starts here:/,/End of search list./{ s| \(/.*\)|-idirafter \1|p }')
23 CLANG_FLAGS = -I. -I$(APIDIR) \
24 $(CLANG_SYS_INCLUDES) \
25 -Wno-compare-distinct-pointer-types
27 $(OUTPUT)/%.o: %.c
28 $(CLANG) $(CLANG_FLAGS) \
29 -O2 -target bpf -emit-llvm -c $< -o - | \
30 $(LLC) -march=bpf -mcpu=$(CPU) $(LLC_FLAGS) -filetype=obj -o $@
32 TEST_PROGS += ./tdc.sh
33 TEST_FILES := tdc*.py Tdc*.py plugins plugin-lib tc-tests