blob: 03181b895c1f6acda8711101b79ac5ba03fa25f4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
export LIBBPFGO = $(CURDIR)/../../../libbpfgo
export CC = clang
SOURCES := $(wildcard *.bpf.c)
TARGETS := $(SOURCES:.bpf.c=.bpf.o)
all: $(TARGETS)
# Only required when linking multiple .o into a single .o (not doing that atm)
# bpftool gen object ioriotng.bpf.o $(TARGETS)
%.bpf.o: %.bpf.c vmlinux.h
$(CC) -g -O2 -Wall -fpie -target bpf -D__TARGET_ARCH_amd64 \
-I$(LIBBPFGO)/output -c $< -o $@
vmlinux.h:
bpftool btf dump file /sys/kernel/btf/vmlinux format c > vmlinux.h
.PHONY: clean
clean:
find . -name \*.o -delete
find . -name vmlinux.h -delete
|