]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
xdp: manage the Makefile by autotools
authorDaniel Salzman <daniel.salzman@nic.cz>
Fri, 17 Jan 2020 11:43:49 +0000 (12:43 +0100)
committerDaniel Salzman <daniel.salzman@nic.cz>
Tue, 21 Apr 2020 16:43:10 +0000 (18:43 +0200)
.gitignore
configure.ac
src/libknot/Makefile.inc
src/libknot/xdp/Makefile [deleted file]
src/libknot/xdp/Makefile.am [new file with mode: 0644]

index ea9b6c870606f9ccdad2a9b79039b13868c6fd06..958f3f5f2c30f48dfd01f4de831dda2ad36b1cf3 100644 (file)
@@ -61,7 +61,6 @@ version.h
 
 # xdp
 /src/libknot/xdp/bpf-kernel.ll
-!/src/libknot/xdp/Makefile
 
 # Binaries
 /src/kdig
index c9442b5a2e28fce9bf81ac7e6ae3c2c86475ee4d..f1f6248770f40beaf0e5ed4d6441abdb6a2a1b86 100644 (file)
@@ -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
                  ])
 
index 1b3f0e3efe36cda4958727d7c44232dfab1176a0..8ee92f4deeae67792c06fb516245734c49419ef8 100644 (file)
@@ -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 (file)
index 41c7131..0000000
+++ /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 (file)
index 0000000..cd0b5ea
--- /dev/null
@@ -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 $< > $@