tools/build_windows.bat
changeset 7799 a88a02c19a5b
parent 6569 64f9fbd48b9e
child 7810 da60e6b6baa3
--- a/tools/build_windows.bat	Tue Oct 23 04:06:12 2012 -0400
+++ b/tools/build_windows.bat	Tue Oct 23 12:12:28 2012 +0100
@@ -1,45 +1,45 @@
 @echo off
-:edit these variables if you need
-SET PASCAL=C:\FPC\2.4.4\bin\i386-win32\
-SET QTDIR=C:\QtSDK\Desktop\Qt\4.7.4\mingw\bin
-SET PATH=%PATH%;%PASCAL%
+::edit these variables if you need
+set PASCAL=C:\FPC\2.4.4\bin\i386-win32\
+set QTDIR=C:\QtSDK\Desktop\Qt\4.7.4\mingw\bin
+set PATH=%PATH%;%PASCAL%
 
-:SETUP
+:setup
+set CURRDIR="%CD%"
 cd ..
-if not exist bin mkdir bin
-cd bin
 
 echo Copying the DLLs...
-xcopy /d/y ..\misc\winutils\bin\* .
-xcopy /d/y %QTDIR%\QtCore4.dll .
-xcopy /d/y %QTDIR%\QtGui4.dll .
-xcopy /d/y %QTDIR%\QtNetwork4.dll .
-xcopy /d/y %QTDIR%\libgcc_s_dw2-1.dll .
-xcopy /d/y %QTDIR%\mingwm10.dll .
+REM xcopy /d/y %CD%\misc\winutils\bin\* .
+xcopy /d/y %QTDIR%\QtCore4.dll bin
+xcopy /d/y %QTDIR%\QtGui4.dll bin
+xcopy /d/y %QTDIR%\QtNetwork4.dll bin
+xcopy /d/y %QTDIR%\libgcc_s_dw2-1.dll bin
+xcopy /d/y %QTDIR%\mingwm10.dll bin
 
-echo Setting up the environment...
+::setting up the environment...
 call %QTDIR%\qtenv2.bat
 
 echo Running cmake...
-set errorlevel=
-cmake -G "MinGW Makefiles" -DCMAKE_INCLUDE_PATH="%CD%\..\misc\winutils\include" -DCMAKE_LIBRARY_PATH="%CD%\..\misc\winutils\lib" ..
+set ERRORLEVEL=
+cmake -G "MinGW Makefiles" -DCMAKE_INCLUDE_PATH="%CD%\misc\winutils\include" -DCMAKE_LIBRARY_PATH="%CD%\misc\winutils\lib" .
 
-if %errorlevel% NEQ 0 goto exit
+if %ERRORLEVEL% NEQ 0 goto exitpoint
 
 echo Running make...
-set errorlevel=
-mingw32-make -lSDL -lSDL_Mixer install
-
-if %errorlevel% NEQ 0 goto exit
+set ERRORLEVEL=
+mingw32-make
+if %ERRORLEVEL% NEQ 0 goto exitpoint
 
-echo Creating shortcut...
-if /i "%PROGRAMFILES(X86)%"=="" (
-	COPY /y ..\misc\winutils\Hedgewars_x86.lnk C:\%HOMEPATH%\Desktop\Hedgewars.lnk 
-) else (
-	COPY /y ..\misc\winutils\Hedgewars_x64.lnk C:\%HOMEPATH%\Desktop\Hedgewars.lnk
-)
+echo Installing...
+set ERRORLEVEL=
+mingw32-make install > nul
+if %ERRORLEVEL% NEQ 0 goto exitpoint
+
+echo Creating commodity shortcut...
+COPY /y %CD%\misc\winutils\Hedgewars.lnk C:%HOMEPATH%\Desktop\Hedgewars.lnk
+
 echo ALL DONE, Hedgewars has been successfully compiled and installed
 
-:exit
-cd ../tools
+:exitpoint
+cd %CURRDIR%
 pause