25 lines
558 B
Makefile
25 lines
558 B
Makefile
LLC ?= llc
|
|
CLANG ?= clang
|
|
CC ?= gcc
|
|
|
|
ARCH := arm64
|
|
INCLUDES := -I/usr/include/bpf -I/usr/include/ -I/usr/include/x86_64-linux-gnu
|
|
LIBS := -lbpf -lelf -lz
|
|
|
|
all: bridge_xdp.o loader
|
|
|
|
bridge_xdp.o: bridge_xdp.c
|
|
$(CLANG) -S \
|
|
-target bpf \
|
|
-D __BPF_TRACING__ \
|
|
$(INCLUDES) \
|
|
-Wall \
|
|
-O2 -emit-llvm -c -o bridge_xdp.ll bridge_xdp.c
|
|
$(LLC) -march=bpf -mcpu=v3 -mattr=+alu32 -filetype=obj -o bridge_xdp.o bridge_xdp.ll
|
|
|
|
loader: loader.c
|
|
$(CC) -Wall $(INCLUDES) -o loader loader.c $(LIBS)
|
|
|
|
clean:
|
|
rm -f bridge_xdp.o bridge_xdp.ll loader
|