summaryrefslogtreecommitdiff
path: root/Makefile.src.in
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-07 00:25:49 +0000
committerrubidium <rubidium@openttd.org>2007-06-07 00:25:49 +0000
commit463093d0aef194ff6e3adc731742880ca890e608 (patch)
tree9c9fcbcbc24b1e829ed158b771e578307a727b91 /Makefile.src.in
parent94b2dc3f8a5a22046013c0a84b9525de53c5f119 (diff)
downloadopenttd-463093d0aef194ff6e3adc731742880ca890e608.tar.xz
(svn r10051) -Add: git "version" detection so we've got at least some indication what version we're playing when using git ;)
Diffstat (limited to 'Makefile.src.in')
-rw-r--r--Makefile.src.in7
1 files changed, 7 insertions, 0 deletions
diff --git a/Makefile.src.in b/Makefile.src.in
index 46b425fec..14d827d3b 100644
--- a/Makefile.src.in
+++ b/Makefile.src.in
@@ -96,8 +96,15 @@ ifeq ($(shell if test -d $(SRC_DIR)/.svn; then echo 1; fi), 1)
REV_MODIFIED := $(shell svnversion $(SRC_DIR) | sed -n 's/.*\(M\).*/\1/p' )
# Find the revision like: rXXXX-branch
REV := $(shell LC_ALL=C svn info $(SRC_DIR) | $(AWK) '/^URL:.*branch/ { split($$2, a, "/"); BRANCH="-"a[5] } /^Last Changed Rev:/ { REV="r"$$4"$(REV_MODIFIED)" } END { print REV BRANCH }')
+else
+# Are we a git dir?
+ifeq ($(shell if test -d $(SRC_DIR)/../.git; then echo 1; fi), 1)
+# Find the revision like: rXXXXM
+REV := g$(shell if head=`git rev-parse --verify HEAD 2>/dev/null`; then echo "$$head" | cut -c1-8; fi)$(shell if git diff-index HEAD | read dummy; then echo M; fi)$(shell git branch|grep '*'|sed 's/\* /-/;s/^-master$$//')
+endif
endif
endif
+
# Make sure we have something in REV
ifeq ($(REV),)
REV := norev000