aboutsummaryrefslogtreecommitdiff
path: root/tools/ebpf/Makefile.ebpf
blob: 8f327ae3b821a5ca737dbf3da65fa22a4c018f9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
OBJS = rss.bpf.o

LLC ?= llc
CLANG ?= clang
INC_FLAGS = `$(CLANG) -print-file-name=include`
EXTRA_CFLAGS ?= -O2 -emit-llvm -fno-stack-protector

all: $(OBJS)

.PHONY: clean

clean:
	rm -f $(OBJS)

$(OBJS):  %.o:%.c
	$(CLANG) $(INC_FLAGS) \
                -D__KERNEL__ -D__ASM_SYSREG_H \
                -I../include $(LINUXINCLUDE) \
                $(EXTRA_CFLAGS) -c $< -o -| $(LLC) -march=bpf -filetype=obj -o $@
	bpftool gen skeleton rss.bpf.o > rss.bpf.skeleton.h
	cp rss.bpf.skeleton.h ../../ebpf/