aboutsummaryrefslogtreecommitdiff
path: root/tools/ebpf/Makefile.ebpf
blob: 572ca5987ae669a6f9972b542b411cd511e891e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
SKELETONS = rss.bpf.skeleton.h

LLVM_STRIP ?= llvm-strip
CLANG ?= clang
INC_FLAGS = `$(CLANG) -print-file-name=include`
EXTRA_CFLAGS ?= -O2 -g -target bpf

all: $(SKELETONS)

.PHONY: clean

clean:
	rm -f $(SKELETONS) $(SKELETONS:%.skeleton.h=%.o)

%.o: %.c
	$(CLANG) $(INC_FLAGS) \
                -D__KERNEL__ -D__ASM_SYSREG_H \
                -I../include $(LINUXINCLUDE) \
                $(EXTRA_CFLAGS) -c $< -o $@
	$(LLVM_STRIP) -g $@

%.skeleton.h: %.o
	bpftool gen skeleton $< > $@
	cp $@ ../../ebpf/