master
ebpf 24 lines 510 Bytes
Raw
1 SKELETONS = rss.bpf.skeleton.h
2
3 LLVM_STRIP ?= llvm-strip
4 CLANG ?= clang
5 INC_FLAGS = `$(CLANG) -print-file-name=include`
6 EXTRA_CFLAGS ?= -O2 -g -target bpf
7
8 all: $(SKELETONS)
9
10 .PHONY: clean
11
12 clean:
13 rm -f $(SKELETONS) $(SKELETONS:%.skeleton.h=%.o)
14
15 %.o: %.c
16 $(CLANG) $(INC_FLAGS) \
17 -D__KERNEL__ -D__ASM_SYSREG_H \
18 -I../include $(LINUXINCLUDE) \
19 $(EXTRA_CFLAGS) -c $< -o $@
20 $(LLVM_STRIP) -g $@
21
22 %.skeleton.h: %.o
23 bpftool gen skeleton $< > $@
24 cp $@ ../../ebpf/