summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2021-11-25 20:17:27 +0100
committerPhilipp Gesang <phg@phi-gamma.net>2021-11-25 22:29:23 +0100
commitcd4de50188af8836b8450c15d5b60332e1f2174b (patch)
tree891a8e223d97cf0166c26480c13aed53072092d8 /Makefile
parente943f3a8c967d95cb9d57367a57db78e79972d74 (diff)
downloadvtcol-cd4de50188af8836b8450c15d5b60332e1f2174b.tar.gz
misc: add nix derivation
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 17 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index a8db336..50dd1b2 100644
--- a/Makefile
+++ b/Makefile
@@ -7,8 +7,10 @@ lib-src = src/lib.rs
src = $(bin-src) $(lib-src)
meta = Cargo.toml
rustdoc-entry = target/doc/vtcol/index.html
+cargo-lock = Cargo.lock
+cargo-lock-patch= misc/nixos/pkgs/os-specific/linux/vtcol/cargo-lock.patch
-all: bin lib doc
+all: bin lib doc nix
check: $(src)
cargo test
@@ -23,6 +25,18 @@ man: $(manpage)
rustdoc: $(rustdoc-entry)
+nix: lockpatch
+
+lockpatch: $(cargo-lock-patch)
+
+$(cargo-lock-patch): $(meta)
+ rm -f -- $(cargo-lock)
+ cargo update
+ cargo generate-lockfile
+ mkdir -p tmp
+ mv -f -- $(cargo-lock) tmp/
+ diff -u /dev/null tmp/$(cargo-lock) >$(cargo-lock-patch) ; :
+
$(lib): $(lib-src) $(meta)
cargo build --release
@@ -37,6 +51,8 @@ $(rustdoc-entry): $(src) $(meta)
clean:
rm -f -- $(manpage)
+ rm -f -- $(cargo-lock)
rm -rf -- $(cargo-target)
+ rm -rf -- tmp
.PHONY: clean check