2013-06-07 17:50:43 +00:00
|
|
|
@echo off
|
|
|
|
|
|
|
|
rem change to the directory of this batch file
|
|
|
|
ECHO --------------------------------
|
|
|
|
ECHO Changing to build folder [%~dp0] p1 ["%1"] p2 ["%2"]
|
|
|
|
rem pause
|
|
|
|
cd /d "%~dp0"
|
|
|
|
|
|
|
|
ECHO Checking for windows binary runtime tools...
|
2014-01-24 16:05:28 -08:00
|
|
|
if NOT EXIST .\7z.exe call cscript getTools.vbs
|
|
|
|
if NOT EXIST .\7z.dll call cscript getTools.vbs
|
|
|
|
if NOT EXIST .\tar.exe call cscript getTools.vbs
|
|
|
|
if NOT EXIST .\wget.exe call cscript getTools.vbs
|
2013-06-07 17:50:43 +00:00
|
|
|
|
|
|
|
set depfolder=windows_deps
|
|
|
|
set depfile=%depfolder%.7z
|
|
|
|
|
|
|
|
dir ..\..\source\
|
|
|
|
if NOT EXIST ..\..\source\%depfolder%\NUL echo folder not found [%depfolder%]
|
|
|
|
if NOT EXIST ..\..\source\%depfolder%\NUL goto checkDepIntegrity
|
|
|
|
goto processBuildStageA
|
|
|
|
|
|
|
|
:getDepFile
|
|
|
|
ECHO Retrieving windows dependency archive...
|
2013-10-24 16:57:33 +00:00
|
|
|
rem call ..\..\data\glest_game\wget.exe -c -O ..\..\source\%depfile% http://master.dl.sourceforge.net/project/megaglest/%depfile%
|
2014-01-24 16:05:28 -08:00
|
|
|
call .\wget.exe -c -O ..\..\source\%depfile% http://download.sourceforge.net/project/megaglest/%depfile%
|
|
|
|
call .\7z.exe x -r -o..\..\source\ ..\..\source\%depfile%
|
2013-06-07 17:50:43 +00:00
|
|
|
goto processBuildStageA
|
|
|
|
|
|
|
|
:checkDepIntegrity
|
|
|
|
ECHO Looking for windows dependency archive...
|
2014-01-24 16:05:28 -08:00
|
|
|
call .\7z.exe t ..\..\source\%depfile% >nul
|
2013-06-07 17:50:43 +00:00
|
|
|
set 7ztestdep=%ERRORLEVEL%
|
|
|
|
ECHO Result of windows dependency archive [%7ztestdep%]
|
|
|
|
if NOT "%7ztestdep%" == "0" goto getDepFile
|
|
|
|
goto processBuildStageA
|
|
|
|
|
|
|
|
:processBuildStageA
|
|
|
|
call CopyWindowsRuntimeDlls_2010.bat nopause
|
|
|
|
|
|
|
|
rem setup the Visual Studio 2010 environment
|
|
|
|
ECHO --------------------------------
|
|
|
|
ECHO Setting up Visual Studio 2010 environment vars...
|
|
|
|
REM Ensure ultifds HP doesn't mess the build up
|
|
|
|
SET Platform=
|
|
|
|
if "%DevEnvDir%." == "." goto SETVCVARS
|
2013-12-02 12:59:36 -08:00
|
|
|
GOTO GITSECTION
|
2013-06-07 17:50:43 +00:00
|
|
|
|
|
|
|
:SETVCVARS
|
|
|
|
|
|
|
|
IF EXIST "%VS100COMNTOOLS%..\..\" GOTO VC_Common
|
|
|
|
IF EXIST "\Program Files\Microsoft Visual Studio 10.0\" GOTO VC_32
|
|
|
|
IF EXIST "\Program Files (x86)\Microsoft Visual Studio 10.0\" GOTO VC_64
|
2013-12-02 12:59:36 -08:00
|
|
|
goto GITSECTION
|
2013-06-07 17:50:43 +00:00
|
|
|
|
|
|
|
:VC_Common
|
|
|
|
call "%VS100COMNTOOLS%..\..\vc\vcvarsall.bat"
|
2013-12-02 12:59:36 -08:00
|
|
|
goto GITSECTION
|
2013-06-07 17:50:43 +00:00
|
|
|
|
|
|
|
:VC_32
|
|
|
|
ECHO 32 bit Windows detected...
|
|
|
|
call "\Program Files\Microsoft Visual Studio 10.0\vc\vcvarsall.bat"
|
2013-12-02 12:59:36 -08:00
|
|
|
goto GITSECTION
|
2013-06-07 17:50:43 +00:00
|
|
|
|
|
|
|
:VC_64
|
|
|
|
ECHO 64 bit Windows detected...
|
|
|
|
call "\Program Files (x86)\Microsoft Visual Studio 10.0\vc\vcvarsall.bat"
|
2013-12-02 12:59:36 -08:00
|
|
|
goto GITSECTION
|
2013-06-07 17:50:43 +00:00
|
|
|
|
|
|
|
|
2013-12-02 12:59:36 -08:00
|
|
|
:GITSECTION
|
|
|
|
rem Update from GIT to latest rev
|
2013-06-07 17:50:43 +00:00
|
|
|
ECHO --------------------------------
|
2013-12-02 12:59:36 -08:00
|
|
|
Echo Updating Code from GIT to latest Revision...
|
|
|
|
cd ..\..\
|
2014-01-18 12:15:00 -08:00
|
|
|
git submodule update
|
2013-12-14 12:50:27 -08:00
|
|
|
git pull
|
|
|
|
git submodule foreach git pull
|
2013-12-02 12:59:36 -08:00
|
|
|
|
|
|
|
set GITVERSION_SHA1=.
|
|
|
|
set GITVERSION_REV=.
|
|
|
|
set GET_GIT_SHA1="git log -1 --format=%%h"
|
|
|
|
for /f "delims=" %%a in ('%GET_GIT_SHA1%') do @set GITVERSION_SHA1=%%a
|
|
|
|
for /f "delims=" %%a in ('git rev-list HEAD --count') do @set GITVERSION_REV=%%a
|
|
|
|
ECHO Will build using GIT Revision: [%GITVERSION_REV%.%GITVERSION_SHA1%]
|
|
|
|
cd mk\windoze
|
2013-06-07 17:50:43 +00:00
|
|
|
rem pause
|
|
|
|
|
|
|
|
ECHO --------------------------------
|
|
|
|
Echo Touching the build date/time file so we get proper build stamp
|
|
|
|
rem touch ..\..\source\glest_game\facilities\game_util.cpp
|
|
|
|
copy /b ..\..\source\glest_game\facilities\game_util.cpp +,,
|
|
|
|
|
|
|
|
rem Build Mega-Glest in release mode
|
|
|
|
ECHO --------------------------------
|
2014-03-16 06:13:31 +01:00
|
|
|
Echo Building MegaGlest using Visual Studio 2010...
|
2013-06-07 17:50:43 +00:00
|
|
|
|
|
|
|
set CL=
|
2013-12-02 12:59:36 -08:00
|
|
|
del ..\..\source\glest_game\facilities\gitversion.h
|
2013-06-07 17:50:43 +00:00
|
|
|
|
2013-12-02 12:59:36 -08:00
|
|
|
if not "%GITVERSION_SHA1%" == "." set CL=/DGITVERSIONHEADER
|
2014-03-16 06:13:31 +01:00
|
|
|
if not "%GITVERSION_SHA1%" == "." echo building with CL [%CL%]
|
2013-12-02 12:59:36 -08:00
|
|
|
if not "%GITVERSION_SHA1%" == "." echo #define GITVERSION "%GITVERSION_REV%.%GITVERSION_SHA1%" > ..\..\source\glest_game\facilities\gitversion.h
|
|
|
|
if not "%GITVERSION_SHA1%" == "." copy /b ..\..\source\glest_game\facilities\game_util.cpp +,,
|
2013-06-07 17:50:43 +00:00
|
|
|
|
2014-03-16 06:16:24 +01:00
|
|
|
del /Q /F Release\*.tlog
|
2014-03-16 06:13:31 +01:00
|
|
|
|
2013-06-07 17:50:43 +00:00
|
|
|
set msBuildMaxCPU=
|
|
|
|
SET BuildInParallel=false
|
2013-10-19 22:03:13 +00:00
|
|
|
SET BuildInParallelCount=
|
|
|
|
rem /m:%MultiprocMSBuildCount%
|
|
|
|
if %NUMBER_OF_PROCESSORS% GTR 1 (
|
2013-06-07 17:50:43 +00:00
|
|
|
SET NumberOfProcessesToUseForBuild=2
|
|
|
|
SET BuildInParallel=true
|
2013-10-19 22:03:13 +00:00
|
|
|
SET BuildInParallelCount=/m:2
|
2013-06-07 17:50:43 +00:00
|
|
|
SET msBuildMaxCPU=/maxcpucount)
|
|
|
|
|
2013-10-19 22:03:13 +00:00
|
|
|
ECHO Found CPU Count [%NUMBER_OF_PROCESSORS%] BuildInParallel = [%BuildInParallel%]
|
2013-06-07 17:50:43 +00:00
|
|
|
if "%2" == "rebuild" echo Doing a FULL REBUILD...
|
|
|
|
rem if "%2" == "rebuild" msbuild /detailedsummary %msBuildMaxCPU% /p:BuildInParallel=%BuildInParallel% /p:Configuration=Release /t:Rebuild Glest_vc2010.sln
|
2014-01-22 07:44:27 -08:00
|
|
|
if "%2" == "rebuild" msbuild %msBuildMaxCPU% %BuildInParallelCount% /p:TrackFileAccess=false;Configuration=Release /t:Rebuild Glest_vc2010.sln
|
2013-06-07 17:50:43 +00:00
|
|
|
rem if not "%2" == "rebuild" msbuild /detailedsummary %msBuildMaxCPU% /p:BuildInParallel=%BuildInParallel% /p:Configuration=Release Glest_vc2010.sln
|
2014-01-22 07:44:27 -08:00
|
|
|
if not "%2" == "rebuild" msbuild %msBuildMaxCPU% %BuildInParallelCount% /p:TrackFileAccess=false;Configuration=Release Glest_vc2010.sln
|
2013-06-07 17:50:43 +00:00
|
|
|
|
|
|
|
rem pause execution so we can see the output before the batch file exits
|
|
|
|
if not "%1" == "nopause" pause
|