added make version command

to quickly set the mods version to the git tag
or git-$hash if we are on a development version
This commit is contained in:
Matthias Mailänder
2013-04-15 23:02:18 +02:00
parent 1db4cb1867
commit 0c169bcfd3
2 changed files with 8 additions and 7 deletions

View File

@@ -2,12 +2,13 @@ CSC = gmcs
CSFLAGS = -nologo -warn:4 -debug:full -optimize- -codepage:utf8 -unsafe -warnaserror CSFLAGS = -nologo -warn:4 -debug:full -optimize- -codepage:utf8 -unsafe -warnaserror
DEFINE = DEBUG;TRACE DEFINE = DEBUG;TRACE
COMMON_LIBS = System.dll System.Core.dll System.Drawing.dll System.Xml.dll thirdparty/ICSharpCode.SharpZipLib.dll thirdparty/FuzzyLogicLibrary.dll thirdparty/Mono.Nat.dll COMMON_LIBS = System.dll System.Core.dll System.Drawing.dll System.Xml.dll thirdparty/ICSharpCode.SharpZipLib.dll thirdparty/FuzzyLogicLibrary.dll thirdparty/Mono.Nat.dll
PHONY = core tools package all mods clean distclean dependencies PHONY = core tools package all mods clean distclean dependencies version
VERSION = $(shell git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || echo git-`git rev-parse --short HEAD`)
.SUFFIXES: .SUFFIXES:
core: game renderers mods utility tsbuild core: game renderers mods utility tsbuild
tools: editor ralint tsbuild tools: editor ralint tsbuild
package: dependencies core editor docs package: dependencies core editor docs version
mods: mod_ra mod_cnc mod_d2k mods: mod_ra mod_cnc mod_d2k
all: dependencies core tools all: dependencies core tools
clean: clean:
@@ -16,6 +17,11 @@ distclean: clean
dependencies: dependencies:
@ cp -r thirdparty/*.dl* . @ cp -r thirdparty/*.dl* .
@ cp -r thirdparty/Tao/* . @ cp -r thirdparty/Tao/* .
version: mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml
@for i in $? ; do \
awk '{sub("Version:.*$$","Version: $(VERSION)"); print $0}' $${i} > $${i}.tmp && \
mv -f $${i}.tmp $${i} ; \
done
default: dependencies core default: dependencies core
.DEFAULT_GOAL := default .DEFAULT_GOAL := default

View File

@@ -56,11 +56,6 @@ cp thirdparty/Mono.Nat.dll packaging/built
# Copy game icon for windows package # Copy game icon for windows package
cp OpenRA.Game/OpenRA.ico packaging/built cp OpenRA.Game/OpenRA.ico packaging/built
# Update mod versions
sed "s/{DEV_VERSION}/$TAG/" ./mods/ra/mod.yaml > ./packaging/built/mods/ra/mod.yaml
sed "s/{DEV_VERSION}/$TAG/" ./mods/cnc/mod.yaml > ./packaging/built/mods/cnc/mod.yaml
sed "s/{DEV_VERSION}/$TAG/" ./mods/d2k/mod.yaml > ./packaging/built/mods/d2k/mod.yaml
# Remove demo.mix from cnc # Remove demo.mix from cnc
rm ./packaging/built/mods/cnc/bits/demo.mix rm ./packaging/built/mods/cnc/bits/demo.mix