From 7394a6b188c2a6c0d5ae72f8bba5fddc9720613b Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sun, 20 Sep 2020 04:32:40 +0200 Subject: Add Makefile for generating src/ffi.rs This patch adds a Makefile to make it easier to generate the src/ffi.rs file using bindgen. As we can use whitelists instead of manually removing the unnecessary type definitions, we also re-generate the file with the new settings. --- Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..dc55e2f --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +BINDGEN ?= bindgen +LIBNITROKEY ?= $(wildcard libnitrokey-v*) + +src/ffi.rs: ${LIBNITROKEY}/NK_C_API.h + ${BINDGEN} \ + --whitelist-function "NK_.*" \ + --whitelist-var "NK_.*" \ + --whitelist-var "MAXIMUM_STR_REPLY_LENGTH" \ + --output "$@" \ + "$<" \ + -- "-I${LIBNITROKEY}/libnitrokey" -- cgit v1.2.3