REM Usage:
REM BldDemo [clean] [norel] [Parms for CEBUILD]
REM
REM clean : Must be specified before CEBUILD options. This will clean the %_PROJECTROOT%\cesysgen (C:\WINCE420\PUBLIC\Canoe\WINCE420\CEPC\cesysgen)
REM and %_PLATFORMROOT%\cesysgen directories(C:\WINCE420\platform\cesysgen). Use this option whenever you
REM change settings in your cesysgen.bat (found in %_PROJECTROOT%\oak\misc)
REM or any environment variables that control it's behavior (i.e. SYSGEN_ or
REM BSP_ variables)
REM noclean : Used to override BLDDEMO_CLEAN environment variable
REM norel : Must be specified before CEBUILD options. This will stop the process before
REM releasing the build to the %FLATRELASEDIR% path and doing the MakeImg. Useful
REM when doing multiple CPU builds in an automated process.
REM rel : Use to override BLDDEMO_NOREL environment variable.
REM CEBUILD Parms : All additional variables are passed on to CEBUILD.bat which will
REM build the tree. Useful options for cebuild include -q which will perform
REM the sysgen phase only. Do not specify -q if you have just changed any
REM sources in the public tree since the last build. The -c option will cause
REM all components to be built. (Refer to CeBuild.bat)
REM
REM
REM Environment Variables
REM
REM BLDDEMO_CLEAN : If set to "1" will set the default to clean
REM
REM Useful scenario's:
REM "blddemo clean" : Will build the image after first cleaning the cesysgen dirs
REM "blddemo -q" : Quickly build an image assuming no sysgen vars have changed
REM "blddemo clean -q" : Build quickly but also clean the cesysgen dirs first
REM
REM
REM See if the dev has a local batch file to run.
if exist %_WINCEROOT%\developr\%USERNAME%\pblddemo.bat call %_WINCEROOT%\developr\%USERNAME%\pblddemo.bat (A chance to run your own batch file to do any necessary thing before CE.NET starts doing its stuff.)
REM Get initial defaults
set _BLDDEMO_CLEAN=%BLDDEMO_CLEAN%
set _BLDDEMO_NOREL=%BLDDEMO_NOREL%
REM Check CmdLine Vars
:ParseArgs (All valid parameters)
if /I "%1"=="clean" set _BLDDEMO_CLEAN=1&&shift&&goto ParseArgs
if /I "%1"=="noclean" set _BLDDEMO_CLEAN=&&shift&&goto ParseArgs
if /I "%1"=="rel" set _BLDDEMO_NOREL=&&shift&&goto ParseArgs
if /I "%1"=="norel" set _BLDDEMO_NOREL=1&&shift&&goto ParseArgs
if /I "%1"=="-?" goto Usage
if /I "%1"=="-h" goto Usage
if /I "%1"=="usage" goto Usage
if "%_BLDDEMO_CLEAN%"=="1" echo Clean option specified
if "%_BLDDEMO_NOREL%"=="1" echo No Release option specified
(Cleaning part)
if not "%_BLDDEMO_CLEAN%%"=="1" goto NotClean
Echo Cleaning %_PROJECTROOT%\cesysgen (C:\WINCE420\PUBLIC\Canoe\WINCE420\CEPC\cesysgen)
del /f/s/q %_PROJECTROOT%\cesysgen >nul 2>&1
(Del parameters:
/f Forces deletion of read-only files.
/s Deletes specified files from the current directory and all subdirectories. Displays the names of the files as they are being deleted.
/q Specifies quiet mode. You are not prompted for delete confirmation. )
rd /s/q %_PROJECTROOT%\cesysgen >nul 2>&1
(/s Removes the specified directory and all subdirectories including any files. Use /s to remove a tree. /q Runs rmdir in quiet mode. Deletes directories without confirmation. )
Echo Cleaning %_PLATFORMROOT%\%_TGTPLAT%\cesysgen\files (C:\WINCE420\platform\CEPC\cesysgen\files)
del /f/s/q %_PLATFORMROOT%\%_TGTPLAT%\cesysgen\files >nul 2>&1
rd /s/q %_PLATFORMROOT%\%_TGTPLAT%\cesysgen\files >nul 2>&1
del /f/q %_PLATFORMROOT%\%_TGTPLAT%\*.bif >nul 2>&1
:NotClean
CALL CEBUILD.BAT %1 %2 %3 %4 %5 %6 %7 %8 %9
if exist %_WINCEROOT%\build.err goto error
if "%_BLDDEMO_NOREL%"=="1" goto enddemo
CALL BUILDREL.BAT
echo Calling Makeimg -- Please Wait
MAKEIMG > %_FLATRELEASEDIR%\makeimg.out 2>&1
if errorlevel 1 goto mierror
REM Create a log with the full set of sysgen settings
setlocal
call %_WINCEROOT%\public\%_TGTPROJ%\oak\misc\cesysgen.bat
set SYSGEN_ > %_FLATRELEASEDIR%\SysgenSettings.out
endlocal
:mierror
REM Pretend we didn't keep the log and show it to the user.
if not "%BLDDEMO_MI_LOG%"=="1" type %_FLATRELEASEDIR%\makeimg.out
REM Show the user the newly created nk.bin
if exist %_FLATRELEASEDIR%\nk.bin dir %_FLATRELEASEDIR%\nk.bin
:done
echo.
echo BLDDEMO: %_TGTPROJ% build complete.
echo.
goto enddemo
:Usage
echo.
echo BldDemo :
echo.
echo This batch file is used to build and create a CE Image
echo.
echo Usage:
echo BldDemo [clean] [norel] [Parms for CEBUILD]
echo.
echo clean : Must be specified before CEBUILD options. This will clean the
echo %_PROJECTROOT%\cesysgen and %_PLATFORMROOT%\cesysgen
echo directories. Use this option whenever you change settings
echo in your cesysgen.bat (found in %_PROJECTROOT%\oak\misc)
echo or any environment variables that control it's behavior
echo (i.e. SYSGEN_ or BSP_ variables)
echo noclean : Used to override BLDDEMO_CLEAN environment variable
echo norel : Must be specified before CEBUILD options. This will stop the
echo process before releasing the build to the %FLATRELASEDIR%
echo path and doing the MakeImg. Useful when doing multiple CPU
echo builds in an automated process.
echo rel : Use to override BLDDEMO_NOREL environment variable.
echo CEBUILD Parms : All additional variables are passed on to CEBUILD.bat
echo which will build the tree. Useful options for cebuild include
echo -q which will perform the sysgen phase only. Do not specify -q
echo if you have just changed any sources in the public tree since
echo the last build.
echo.
echo Useful scenario's:
echo "blddemo clean" : Will build the image after first cleaning the cesysgen dirs
echo "blddemo -q" : Quickly build an image assuming no sysgen vars have changed
echo "blddemo clean -q" : Build quickly but also clean the cesysgen dirs first
echo.
goto enddemo
:error
echo.
echo BLDDEMO: There were errors building %_TGTPROJ%
echo.
:enddemo
endlocal
|