summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2013-01-24 14:02:33 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-24 15:08:35 -0800
commitf36693322c1c9fa50e497895afb0242ed7be37c2 (patch)
tree05402b5782ca3da98efb93808c3bed068b2c2edf /Makefile
parent50d0391dfbf8f63894abeb288dd4467f06f31b4c (diff)
downloadsubsurface-f36693322c1c9fa50e497895afb0242ed7be37c2.tar.gz
Include git revision in version number
This makes sure that it's easy to tell from the about box whether this is a released version or a development build. If it is compiled at the exact location of the tag, "git describe --tags" will just return the tag-name. Otherwise it will return something like this v2.1-393-ge03f31525aab which means "v2.1 plus 393 commits, git SHA1 of tip is e03f31525aab", which is a nice combination of git-readable (only the actual SHA1 matters) and human-readable (393 commits on top of v2.1). And if you don't build from git sources, and don't have git installed, it falls back on the old "v$(VERSION)" string. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 30e9fedbb..980da391a 100644
--- a/Makefile
+++ b/Makefile
@@ -26,6 +26,7 @@ MANFILES = $(NAME).1
XSLTFILES = xslt/*.xslt
UNAME := $(shell $(CC) -dumpmachine 2>&1 | grep -E -o "linux|darwin|win")
+VERSION_STRING := $(shell git describe --tags --abbrev=12 || echo "v$(VERSION)")
# find libdivecomputer
# First deal with the cross compile environment and with Mac.
@@ -280,7 +281,7 @@ libdivecomputer.o: libdivecomputer.c dive.h display.h display-gtk.h libdivecompu
gtk-gui.o: gtk-gui.c dive.h display.h divelist.h display-gtk.h libdivecomputer.h device.h callbacks-gtk.h Makefile
$(CC) $(CFLAGS) $(GTK2CFLAGS) $(GLIB2CFLAGS) $(GCONF2CFLAGS) $(XML2CFLAGS) \
$(LIBDIVECOMPUTERCFLAGS) \
- -DVERSION_STRING='"v$(VERSION)"' \
+ -DVERSION_STRING='"$(VERSION_STRING)"' \
-c gtk-gui.c
uemis.o: uemis.c dive.h uemis.h