Add /clean to build.bat to delete the build directory and its contents before building. bug235_bringup_0
authorMatt Plumtree <matt.plumtree@nokia.com>
Mon, 01 Nov 2010 18:11:59 +0000
branchbug235_bringup_0
changeset 70 08233365fef6
parent 69 3f914c77c2e9
child 71 243bbc1d70db
Add /clean to build.bat to delete the build directory and its contents before building.
build.bat
--- a/build.bat	Mon Nov 01 18:10:32 2010 +0000
+++ b/build.bat	Mon Nov 01 18:11:59 2010 +0000
@@ -10,6 +10,7 @@
 set CMAKE_BUILD_TARGET=Release
 set VISUAL_STUDIO_SOLUTION=OFF
 set BUILD=ON
+set CLEANBUILD=OFF
 set EPOCROOTX=%EPOCROOT:\=/%
 
 :PARSECOMMANDLINE
@@ -26,6 +27,8 @@
 IF '%1'=='/DEBUG' goto ENABLEDEBUG
 IF '%1'=='/nobuild' goto DISABLEBUILD
 IF '%1'=='/NOBUILD' goto DISABLEBUILD
+IF '%1'=='/clean' goto CLEANBUILD
+IF '%1'=='/CLEAN' goto CLEANBUILD
 
 if "%VISUAL_STUDIO_SOLUTION%"=="ON" (
 	set GENERATOR=Visual Studio 8 2005
@@ -41,13 +44,14 @@
 echo GENERATOR            = %GENERATOR%
 echo CMAKE_BUILD_TARGET   = %CMAKE_BUILD_TARGET%
 echo BUILD                = %BUILD%
+echo CLEANBUILD           = %CLEANBUILD%
 echo EPOCROOT (modified)  = %EPOCROOTX%
 echo.
 
 rem Execute
 echo on
-rmdir /s /q build
-mkdir build
+if '%CLEANBUILD%'=='ON' rmdir /s /q build
+if '%CLEANBUILD%'=='ON' mkdir build
 cd build
 cmake -DEPOCROOT=%EPOCROOTX% -DSIMULATOR_EXTENSIONS:Bool=%SIMULATOR_EXTENSIONS% -DTOOLCHAIN_VARIANT:String=%TOOLCHAIN_VARIANT% -DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TARGET% -G "%GENERATOR%" ..
 @echo off
@@ -74,6 +78,7 @@
 echo     [/DEBUG]            configure for debug build (default: release)
 echo     [/NOBUILD]          call cmake but do not call nmake
 echo                             note: has no effect if /SOLUTION is specified
+echo     [/CLEAN]            perform a clean build by deleting the ./build directory.
 echo.
 echo Note: EPOCROOT must be defined to be the directory containing the epoc32 tree.
 goto END
@@ -104,4 +109,9 @@
 shift
 goto PARSECOMMANDLINE
 
+:CLEANBUILD
+set CLEANBUILD=ON
+shift
+goto PARSECOMMANDLINE
+
 :END