Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
510 B
Makefile
Raw Permalink Normal View History

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