From 63b6ebfd813e26fecb444ccc94ba4a1710ad2829 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 15 Nov 2018 16:50:26 +0100 Subject: 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. --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Makefile') 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 -- cgit v1.2.3