From 2a7f28bf4f28ed6fb97dfe4d657e7ea5855fe0ae Mon Sep 17 00:00:00 2001 From: mudlord Date: Wed, 30 Jan 2008 10:47:10 +0000 Subject: [PATCH] Linux version can display SVN revision number in help screen, ONLY IF svn is installed. Otherwise, the normal version number shows. git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@346 a31d4220-a93d-0410-bf67-fe4944624d44 --- Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Makefile b/Makefile index 33a758ec..3698333f 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,7 @@ STRIP=strip -s DEL=rm -f OE=.o OUT=vbam +BASEVERSION=1.8.0 ifeq ($(MACHINE),Darwin) LFLAGS=-lz -lpng -framework OpenGL `sdl-config --libs` @@ -38,6 +39,23 @@ ifndef $(PREFIX) PREFIX=/usr/local endif +ifndef VERSION + SVNVERSION=$(shell test -d .svn && svnversion -n .) + BADCHARS=$(findstring :,$(SVNVERSION))$(findstring S,$(SVNVERSION)) + ifeq ($(BADCHARS),) + ifneq ($(SVNVERSION),) + ifneq ($(SVNVERSION),exported) + VERSION=$(BASEVERSION)-r$(subst M,,$(SVNVERSION)) + endif + endif + endif +endif + +ifdef VERSION + CXXFLAGS+=-DVERSION=\"$(VERSION)\" +endif + + MAINDIR=src SDLDIR=src/sdl DMGDIR=src/gb