X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=Makefile.local;h=775f39350d200d2ee36743552e44a755ea6fbf44;hb=53629b55065122eff3a80bc59968613f8e10e490;hp=6ddef5c883b56a5970a9e96cb25f5e417b5f3ae0;hpb=1dedfc90f6eee7cad10f1a1ceb39a7a1c4dbd1b1;p=notmuch diff --git a/Makefile.local b/Makefile.local index 6ddef5c8..775f3935 100644 --- a/Makefile.local +++ b/Makefile.local @@ -12,14 +12,16 @@ PACKAGE=notmuch IS_GIT=$(shell if [ -d .git ] ; then echo yes ; else echo no; fi) -VERSION:=$(shell cat ${srcdir}/version) -ifneq ($(MAKECMDGOALS),release) -ifneq ($(MAKECMDGOALS),release-message) -ifneq ($(MAKECMDGOALS),pre-release) ifeq ($(IS_GIT),yes) -VERSION:=$(shell git describe --match '[0-9.]*'|sed -e s/-/+/ -e s/-/~/) -endif +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 update-versions,$(MAKECMDGOALS)),) +ifeq ($(IS_GIT),yes) +VERSION:=$(shell git describe --match '[0-9.]*'|sed -e s/_/~/ -e s/-/+/ -e s/-/~/) endif endif @@ -91,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). #