[Scummvm-cvs-logs] SF.net SVN: scummvm:[39528] scummvm/trunk

jvprat at users.sourceforge.net jvprat at users.sourceforge.net
Thu Mar 19 19:39:47 CET 2009


Revision: 39528
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39528&view=rev
Author:   jvprat
Date:     2009-03-19 18:39:47 +0000 (Thu, 19 Mar 2009)

Log Message:
-----------
Try to use the working copy revision if it's available

Modified Paths:
--------------
    scummvm/trunk/Makefile
    scummvm/trunk/Makefile.common

Modified: scummvm/trunk/Makefile
===================================================================
--- scummvm/trunk/Makefile	2009-03-19 18:36:45 UTC (rev 39527)
+++ scummvm/trunk/Makefile	2009-03-19 18:39:47 UTC (rev 39528)
@@ -30,10 +30,6 @@
 # Disable RTTI and exceptions, and enabled checking of pointers returned by "new"
 CXXFLAGS+= -fno-rtti -fno-exceptions -fcheck-new
 
-ifneq "$(SCUMMVM_SVN_REVISION)" ""
-CXXFLAGS+= -DSCUMMVM_SVN_REVISION=\"$(SCUMMVM_SVN_REVISION)\"
-endif
-
 # There is a nice extra warning that flags variables that are potentially
 # used before being initialized. Very handy to catch a certain kind of
 # bugs. Unfortunately, it only works when optimizations are turned on,

Modified: scummvm/trunk/Makefile.common
===================================================================
--- scummvm/trunk/Makefile.common	2009-03-19 18:36:45 UTC (rev 39527)
+++ scummvm/trunk/Makefile.common	2009-03-19 18:39:47 UTC (rev 39528)
@@ -111,6 +111,38 @@
 
 
 ######################################################################
+# Get the current version information
+######################################################################
+
+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
 ######################################################################
 
@@ -118,12 +150,6 @@
 	$(srcdir)/dists/iphone/Info.plist \
 	$(srcdir)/dists/macosx/Info.plist
 
-VERSION = $(shell tail -1 "${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-)
-
 $(VERSION_FILES): %: %.in
 	@echo "Creating $@"
 	@cat $< | sed \
@@ -149,12 +175,6 @@
 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)


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list