aboutsummaryrefslogtreecommitdiffstats
path: root/utils/keytable/bpf_protocols/Makefile.am
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2018-05-24 13:30:08 +0100
committerSean Young <sean@mess.org>2018-08-13 10:15:52 +0100
commit91b37c0d9cb71fc2d5f78cc96aa2ef9f3bba145b (patch)
treeaf2d2a94098fe923d4eaa26c4aa2e0d2d6b7c3fa /utils/keytable/bpf_protocols/Makefile.am
parentd6025b0e8c7f57b0f9390f987acc5eed57360d80 (diff)
keytable: add bpf protocols
Add a few BPF protocols and infrastructure for building them. Signed-off-by: Sean Young <sean@mess.org>
Diffstat (limited to 'utils/keytable/bpf_protocols/Makefile.am')
-rw-r--r--utils/keytable/bpf_protocols/Makefile.am21
1 files changed, 21 insertions, 0 deletions
diff --git a/utils/keytable/bpf_protocols/Makefile.am b/utils/keytable/bpf_protocols/Makefile.am
new file mode 100644
index 00000000..5e4b3d67
--- /dev/null
+++ b/utils/keytable/bpf_protocols/Makefile.am
@@ -0,0 +1,21 @@
+# Get Clang's default includes on this system, as opposed to those seen by
+# '-target bpf'. This fixes "missing" files on some architectures/distros,
+# such as asm/byteorder.h, asm/socket.h, asm/sockios.h, sys/cdefs.h etc.
+#
+# Use '-idirafter': Don't interfere with include mechanics except where the
+# build would have failed anyways.
+CLANG_SYS_INCLUDES := $(shell $(CLANG) -v -E - </dev/null 2>&1 \
+ | sed -n '/<...> search starts here:/,/End of search list./{ s| \(/.*\)|-idirafter \1|p }')
+
+%.o: %.c
+ $(CLANG) $(CLANG_SYS_INCLUDES) -I$(top_srcdir)/include -target bpf -O2 -c $<
+
+PROTOCOLS = grundig.o pulse_distance.o pulse_length.o rc_mm.o manchester.o
+
+all: $(PROTOCOLS)
+
+# custom target
+install-data-local:
+ $(install_sh) -d "$(DESTDIR)$(keytableuserdir)/protocols"
+ $(install_sh) -d "$(DESTDIR)$(keytablesystemdir)/protocols"
+ $(install_sh) $(PROTOCOLS) "$(DESTDIR)$(keytablesystemdir)/protocols"

Privacy Policy