summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>2013-02-16 23:54:17 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-16 15:41:58 -0800
commit727ee3aa980d505b0381ab3a0e574ca5d7094451 (patch)
tree031af62c0cf3e4596ba4cff1d6ed7298191d3398 /Makefile
parent2d8a203026b47877320104e9f7597b462c016081 (diff)
downloadsubsurface-727ee3aa980d505b0381ab3a0e574ca5d7094451.tar.gz
Unified handling of version extraction.
Removed oddly named and ridiculously outdated documentation text (scripts). Created new directory 'scripts'. Added unified version extraction script (scripts/get-version). Yes, it's more shell script code but faster and more maintainable than the sed commands and the swearwords/regexps repeated over and over again. Makefile and packaging/macosx/make-package.sh modified accordingly. I don't do windos neither macos but, AFAICS my tests show, it should be safe. Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 7 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 43ab19a29..63528a93c 100644
--- a/Makefile
+++ b/Makefile
@@ -26,11 +26,14 @@ 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)")
-# Windows .nsi style with four numbers 1.2.3.4
-PRODVERSION_STRING := $(shell git describe --tags --abbrev=12 | sed 's/v\([0-9]*\)\.\([0-9]*\)-\([0-9]*\)-.*/\1.\2.\3.0/ ; s/v\([0-9]\)\.\([0-9]*\)/\1.\2.0.0/' || echo "$(VERSION).0.0")
+GET_VERSION = ./scripts/get-version
+VERSION_STRING := $(shell $(GET_VERSION) linux || echo "v$(VERSION)")
# Mac Info.plist style with three numbers 1.2.3
-CFBUNDLEVERSION_STRING := $(shell git describe --tags --abbrev=12 | sed 's/v\([0-9]*\)\.\([0-9]*\)-\([0-9]*\)-.*/\1.\2.\3/ ; s/v\([0-9]\)\.\([0-9]*\)/\1.\2.0/' || echo "$(VERSION).0")
+CFBUNDLEVERSION_STRING := $(shell $(GET_VERSION) darwin $(VERSION_STRING) || \
+ echo "$(VERSION).0")
+# Windows .nsi style with four numbers 1.2.3.4
+PRODVERSION_STRING := $(shell $(GET_VERSION) win $(VERSION_STRING) || \
+ echo "$(VERSION).0.0")
# find libdivecomputer
# First deal with the cross compile environment and with Mac.