2012-05-20 07:25:25 +00:00
|
|
|
@echo off
|
|
|
|
setlocal ENABLEEXTENSIONS DISABLEDELAYEDEXPANSION
|
|
|
|
|
2013-03-21 09:49:12 +00:00
|
|
|
set targets=eduke32 mapster32
|
2012-05-20 07:25:25 +00:00
|
|
|
set PATH=C:\devkitPro\devkitPPC\bin;C:\devkitPro\msys\bin;C:\MinGW\bin;C:\MinGW\msys\1.0\bin;%PATH%
|
|
|
|
|
2013-03-04 07:49:47 +00:00
|
|
|
pushd "%~dp0.."
|
|
|
|
set wiidir=platform\Wii
|
|
|
|
|
2012-05-20 07:25:25 +00:00
|
|
|
:: Detect versioning systems and pull the revision number:
|
2013-10-13 09:16:25 +00:00
|
|
|
for /f "delims=" %%G in ('svn info 2^>^&1 ^| grep Revision ^| cut -d " " -f 2') do @set rev=%%G
|
2012-05-20 07:25:25 +00:00
|
|
|
if not "%rev%"=="" set vc=svn
|
2013-10-13 09:16:25 +00:00
|
|
|
if "%rev%"=="" for /f "delims=" %%G in ('git svn info 2^>^&1 ^| grep Revision ^| cut -d " " -f 2') do @set rev=%%G
|
2012-05-20 07:25:25 +00:00
|
|
|
if not "%rev%"=="" set vc=git
|
|
|
|
if "%rev%"=="" set vc=none
|
2013-10-13 09:16:25 +00:00
|
|
|
if "%rev%"=="" set rev=XXXX
|
2012-05-20 07:25:25 +00:00
|
|
|
|
|
|
|
:: Get the current date:
|
|
|
|
for /f "delims=" %%G in ('"C:\MinGW\msys\1.0\bin\date.exe" +%%Y%%m%%d') do @set currentdate=%%G
|
|
|
|
|
|
|
|
:: Build:
|
2014-06-16 23:16:08 +00:00
|
|
|
set commandline=make veryclean all OPTLEVEL=2 LTO=0 PLATFORM=WII %*
|
|
|
|
echo %commandline%
|
|
|
|
%commandline%
|
2012-05-20 07:25:25 +00:00
|
|
|
|
2013-02-18 08:49:20 +00:00
|
|
|
for %%G in (%targets%) do if not exist "%%~G.elf" goto end
|
2012-06-03 16:11:22 +00:00
|
|
|
|
2012-05-20 07:25:25 +00:00
|
|
|
:: Package data:
|
2013-02-18 08:49:20 +00:00
|
|
|
if not exist apps mkdir apps
|
2013-03-04 07:49:47 +00:00
|
|
|
for %%G in (%targets%) do xcopy /e /q /y %wiidir%\apps\%%~G apps\%%~G\
|
2013-02-18 08:49:20 +00:00
|
|
|
for %%G in (%targets%) do for %%H in (.elf) do if exist "%%~G%%~H" move /y "%%~G%%~H" "apps\%%~G\boot%%~H"
|
|
|
|
for %%G in (%targets%) do for %%H in (.elf.map) do if exist "%%~G%%~H" del /f /q "%%~G%%~H"
|
2013-10-13 09:16:25 +00:00
|
|
|
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"
|
2013-02-18 08:49:20 +00:00
|
|
|
|
2014-06-16 23:16:08 +00:00
|
|
|
xcopy /e /q /y /EXCLUDE:%wiidir%\xcopy_exclude.txt package\common apps\eduke32\
|
2013-02-18 08:49:20 +00:00
|
|
|
|
2014-06-16 23:16:08 +00:00
|
|
|
xcopy /e /q /y /EXCLUDE:%wiidir%\xcopy_exclude.txt package\common apps\mapster32\
|
|
|
|
xcopy /e /q /y /EXCLUDE:%wiidir%\xcopy_exclude.txt package\sdk apps\mapster32\
|
2013-02-18 08:49:20 +00:00
|
|
|
|
2012-05-20 07:25:25 +00:00
|
|
|
"ls.exe" -l -R apps
|
2013-10-13 09:16:25 +00:00
|
|
|
7z.exe a -mx9 -t7z eduke32-wii-r%rev%.7z apps -xr!*.svn*
|
2012-05-20 07:25:25 +00:00
|
|
|
|
2012-06-03 16:11:22 +00:00
|
|
|
:end
|
|
|
|
|
2012-05-20 07:25:25 +00:00
|
|
|
endlocal
|
2013-02-18 08:49:20 +00:00
|
|
|
goto :eof
|