2021-05-14 14:48:31 +03:00
|
|
|
OBJS = rss.bpf.o
|
|
|
|
|
2022-12-18 17:39:27 +03:00
|
|
|
LLVM_STRIP ?= llvm-strip
|
2021-05-14 14:48:31 +03:00
|
|
|
CLANG ?= clang
|
|
|
|
INC_FLAGS = `$(CLANG) -print-file-name=include`
|
2022-12-18 17:39:27 +03:00
|
|
|
EXTRA_CFLAGS ?= -O2 -g -target bpf
|
2021-05-14 14:48:31 +03:00
|
|
|
|
|
|
|
all: $(OBJS)
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(OBJS)
|
2022-12-18 17:39:27 +03:00
|
|
|
rm -f rss.bpf.skeleton.h
|
2021-05-14 14:48:31 +03:00
|
|
|
|
|
|
|
$(OBJS): %.o:%.c
|
|
|
|
$(CLANG) $(INC_FLAGS) \
|
|
|
|
-D__KERNEL__ -D__ASM_SYSREG_H \
|
|
|
|
-I../include $(LINUXINCLUDE) \
|
2022-12-18 17:39:27 +03:00
|
|
|
$(EXTRA_CFLAGS) -c $< -o $@
|
|
|
|
$(LLVM_STRIP) -g $@
|
2021-05-14 14:48:31 +03:00
|
|
|
bpftool gen skeleton rss.bpf.o > rss.bpf.skeleton.h
|
|
|
|
cp rss.bpf.skeleton.h ../../ebpf/
|