6832aa80a1
This generalizes the rule to generate the skeleton and allows to add another. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
25 lines
510 B
Makefile
Executable File
25 lines
510 B
Makefile
Executable File
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/
|