Makefile: use git version string if we can

Some packagers overwrote the version we embed in aerc, we really don't want that.
Hence we force clear the variable at the beginning of the makefile.
If git is available and returns a useful info we now use that version instead
of the hardcoded version
This commit is contained in:
Reto Brunner 2021-02-07 19:25:06 +01:00
parent 804329970b
commit 077063ba4b
1 changed files with 6 additions and 0 deletions

View File

@ -2,7 +2,13 @@
.SUFFIXES:
.SUFFIXES: .1 .5 .7 .1.scd .5.scd .7.scd
override undefine VERSION # don't allow local overrides, we want our version
_git_version=$(shell git describe --long --tags --dirty 2>/dev/null | sed 's/-/.r/;s/-/./')
ifeq ($(strip $(_git_version)),)
VERSION=0.5.2
else
VERSION=$(_git_version)
endif
VPATH=doc
PREFIX?=/usr/local