diff --git a/Makefile b/Makefile index ee291a49..a6711957 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,12 @@ -VERSION=1.73.0 -SVNREVISION=`svn info | grep Revision | cut -d ' ' -f 2` -BUILDTIME=`date \"+%Y.%m.%d %H.%M\"` +# Build version string, taking into account that 'VER_REV' may not be set +VERSION := $(shell cat src/Cocoa/oolite-version.xcconfig | cut -d '=' -f 2) +VER_MAJ := $(strip $(shell echo "${VERSION}" | cut -d '.' -f 1)) +VER_MIN := $(strip $(shell echo "${VERSION}" | cut -d '.' -f 2)) +VER_REV := $(strip $(shell echo "${VERSION}" | cut -d '.' -f 3)) +VER_REV := $(if ${VER_REV},${VER_REV},0) +SVNREVISION := $(shell svn info | grep Revision | cut -d ' ' -f 2) +VER := $(shell echo "${VER_MAJ}.${VER_MIN}.${VER_REV}.${SVNREVISION}") +BUILDTIME := $(shell date "+%Y.%m.%d %H:%M") LIBJS_SRC_DIR=deps/Cross-platform-deps/SpiderMonkey/js/src @@ -73,8 +79,11 @@ NSISVERSIONS=installers/win32/OoliteVersions.nsh ${NSISVERSIONS}: @echo "; Version Definitions for Oolite" > $@ @echo "; NOTE - This file is auto-generated by the Makefile, any manual edits will be overwritten" >> $@ - @echo "!define VERSION ${VERSION}" >> $@ + @echo "!define VER_MAJ ${VER_MAJ}" >> $@ + @echo "!define VER_MIN ${VER_MIN}" >> $@ + @echo "!define VER_REV ${VER_REV}" >> $@ @echo "!define SVNREV ${SVNREVISION}" >> $@ + @echo "!define VERSION ${VER}" >> $@ @echo "!define BUILDTIME \"${BUILDTIME}\"" >> $@ .PHONY: pkg-win diff --git a/installers/win32/OOlite.nsi b/installers/win32/OOlite.nsi index bbc630de..bff13ee5 100644 --- a/installers/win32/OOlite.nsi +++ b/installers/win32/OOlite.nsi @@ -3,13 +3,16 @@ !include /NONFATAL "OoliteVersions.nsh" !ifndef SVNREV +!warning "No SVN Revision supplied" !define SVNREV 0 !endif -!ifndef VER +!ifndef VERSION +!warning "No Version information supplied" +!define VERSION 0.0.0.0 +!endif ; Version number must be of format X.X.X.X. ; We use M.m.R.S: M-major, m-minor, R-revision, S-subversion -!define VER 1.73.0.${SVNREV} -!endif +!define VER ${VERSION} !ifndef DST !define DST ..\..\oolite.app !endif @@ -20,7 +23,6 @@ !ifndef SNAPSHOT !define EXTVER "" !else -!define SVNREVSTR ".r${SVNREV}" !define EXTVER "-dev" !endif