# xdp
/src/libknot/xdp/bpf-kernel.ll
-!/src/libknot/xdp/Makefile
# Binaries
/src/kdig
python/setup.py
python/libknot/__init__.py
src/Makefile
+ src/libknot/xdp/Makefile
src/knot/modules/static_modules.h
])
libknot/xdp/eth-tools.c \
libknot/xdp/eth-tools.h
endif ENABLE_XDP
+
+DIST_SUBDIRS = libknot/xdp
+++ /dev/null
-
-all: bpf-kernel.o
-
-# Fix missing asm/types.h
-bpf-kernel.ll: bpf-kernel.c
- clang -S -target bpf -Wall -O2 -emit-llvm -c -DNDEBUG -o bpf-kernel.ll -I/usr/include/x86_64-linux-gnu bpf-kernel.c
-
-bpf-kernel.o: bpf-kernel.ll
- llc -march=bpf -filetype=obj -o bpf-kernel.o bpf-kernel.ll
- xxd -i bpf-kernel.o > bpf-kernel-obj.c
-
-clean:
- rm -f bpf-kernel.ll bpf-kernel.o bpf-kernel-obj.c
-
--- /dev/null
+# Useful commands:
+# ip link show $eth
+# sudo ip link set dev $eth xdp off
+# sudo ip link set dev $eth xdp obj ./bpf-kernel.o
+
+BUILT_SOURCES = bpf-kernel-obj.c
+CLEANFILES = bpf-kernel.ll bpf-kernel.o bpf-kernel-obj.c
+EXTRA_DIST = bpf-kernel.c
+
+bpf-kernel.ll: bpf-kernel.c
+ clang -S -target bpf -Wall -O2 -emit-llvm -c -DNDEBUG -o $@ -I/usr/include/x86_64-linux-gnu $<
+
+bpf-kernel.o: bpf-kernel.ll
+ llc -march=bpf -filetype=obj -o $@ $<
+
+bpf-kernel-obj.c: bpf-kernel.o
+ xxd -i $< > $@