qemu/tools/ebpf/Makefile.ebpf
Akihiko Odaki 6832aa80a1 ebpf: Add a separate target for skeleton
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>
2024-06-04 15:14:26 +08:00

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/