diff options
| author | Christian Hesse <mail@eworm.de> | 2015-08-21 16:37:03 +0200 |
|---|---|---|
| committer | Christian Hesse <mail@eworm.de> | 2015-10-06 08:04:06 +0200 |
| commit | a7fd2b66fe946585b0c68d6185c60d029b6e63ab (patch) | |
| tree | 04c67b5c15de4720c4beb1c44199f78cd428464a /config.mk | |
| parent | 3488bdacbf771021eef8912d79f316e05d73f308 (diff) | |
| download | vis-a7fd2b66fe946585b0c68d6185c60d029b6e63ab.tar.gz vis-a7fd2b66fe946585b0c68d6185c60d029b6e63ab.tar.xz | |
update version handling to work with tags or without git
Diffstat (limited to 'config.mk')
| -rw-r--r-- | config.mk | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -3,13 +3,20 @@ HAVE_ACL=0 HAVE_SELINUX=0 # vis version -# we have no tags in git, so just use revision count an hash for now -GITREVCOUNT = "$(shell git rev-list --count master 2>/dev/null)" -GITHASH = "$(shell git log -1 --format="%h" 2>/dev/null)" -ifeq (${GITREVCOUNT},) - VERSION = devel +# try to get a tag and hash first +GITHASH = $(shell git log -1 --format='%h' 2>/dev/null) +GITTAG = $(shell git describe --abbrev=0 --tags 2>/dev/null) +ifneq ($(GITTAG),) + # we have a tag and revcount from there + GITREVCOUNT = $(shell git rev-list --count ${GITTAG}.. 2>/dev/null) + VERSION = ${GITTAG}.r${GITREVCOUNT}.g${GITHASH} +else ifneq ($(GITHASH),) + # we have no tags in git, so just use revision count an hash for now + GITREVCOUNT = $(shell git rev-list --count master) + VERSION = 0.r${GITREVCOUNT}.g${GITHASH} else - VERSION = "0.r${GITREVCOUNT}.g${GITHASH}" + # this is used when no git is available, e.g. for release tarball + VERSION = 0.0.0 endif # Customize below to fit your system |
