From: Daniel Salzman Date: Fri, 17 Jan 2020 11:43:49 +0000 (+0100) Subject: xdp: manage the Makefile by autotools X-Git-Tag: embedded_lmdb~35^2~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fea816ffbde3ba26e48da13bd10d2e6b14613dba;p=thirdparty%2Fknot-dns.git xdp: manage the Makefile by autotools --- diff --git a/.gitignore b/.gitignore index ea9b6c8706..958f3f5f2c 100644 --- a/.gitignore +++ b/.gitignore @@ -61,7 +61,6 @@ version.h # xdp /src/libknot/xdp/bpf-kernel.ll -!/src/libknot/xdp/Makefile # Binaries /src/kdig diff --git a/configure.ac b/configure.ac index c9442b5a2e..f1f6248770 100644 --- a/configure.ac +++ b/configure.ac @@ -770,6 +770,7 @@ AC_CONFIG_FILES([Makefile python/setup.py python/libknot/__init__.py src/Makefile + src/libknot/xdp/Makefile src/knot/modules/static_modules.h ]) diff --git a/src/libknot/Makefile.inc b/src/libknot/Makefile.inc index 1b3f0e3efe..8ee92f4dee 100644 --- a/src/libknot/Makefile.inc +++ b/src/libknot/Makefile.inc @@ -89,3 +89,5 @@ libknot_la_SOURCES += \ libknot/xdp/eth-tools.c \ libknot/xdp/eth-tools.h endif ENABLE_XDP + +DIST_SUBDIRS = libknot/xdp diff --git a/src/libknot/xdp/Makefile b/src/libknot/xdp/Makefile deleted file mode 100644 index 41c7131c5b..0000000000 --- a/src/libknot/xdp/Makefile +++ /dev/null @@ -1,14 +0,0 @@ - -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 - diff --git a/src/libknot/xdp/Makefile.am b/src/libknot/xdp/Makefile.am new file mode 100644 index 0000000000..cd0b5ea4da --- /dev/null +++ b/src/libknot/xdp/Makefile.am @@ -0,0 +1,17 @@ +# 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 $< > $@