From f36693322c1c9fa50e497895afb0242ed7be37c2 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 24 Jan 2013 14:02:33 -0800 Subject: 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 Signed-off-by: Dirk Hohndel --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Makefile') 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 -- cgit v1.2.3-70-g09d2