tools/build_windows.bat
changeset 13516 b62b14aa88d4
parent 13515 60bcc20e6ab0
child 13517 4c5c8a83e298
equal deleted inserted replaced
13515:60bcc20e6ab0 13516:b62b14aa88d4
     1 :: WARNNG WARNING WARNING ::
       
     2 :: This Batch script is BROKEN and EXTREMELY OUTDATED!
       
     3 :: It does not work with latest version and needs a complete redo or removal.
       
     4 :: Its functionality has been disabled.
       
     5 
       
     6 :: Print dummy text and return.
       
     7 echo Sorry, this script is outdated. You're on your own.
       
     8 exit
       
     9 
       
    10 
       
    11 ::::::::::::::::::::::::::::::
       
    12 :: Old script code follows ...
       
    13 ::::::::::::::::::::::::::::::
       
    14 @echo off
       
    15 ::edit these variables if you need
       
    16 set PASCAL=C:\FPC\2.6.0\bin\i386-win32\
       
    17 :: FIXME: Go Qt 5
       
    18 set QTDIR=C:\QtSDK\Desktop\Qt\4.7.4\mingw\bin
       
    19 set PATH=%PATH%;%PASCAL%
       
    20 set BUILD_TYPE="Debug"
       
    21 
       
    22 :setup
       
    23 set CURRDIR="%CD%"
       
    24 cd ..
       
    25 
       
    26 echo Fetching all DLLs...
       
    27 if %BUILD_TYPE%=="Debug" (
       
    28     for %%G in (QtCored4 QtGuid4 QtNetworkd4) do xcopy /d/y %QTDIR%\%%G.dll %CD%\bin\
       
    29 )
       
    30 :: should you libgcc dynamically you should try adding libgcc_s_dw2-1 and mingwm10
       
    31 :: FIXME: Use Qt5
       
    32 for %%G in (QtCore4 QtGui4 QtNetwork4) do (
       
    33     xcopy /d/y %QTDIR%\%%G.dll %CD%\bin\
       
    34 )
       
    35 
       
    36 :: FIXME: Use SDL 2.0
       
    37 if not exist %CD%\misc\winutils\bin\ mkdir %CD%\misc\winutils\bin\
       
    38 if not exist %CD%\misc\winutils\bin\SDL.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://www.libsdl.org/release/SDL-1.2.15-win32.zip %CD%\misc\winutils\bin
       
    39 if not exist %CD%\misc\winutils\bin\SDL_image.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.12-win32.zip %CD%\misc\winutils\bin
       
    40 if not exist %CD%\misc\winutils\bin\SDL_net.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://www.libsdl.org/projects/SDL_net/release/SDL_net-1.2.8-win32.zip %CD%\misc\winutils\bin
       
    41 if not exist %CD%\misc\winutils\bin\SDL_mixer.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-1.2.12-win32.zip %CD%\misc\winutils\bin
       
    42 if not exist %CD%\misc\winutils\bin\SDL_ttf.dll cscript %CD%\tools\w32DownloadUnzip.vbs  http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.11-win32.zip %CD%\misc\winutils\bin
       
    43 
       
    44 ::for video recording
       
    45 :: FIXME: googlecode.com is defunct.
       
    46 if not exist %CD%\misc\winutils\bin\avformat-54.dll cscript %CD%\tools\w32DownloadUnzip.vbs http://hedgewars.googlecode.com/files/libav-win32-20121022-dll.zip %CD%\misc\winutils\bin
       
    47 
       
    48 ::this is needed because fpc png unit hardcodes libpng-1.2.12
       
    49 if not exist %CD%\misc\winutils\bin\libpng13.dll copy /y %CD%\misc\winutils\bin\libpng15-15.dll %CD%\misc\winutils\bin\libpng13.dll
       
    50 
       
    51 xcopy /d/y %CD%\misc\winutils\bin\*.dll %CD%\bin\
       
    52 
       
    53 ::setting up the environment...
       
    54 call %QTDIR%\qtenv2.bat
       
    55 
       
    56 echo Running cmake...
       
    57 set ERRORLEVEL=
       
    58 cmake . -G "MinGW Makefiles" -DPNG_LIBRARY="%CD%\misc\winutils\bin\libpng13.dll" -DCMAKE_BUILD_TYPE="%BUILD_TYPE%" -DCMAKE_PREFIX_PATH="%CD%\misc\winutils\\"
       
    59 :: prefix should be last
       
    60 
       
    61 if %ERRORLEVEL% NEQ 0 goto exitpoint
       
    62 
       
    63 echo Running make...
       
    64 set ERRORLEVEL=
       
    65 mingw32-make VERBOSE=1
       
    66 if %ERRORLEVEL% NEQ 0 goto exitpoint
       
    67 
       
    68 echo Installing...
       
    69 set ERRORLEVEL=
       
    70 mingw32-make install > nul
       
    71 if %ERRORLEVEL% NEQ 0 goto exitpoint
       
    72 
       
    73 echo Creating commodity shortcut...
       
    74 copy /y %CD%\misc\winutils\Hedgewars.lnk C:%HOMEPATH%\Desktop\Hedgewars.lnk
       
    75 
       
    76 echo ALL DONE, Hedgewars has been successfully compiled and installed
       
    77 
       
    78 :exitpoint
       
    79 cd %CURRDIR%
       
    80 pause