diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2020-09-23 12:52:46 +0200 |
---|---|---|
committer | Robin Krahl <robin.krahl@ireas.org> | 2020-09-23 13:03:44 +0200 |
commit | 6d5ca96e4f401b446b2e9490b6d24de5e639880c (patch) | |
tree | 969a3def3de3a41e6dfba52a204e888308d546bc /Makefile | |
parent | c484777f3a7dde9e9fe8f47344fd8a6b30840b78 (diff) | |
download | nitrokey-sys-rs-6d5ca96e4f401b446b2e9490b6d24de5e639880c.tar.gz nitrokey-sys-rs-6d5ca96e4f401b446b2e9490b6d24de5e639880c.tar.bz2 |
Add verify-bindings make target
This patch adds the verify-bindings make target that re-generates the
bindings using bindgen and verifies that they do not differ from the
pre-generated bindings in the Git repository.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -14,3 +14,12 @@ src/ffi.rs: ${LIBNITROKEY}/NK_C_API.h "$<" \ -- "-I${LIBNITROKEY}/libnitrokey" quilt push -a --refresh + +.PHONY: verify-bindings +verify-bindings: + @git diff --exit-code src/ffi.rs || \ + (echo "This test can only be executed on a clean working tree"; exit 1) + @$(MAKE) --always-make src/ffi.rs > /dev/null + @git diff --exit-code src/ffi.rs && \ + (echo "The generated bindings have been verified successfully!") || \ + (echo "Error: The generated bindings differ from the pre-generated bindings!"; exit 1) |