@REM -- cebuild1 [private, public, platform] <proj_dir>
@REM -- Builds a specific project
@REM -- Bat called:
@REM -- oakver.bat: __STBCOPYROOT
@REM -- Entry Vars: __COPYCMD __QBLDLOCAL
@REM -- Exit vars:
@REM -- Temp vars: ___OAKROOT ___COPYCPUINDPATH ___COPYCPUDEPPATH ___CLEANFLAG
@REM -----------------------------------------------------
(Build separate folders with dirs)
if not "%__QBUILDERROR%"=="" goto done
@REM ----------------------------------------------------
@REM --- First check if he did a setupoak
set ___OAKROOT=%2\oak
if not exist %___OAKROOT%\oakver.bat goto endif_20
if "%__QBLDLOCAL%"=="1" goto done
set ___SRCOAKROOT=%___OAKROOT%
:loop1
call %___SRCOAKROOT%\oakver.bat
if not exist %__STBCOPYROOT%\oakver.bat goto endloop1
set ___SRCOAKROOT=%__STBCOPYROOT%
goto loop1
:endloop1
@REM All binaries build into cpu dep for simplicity
set ___COPYCPUINDPATH=%_TGTCPU%\%WINCEDEBUG%
set ___COPYCPUDEPPATH=%_TGTCPU%\%WINCEDEBUG%
@REM // cleanup if necessary
echo CEBUILD: Cleaning up %___OAKROOT%
if not "__QBLDCLEAN"=="-c" goto endif_25
rm %___OAKROOT%\target\%___COPYCPUDEPPATH%\*.*
rm %___OAKROOT%\lib\%___COPYCPUDEPPATH%\*.*
:endif_25
echo CEBUILD: Copying targets for (%2) from (%__STBBUILDROOT%)
@REM if exist %__STBCOPYROOT%\target\%___COPYCPUINDPATH%\*.* %__COPYCMD% %__STBCOPYROOT%\target\%___COPYCPUINDPATH% %___OAKROOT%\target\%___COPYCPUINDPATH%
@REM if exist %__STBCOPYROOT%\lib\%___COPYCPUINDPATH%\*.* %__COPYCMD% %__STBCOPYROOT%\lib\%___COPYCPUINDPATH% %___OAKROOT%\lib\%___COPYCPUINDPATH%
if exist %__STBCOPYROOT%\target\%___COPYCPUDEPPATH%\*.* %__COPYCMD% %__STBCOPYROOT%\target\%___COPYCPUDEPPATH% %___OAKROOT%\target\%___COPYCPUDEPPATH%
if exist %__STBCOPYROOT%\lib\%___COPYCPUDEPPATH%\*.* %__COPYCMD% %__STBCOPYROOT%\lib\%___COPYCPUDEPPATH% %___OAKROOT%\lib\%___COPYCPUDEPPATH%
if "%USERNAME%" == "buildlab" %__COPYCMD% %__STBCOPYROOT%\target\%___COPYCPUDEPPATH% %___OAKROOT%\target\%___COPYCPUDEPPATH%
if "%USERNAME%" == "buildlab" %__COPYCMD% %__STBCOPYROOT%\lib\%___COPYCPUDEPPATH% %___OAKROOT%\lib\%___COPYCPUDEPPATH%
goto done
:endif_20
@REM ----------------------------------------------------
@REM --- If not setupoak'd, build.
if not exist %2\dirs goto done
if "%1"=="public" %_PUBLICDRIVE%
if "%1"=="private" %_PRIVATEDRIVE%
if "%1"=="platform" %_PLATFORMDRIVE%
cd %2
@REM // If building platform, check to see that he has not changed projects
set ___CLEANFLAG=%__QBLDCLEAN%
if not "%1"=="platform" goto endif_11
if exist %_PLATFORMROOT%\%_TGTPLAT%\%_TGTPROJ%.bif goto endif_13
del %_PLATFORMROOT%\%_TGTPLAT%\*.bif
echo current>%_PLATFORMROOT%\%_TGTPLAT%\%_TGTPROJ%.bif
echo CEBUILD: Building platform clean due to change of project
set ___CLEANFLAG=-c
:endif_13
:endif_11
echo CEBUILD: Building %___CLEANFLAG% (%2)
set __bldMP=
if "%bldMP%" == "" goto build_step
set __bldMP=-M %bldMP%
:build_step
echo BUILDING with __bldMP=%__bldMP%
build %___CLEANFLAG% %__bldMP% %3 %4 %5 %6 %7 %8 %9
if exist build.log type build.log >> %_WINCEROOT%\build.log
if exist build.wrn type build.wrn >> %_WINCEROOT%\build.wrn
@REM If there weren't any errors, then we're already done
if not exist build.err goto done
@REM Otherwise, if we were building MP, this might be the
@REM build.exe synchronization bug
if not "%__bldMP%" == "" goto :reset_bldMP
type build.err >> %_WINCEROOT%\build.err
echo !!!!! Error building (%2)
goto done
:reset_bldMP
set __bldMP=
set ___CLEANFLAG=
goto build_step
:endif_10
@REM ----------------------------------------------------
@REM --- Cleanup
:done
set ___OAKROOT=
set __STBCOPYROOT=
set __STBBUILDROOT=
set ___COPYCPUINDPATH=
set ___COPYCPUDEPPATH=
set ___CLEANFLAG=
set __bldMP=
@REM ----------------------------------------------------
|