1 @echo off |
1 @echo off |
2 echo Running SVN version detection script... |
2 echo Running SVN version detection script... |
3 rem |
3 rem |
4 rem Requires subversion (`svnversion'), GNU make and some other GNU tools (eg, textutils) |
4 rem Requires subversion (`svnversion') to be installed |
5 rem installed - a hack, I know, but it seems to work if you have the appropriate tools |
|
6 rem installed. |
|
7 rem |
5 rem |
8 cd ..\.. |
6 cd ..\.. |
9 if not exist .svn goto nosvn |
7 if not exist .svn goto nosvn |
10 make -f os/os2/svn_version.mak |
8 if not "%RELEASE%"=="" goto forcerelease |
11 if not %ERRORLEVEL%==0 goto nomake |
9 svnversion -n . > os\os2\svnver.tmp |
|
10 if not "%ERRORLEVEL%"=="0" goto nosvn |
12 |
11 |
|
12 copy os\os2\svnver1.c+os\os2\svnver.tmp+os\os2\svnver2.c rev.c /a /y > nul 2> nul |
13 goto end |
13 goto end |
14 |
14 |
15 :nomake |
15 :forcerelease |
16 gmake -f os/os2/svn_version.mak |
16 echo Forcing release string "%RELEASE%"... |
17 if not %ERRORLEVEL%==0 goto nomake2 |
17 echo const char _openttd_revision[] = "%RELEASE%"; > rev.c |
|
18 echo const int _revision_number = 0; >> rev.c |
18 goto end |
19 goto end |
19 |
20 |
20 :nomake2 |
|
21 echo Neither `make` nor `gmake' could be found, SVN version detection unable to |
|
22 echo run. Default rev.c used... |
|
23 :nosvn |
21 :nosvn |
|
22 echo Error executing `svnversion' or no SVN data detected |
24 echo const char _openttd_revision[] = "norev000"; > rev.c |
23 echo const char _openttd_revision[] = "norev000"; > rev.c |
25 echo const int _revision_number = 0; >> rev.c |
24 echo const int _revision_number = 0; >> rev.c |
26 echo #ifdef __MORPHOS__ >> rev.c |
|
27 echo const char morphos_versions_tag[] = "\\0$VER: OpenTTD norev000 (00.00.00) © OpenTTD Team [MorphOS, PowerPC]"; >> rev.c |
|
28 echo #endif >> rev.c |
|
29 goto end |
25 goto end |
30 |
26 |
31 :end |
27 :end |
32 cd os\os2 |
28 cd os\os2 |
|
29 del svnver.tmp > nul 2> nul |
33 rem end |
30 rem end |