Subversion Repositories eduke32

Rev

Rev 3582 | Rev 4512 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2685 hendricks2 1
@echo off
2
setlocal ENABLEEXTENSIONS DISABLEDELAYEDEXPANSION
3
 
3582 hendricks2 4
set targets=eduke32 mapster32
2685 hendricks2 5
set PATH=C:\devkitPro\devkitPPC\bin;C:\devkitPro\msys\bin;C:\MinGW\bin;C:\MinGW\msys\1.0\bin;%PATH%
6
 
3554 hendricks2 7
pushd "%~dp0.."
8
set wiidir=platform\Wii
9
 
2685 hendricks2 10
:: Detect versioning systems and pull the revision number:
4103 hendricks2 11
for /f "delims=" %%G in ('svn info 2^>^&1 ^| grep Revision ^| cut -d " " -f 2') do @set rev=%%G
2685 hendricks2 12
if not "%rev%"=="" set vc=svn
4103 hendricks2 13
if "%rev%"=="" for /f "delims=" %%G in ('git svn info 2^>^&1 ^| grep Revision ^| cut -d " " -f 2') do @set rev=%%G
2685 hendricks2 14
if not "%rev%"=="" set vc=git
15
if "%rev%"=="" set vc=none
4103 hendricks2 16
if not "%rev%"=="" echo s_buildRev = "r%rev%";>source\rev.h
17
if "%rev%"=="" set rev=XXXX
2685 hendricks2 18
 
19
:: Get the current date:
20
for /f "delims=" %%G in ('"C:\MinGW\msys\1.0\bin\date.exe" +%%Y%%m%%d') do @set currentdate=%%G
21
 
22
:: Build:
23
set buildparameters=PLATFORM=WII %*
24
 
25
make veryclean %buildparameters%
26
make OPTLEVEL=2 LTO=0 %buildparameters%
27
 
3495 hendricks2 28
for %%G in (%targets%) do if not exist "%%~G.elf" goto end
2728 hendricks2 29
 
2685 hendricks2 30
:: Package data:
3495 hendricks2 31
if not exist apps mkdir apps
3554 hendricks2 32
for %%G in (%targets%) do xcopy /e /q /y %wiidir%\apps\%%~G apps\%%~G\
3495 hendricks2 33
for %%G in (%targets%) do for %%H in (.elf) do if exist "%%~G%%~H" move /y "%%~G%%~H" "apps\%%~G\boot%%~H"
34
for %%G in (%targets%) do for %%H in (.elf.map) do if exist "%%~G%%~H" del /f /q "%%~G%%~H"
4103 hendricks2 35
for %%G in (%targets%) do "echo.exe" -e "    <version>r%rev%</version>\n    <release_date>%currentdate%</release_date>" | "cat.exe" "%wiidir%\%%~G_meta_1.xml" - "%wiidir%\%%~G_meta_2.xml" >"apps\%%~G\meta.xml"
3495 hendricks2 36
 
3235 hendricks2 37
:: We don't want to package all the stuff, most of it is for Mapster32 and dev materials.
38
:: However, do throw in the licenses:
39
if exist "package\*.txt" copy /y "package\*.txt" "apps\eduke32\"
3495 hendricks2 40
 
3582 hendricks2 41
xcopy /e /q /y /EXCLUDE:%wiidir%\xcopy_exclude.txt package apps\mapster32\
3495 hendricks2 42
 
2685 hendricks2 43
"ls.exe" -l -R apps
4103 hendricks2 44
7z.exe a -mx9 -t7z eduke32-wii-r%rev%.7z apps -xr!*.svn*
2685 hendricks2 45
 
2728 hendricks2 46
:end
47
 
2685 hendricks2 48
:: Clean up revision number:
49
if "%vc%"=="svn" svn revert source\rev.h
50
if "%vc%"=="git" git checkout source\rev.h
51
 
52
endlocal
3495 hendricks2 53
goto :eof