added version framework based on scummvm

This commit is contained in:
Pawel Kolodziejski 2008-06-15 14:28:41 +00:00
parent 1ffbab7d3c
commit 49d6e325cc
9 changed files with 176 additions and 7 deletions

View File

@ -44,6 +44,11 @@ CPPFLAGS := $(DEFINES) $(INCLUDES)
DEPDIRS = $(addsuffix $(DEPDIR),$(MODULE_DIRS))
DEPFILES =
# Make engine/version.o depend on all other object files. This way if anything is
# changed, it causes version.cpp to be recompiled. This in turn ensures that
# the build date in gResidualBuildDate is correct.
engine/version.o: $(filter-out engine/libengine.a,$(OBJS))
# The build rule for the Residual executable
$(EXECUTABLE): $(OBJS)
$(CXX) $(LDFLAGS) $(PRE_OBJS_FLAGS) $+ $(POST_OBJS_FLAGS) $(LIBS) -o $@
@ -85,6 +90,26 @@ endif
# Create the files that depend on the version
######################################################################
VERSION_FILES =
#$(srcdir)/dists/iphone/Info.plist \
#$(srcdir)/dists/macosx/Info.plist
VERSION = $(shell cat "${srcdir}/engine/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 \
-e "s/@VER_MAJOR@/$(VER_MAJOR)/g" \
-e "s/@VER_MINOR@/$(VER_MINOR)/g" \
-e "s/@VER_PATCH@/$(VER_PATCH)/g" \
-e "s/@VER_EXTRA@/$(VER_EXTRA)/g" \
-e "s/@VERSION@/$(VERSION)/g" \
> $@
######################################################################
# Distribution settings
@ -98,6 +123,7 @@ endif
DISTNAME := residual-$(DISTVERSION)
DISTDIR := dist
VERFILE := $(DISTDIR)/$(DISTNAME)/engine/internal_version.h
ifeq ($(shell svn stat $(srcdir) 2>&1 | grep "is not a working copy"),)
SVNROOT := $(srcdir)
@ -105,6 +131,10 @@ else
SVNROOT := https://scummvm.svn.sourceforge.net/svnroot/scummvm/residual/trunk/
endif
$(VERFILE): $(srcdir)/engine/internal_version.h
@$(RM_REC) $(DISTDIR)
@$(MKDIR) $(DISTDIR)
svn export $(SVNROOT) $(DISTDIR)/$(DISTNAME)
$(DISTDIR)/$(DISTNAME).tar.gz:
cd $(DISTDIR); tar zcf $(DISTNAME).tar.gz $(DISTNAME)

5
README
View File

@ -1,5 +1,6 @@
Residual: A LucasArts 3D game interpreter Version: 0.06a-CVS
(C) 2003-2008 The ScummVM-Residual team Last Updated: 13 Jun 2008
Residual: A LucasArts 3D game interpreter
Last updated: $Date$
------------------------------------------------------------------------------
What is Residual?

View File

@ -1,10 +1,14 @@
#include "winresrc.h"
//IDI_ICON ICON DISCARDABLE "residual.ico"
#if defined (__MINGW32__) || defined(__CYGWIN32__)
//IDI_ICON ICON DISCARDABLE "icons/residual.ico"
#else
//IDI_ICON ICON DISCARDABLE "../../icons/residual.ico"
#endif
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,0,0,0
PRODUCTVERSION 0,0,0,0
FILEVERSION 0,0,6,0
PRODUCTVERSION 0,0,6,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -22,14 +26,14 @@ BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "ScummVM-Residual\0"
VALUE "FileDescription", "http://www.scummvm.org/\0"
VALUE "FileVersion", "SVN\0"
VALUE "FileVersion", "0.0.6svn\0"
VALUE "InternalName", "residual\0"
VALUE "LegalCopyright", "Copyright © 2003-2008 The ScummVM-Residual\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "residual.exe\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Residual\0"
VALUE "ProductVersion", "SVN\0"
VALUE "ProductVersion", "0.0.6svn\0"
VALUE "SpecialBuild", "\0"
END
END

44
dists/residual.rc.in Normal file
View File

@ -0,0 +1,44 @@
#include "winresrc.h"
#if defined (__MINGW32__) || defined(__CYGWIN32__)
//IDI_ICON ICON DISCARDABLE "icons/residual.ico"
#else
//IDI_ICON ICON DISCARDABLE "../../icons/residual.ico"
#endif
VS_VERSION_INFO VERSIONINFO
FILEVERSION @VER_MAJOR@,@VER_MINOR@,@VER_PATCH@,0
PRODUCTVERSION @VER_MAJOR@,@VER_MINOR@,@VER_PATCH@,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "ScummVM-Residual\0"
VALUE "FileDescription", "http://www.scummvm.org/\0"
VALUE "FileVersion", "@VERSION@\0"
VALUE "InternalName", "residual\0"
VALUE "LegalCopyright", "Copyright © 2003-2008 The ScummVM-Residual\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "residual.exe\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Residual\0"
VALUE "ProductVersion", "@VERSION@\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

View File

@ -0,0 +1 @@
#define RESIDUAL_VERSION "0.0.6svn"

View File

@ -0,0 +1 @@
#define RESIDUAL_VERSION "@VERSION@"

View File

@ -22,6 +22,7 @@ MODULE_OBJS := \
scene.o \
textobject.o \
textsplit.o \
version.o \
walkplane.o
# Include common rules

58
engine/version.cpp Normal file
View File

@ -0,0 +1,58 @@
/* Residual - Virtual machine to run LucasArts' 3D adventure games
*
* Residual is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the AUTHORS
* file distributed with this source distribution.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*
* $URL$
* $Id$
*
*/
#include "common/sys.h"
#include "engine/internal_version.h"
#include "engine/version.h"
const char *gResidualVersion = RESIDUAL_VERSION;
const char *gResidualBuildDate = __DATE__ " " __TIME__;
const char *gResidualVersionDate = RESIDUAL_VERSION " (" __DATE__ " " __TIME__ ")";
const char *gResidualFullVersion = "Residual " RESIDUAL_VERSION " (" __DATE__ " " __TIME__ ")";
const char *gResidualFeatures = ""
#ifdef USE_TREMOR
"Tremor "
#else
#ifdef USE_VORBIS
"Vorbis "
#endif
#endif
#ifdef USE_FLAC
"FLAC "
#endif
#ifdef USE_MAD
"MP3 "
#endif
#ifdef USE_ALSA
"ALSA "
#endif
#ifdef USE_ZLIB
"zLib "
#endif
#ifdef USE_MPEG2
"MPEG2 "
#endif
;

29
engine/version.h Normal file
View File

@ -0,0 +1,29 @@
/* Residual - Virtual machine to run LucasArts' 3D adventure games
*
* Residual is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the AUTHORS
* file distributed with this source distribution.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*
* $URL$
* $Id$
*/
#ifndef BASE_VERSION_H
#define BASE_VERSION_H
extern const char *gResidualVersion; // e.g. "0.0.6"
extern const char *gResidualBuildDate; // e.g. "2008-06-15"
extern const char *gResidualVersionDate; // e.g. "0.0.6 (2008-06-15)"
extern const char *gResidualFullVersion; // e.g. "Residual 0.0.6 (2008-06-15)"
extern const char *gResidualFeatures; // e.g. "ALSA MPEG2 zLib"
#endif