Makefile
changeset 2302 e9b122730a41
parent 2301 d9ed2d848023
child 2315 63124f563f89
equal deleted inserted replaced
2301:d9ed2d848023 2302:e9b122730a41
   244 TTD=openttd$(EXE)
   244 TTD=openttd$(EXE)
   245 ENDIAN_CHECK=endian_check$(EXE)
   245 ENDIAN_CHECK=endian_check$(EXE)
   246 STRGEN=strgen/strgen$(EXE)
   246 STRGEN=strgen/strgen$(EXE)
   247 OSXAPP="OpenTTD.app"
   247 OSXAPP="OpenTTD.app"
   248 
   248 
   249 # What revision are we compiling, if we have an idea?
       
   250 REV_NUMBER := $(shell if test -d .svn; then svnversion . | tr -dc 0-9; fi)
       
   251 
       
   252 ifdef RELEASE
   249 ifdef RELEASE
   253 REV:=$(RELEASE)
   250 REV:=$(RELEASE)
   254 else
   251 else
   255 REV := $(shell if test -d .svn; then svnversion . | awk '{ print "r"$$0 }'; fi)
   252 REV := $(shell if test -d .svn; then svnversion . | awk '{ print "r"$$0 }'; fi)
   256 tmp_test:=$(shell echo "$(REV)" | grep "M" )
       
   257 ifdef tmp_test
       
   258 REV_NUMBER:=1
       
   259 endif
       
   260 endif
       
   261 
       
   262 ifndef REV_NUMBER
       
   263 REV_NUMBER:=0
       
   264 endif
   253 endif
   265 
   254 
   266 # MorphOS needs builddate
   255 # MorphOS needs builddate
   267 BUILDDATE=`date +%d.%m.%y`
   256 BUILDDATE=`date +%d.%m.%y`
   268 
   257 
   927 endif
   916 endif
   928 
   917 
   929 rev.c: FORCE
   918 rev.c: FORCE
   930 	@# setting the revision number in a place, there the binary can read it
   919 	@# setting the revision number in a place, there the binary can read it
   931 	@echo 'const char _openttd_revision[] = "$(REV)";' >>rev.c.new
   920 	@echo 'const char _openttd_revision[] = "$(REV)";' >>rev.c.new
   932 	@echo 'const int _revision_number = $(REV_NUMBER);' >>rev.c.new
       
   933 	@# some additions for MorphOS versions tag
   921 	@# some additions for MorphOS versions tag
   934 	@echo '#ifdef __MORPHOS__'  >>rev.c.new
   922 	@echo '#ifdef __MORPHOS__'  >>rev.c.new
   935 	@echo 'const char morphos_versions_tag[] = "\\0$$VER: OpenTTD $(REV) ('${BUILDDATE}') © OpenTTD Team [MorphOS, PowerPC]";'  >>rev.c.new
   923 	@echo 'const char morphos_versions_tag[] = "\\0$$VER: OpenTTD $(REV) ('${BUILDDATE}') © OpenTTD Team [MorphOS, PowerPC]";'  >>rev.c.new
   936 	@echo '#endif' >>rev.c.new
   924 	@echo '#endif' >>rev.c.new
   937 	@# Only update the real rev.c if it actually changed, to prevent
   925 	@# Only update the real rev.c if it actually changed, to prevent