aboutsummaryrefslogtreecommitdiffhomepage
path: root/Makefile.local
diff options
context:
space:
mode:
authorGravatar David Bremner <bremner@debian.org>2011-11-17 22:26:25 -0400
committerGravatar David Bremner <bremner@debian.org>2011-11-19 10:09:14 -0400
commit570d12b7e6a50fe71c4c27b4ed6170431d953442 (patch)
tree23f55f25c3e26d76bc03f2cbb2670ffec4f0b613 /Makefile.local
parent6a9711b1fbf418a873c2d2a8fcefd83f556f50b7 (diff)
build system: add target update-versions to propagate version
The version from file "version" is propagated to the man page and the python bindings via sed. Note that the git version is ignored because of the check for MAKECMDGOALS.
Diffstat (limited to 'Makefile.local')
-rw-r--r--Makefile.local14
1 files changed, 13 insertions, 1 deletions
diff --git a/Makefile.local b/Makefile.local
index 10e6668f..775f3935 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -12,8 +12,14 @@ PACKAGE=notmuch
IS_GIT=$(shell if [ -d .git ] ; then echo yes ; else echo no; fi)
+ifeq ($(IS_GIT),yes)
+DATE:=$(shell git log --date=short -1 --pretty=format:%cd)
+else
+DATE:=$(shell date +%F)
+endif
+
VERSION:=$(shell cat ${srcdir}/version)
-ifeq ($filter release release-message pre-release,$(MAKECMDGOALS),)
+ifeq ($(filter release release-message pre-release update-versions,$(MAKECMDGOALS)),)
ifeq ($(IS_GIT),yes)
VERSION:=$(shell git describe --match '[0-9.]*'|sed -e s/_/~/ -e s/-/+/ -e s/-/~/)
endif
@@ -87,6 +93,12 @@ $(GPG_FILE): $(SHA1_FILE)
.PHONY: dist
dist: $(TAR_FILE)
+.PHONY: update-versions
+
+update-versions:
+ sed -i "s/^.TH NOTMUCH 1.*$$/.TH NOTMUCH 1 ${DATE} \"Notmuch ${VERSION}\"/" notmuch.1
+ sed -i "s/^__VERSION__[[:blank:]]*=.*$$/__VERSION__ = \'${VERSION}\'/" $(PV_FILE)
+
# We invoke make recursively only to force ordering of our phony
# targets in the case of parallel invocation of make (-j).
#