
type WIN32\autobuild.txt

del /Q WIN32\Build\*

codeblocks /na /nd --target=Release --rebuild WIN32\Codeblocks\bmfcompress.cbp
codeblocks /na /nd --target=Release --rebuild WIN32\Codeblocks\bmfdecompress.cbp
codeblocks /na /nd --rebuild WIN32\Codeblocks\basedata.cbp
codeblocks /na /nd --target=Release --rebuild WIN32\Codeblocks\blinkenplayer.cbp
codeblocks /na /nd --target=Release --rebuild WIN32\Codeblocks\lostpixels.cbp

echo Running postbuild
copy WIN32\SDL_Image\lib\*.dll WIN32\Build
copy WIN32\SDL_ttf\lib\*.dll WIN32\Build
copy WIN32\SDL_Mixer\lib\*.dll WIN32\Build
copy WIN32\SDL\lib\*.dll WIN32\Build
copy WIN32\SDL_net\lib\*.dll WIN32\Build
copy DOC\* WIN32\Build
copy BASEDATA\GFX\splash.jpg WIN32\Build
copy BASEDATA\GFX\*.ico WIN32\Build
copy BASEDATA\GFX\win32_installer_*.bmp WIN32\Build
copy BASEDATA\TTF\*.ttf WIN32\Build

echo Building AddOns
set PATH=%PATH%;%CD%\WIN32\Build
cd ..\addons
make -f Makefile.Win32 clean compile
copy for_upload\*.bmf ..\software\WIN32\Build
cd ..\software
del WIN32\Build\theme_*.bmf


echo Running INNO-Setup Compiler
Compil32.exe /cc Win32\INSTALLER\innosetup.iss

echo Done