aboutsummaryrefslogtreecommitdiff
path: root/Makefile.common
diff options
context:
space:
mode:
authorJordi Vilalta Prat2009-03-19 18:39:47 +0000
committerJordi Vilalta Prat2009-03-19 18:39:47 +0000
commit2292dc28b06e57d83685a29f0749f38d698b542e (patch)
tree6bc966a929b6c304e8ebbd1f89cd0550aa32519a /Makefile.common
parent38e295773986ef16e4c4a65b47375849e653eac4 (diff)
downloadscummvm-rg350-2292dc28b06e57d83685a29f0749f38d698b542e.tar.gz
scummvm-rg350-2292dc28b06e57d83685a29f0749f38d698b542e.tar.bz2
scummvm-rg350-2292dc28b06e57d83685a29f0749f38d698b542e.zip
Try to use the working copy revision if it's available
svn-id: r39528
Diffstat (limited to 'Makefile.common')
-rw-r--r--Makefile.common44
1 files changed, 32 insertions, 12 deletions
diff --git a/Makefile.common b/Makefile.common
index a1a6cac9ea..d189838c23 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -111,19 +111,45 @@ endif
######################################################################
-# Create the files that depend on the version
+# Get the current version information
######################################################################
-VERSION_FILES = \
- $(srcdir)/dists/iphone/Info.plist \
- $(srcdir)/dists/macosx/Info.plist
-
-VERSION = $(shell tail -1 "${srcdir}/base/internal_version.h" | cut -d\" -f2)
+VERSION = $(shell grep SCUMMVM_VERSION "${srcdir}/base/internal_version.h" | cut -d\" -f2)
VER_MAJOR = $(shell echo $(VERSION) | cut -d. -f 1)
VER_MINOR = $(shell echo $(VERSION) | cut -d. -f 2)
VER_PATCH = $(shell echo $(VERSION) | cut -d. -f 3 | cut -c1)
VER_EXTRA = $(shell echo $(VERSION) | cut -d. -f 3 | cut -c2-)
+
+######################################################################
+# Get Subversion's working copy information
+######################################################################
+
+ifeq ($(shell svn stat $(srcdir) 2>&1 | grep "is not a working copy"),)
+SVNROOT := $(srcdir)
+ifeq ($(origin SVNREV), undefined)
+# Get the working copy base revision
+VER_SVNREV := $(shell svn info $(SVNROOT) | grep "^Revision" | cut -d ' ' -f 2)
+endif
+else
+SVNROOT := https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/
+endif
+
+# Define the Subversion revision if available, either autodetected or
+# specified by the user
+ifneq ($(origin VER_SVNREV), undefined)
+CXXFLAGS+= -DSCUMMVM_SVN_REVISION=\"$(VER_SVNREV)\"
+endif
+
+
+######################################################################
+# Create the files that depend on the version
+######################################################################
+
+VERSION_FILES = \
+ $(srcdir)/dists/iphone/Info.plist \
+ $(srcdir)/dists/macosx/Info.plist
+
$(VERSION_FILES): %: %.in
@echo "Creating $@"
@cat $< | sed \
@@ -149,12 +175,6 @@ DISTNAME := scummvm-$(DISTVERSION)
DISTDIR := dist
VERFILE := $(DISTDIR)/$(DISTNAME)/base/internal_version.h
-ifeq ($(shell svn stat $(srcdir) 2>&1 | grep "is not a working copy"),)
-SVNROOT := $(srcdir)
-else
-SVNROOT := https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk/
-endif
-
$(VERFILE): $(srcdir)/base/internal_version.h
@$(RM_REC) $(DISTDIR)
@$(MKDIR) $(DISTDIR)