aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorTeddy Wing2018-11-15 16:50:26 +0100
committerTeddy Wing2018-11-15 17:11:02 +0100
commit63b6ebfd813e26fecb444ccc94ba4a1710ad2829 (patch)
treeab57d64b1eaa0a6b587cdd935f1529a471b8eba4 /Makefile
parente12f656eb9b692c11c0704421c51c59d7052c121 (diff)
downloadDomeKey-63b6ebfd813e26fecb444ccc94ba4a1710ad2829.tar.bz2
Makefile: Add target to archive binary & man pages
Builds a tar archive of the executable and man pages with the current software version in the name. The version is extracted from the `main.m` file.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 10 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 806c533..2132d7c 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@ SOURCE_FILES := $(shell find DomeKey lib \
-name '*.h' \
-or -name '*.m' \
-or -name '*.c')
+VERSION := $(shell sed -n '/VERSION/ s/^.*"\([[:digit:]\.]*\)".*$$/\1/p' DomeKey/main.m)
RUST_DIR := lib/dome-key-map
RUST_LOCAL_LIB := target/debug/libdome_key_map.a
@@ -122,3 +123,12 @@ dist/dome-key.1: doc/dome-key.1 dist
dist/dome-key-mappings.7: doc/dome-key-mappings.7 dist
cp $< $@
+
+
+# Packaging
+
+.PHONY: tar
+tar: dome-key_$(VERSION).tar.bz2
+
+dome-key_$(VERSION).tar.bz2: dist-all
+ tar cjv -s /dist/dome-key_$(VERSION)/ -f $@ dist