Analysis of WinCE.bat:
if "%PROCESSOR_ARCHITECTURE%" == "" set _HOSTCPUTYPE=i386 (_HOSTCPUTYPE=i386)
if "%PROCESSOR_ARCHITECTURE%" == "x86" set _HOSTCPUTYPE=i386
if "%_WINCEROOT%" == "" goto rootusage
if "%_FLATRELEASEDIR%" == "" set _FLATRELEASEDIR=%_WINCEROOT%\release
set PREFAST_ROOT=%_WINCEROOT%\private\bin\i386\prefast\
@REM PREFAST_ROOT added to path below...
for %%i in (%_WINCEROOT%) do set _WINCEDRIVE=%%~di
echo _WINCEDRIVE=%_WINCEDRIVE% (_WINCEDRIVE=C:\)
set _SDKROOT=%_WINCEROOT%\sdk
set _SDKDRIVE=%_WINCEDRIVE%
for %%i in (%_PUBLICROOT%) do set _PUBLICDRIVE=%%~di (_PUBLICDRIVE=C:)
set _PUBLICROOT=%_WINCEROOT%\public (_PUBLICROOT=C:\public)
set _PUBLICDRIVE=%_WINCEDRIVE% (_PUBLICDRIVE=C:)
for %%i in (%_PRIVATEROOT%) do set _PRIVATEDRIVE=%%~di
set _PRIVATEROOT=%_WINCEROOT%\private (_PRIVATEROOT=C:\private)
set _PRIVATEDRIVE=%_WINCEDRIVE% (_PRIVATEDRIVE=C:)
for %%i in (%_PLATFORMROOT%) do set _PLATFORMDRIVE=%%~di
set _PLATFORMROOT=%_WINCEROOT%\platform (_PLATFORMROOT=C:\platform)
set _PLATFORMDRIVE=%_WINCEDRIVE% (_PLATFORMDRIVE=C:)
set _MAKEENVROOT=%_PUBLICROOT%\common\oak\misc
if "%_PREWINCEPATH%"=="" set _PREWINCEPATH=%PATH% (Save system path first)
path %PREFAST_ROOT%\scripts;(c:\wince420\private\bin\i386\prefast\\scripts;)
%_PUBLICROOT%\common\oak\Bin\%_HOSTCPUTYPE%;(c:\wince420\public\common\oak\Bin\i386;)
%_PRIVATEROOT%\bin\%_HOSTCPUTYPE%;(c:\wince420\private\bin\i386;)
%_PRIVATEROOT%\bat;(c:\wince420\private\bat;)
%_PUBLICROOT%\common\oak\misc;(c:\wince420\public\common\oak\misc;)
%_WINCEROOT%\developr\%USERNAME%;(c:\wince420\developr\username)
%_PREWINCEPATH%(old path appended)
path c:\wince420\sdk\bin\i386; will be added later on to the begin.
@REM --- Check args and setup argument dependent variables
:check_args
rem This just sets the base variables (allows penlist to be run in a non-wince window)
if "%1" == "" goto mainexit
set __PUBLICPROJECTS=
set __PLATFORMPROJECTS=
set __PRIVATEPROJECTS=
set __VALIDCPU=ARMV4 ARMV4I MIPS16 MIPSII MIPSII_FP MIPSIV MIPSIV_FP SH3 SH4 x86 NT NTANSI
set __VALIDPROJ=%__PUBLICPROJECTS%
set __VALIDPLAT=NOPLAT DESKTOP DESKTOP_SDK %__PLATFORMPROJECTS% @REM Extract parameters
set __TGTCPU=%1
shift
set _TGTPROJ=%1
shift
set _TGTPLAT=%1
shift
@REM Validate parameters
if "%_TGTPLAT%" == "" goto usage
if "%USERNAME%"=="" echo WARNING: USERNAME environment variable is not set!
for %%i in (%__VALIDCPU%) do if /I "%__TGTCPU%"=="%%i" goto endfor_1
if not "%_IGNOREERROR%"=="1" (
echo ERROR: CPU type '%__TGTCPU%' is not valid
goto usage
)
:endfor_1
@REM Assume we are building for Windows CE
set _TGTOS=CE
@REM Parse the target cpu configuration, shorten to show only x86
if /I "%__TGTCPU%"=="x86" (
set __TGTCPU=x86
set _TGTCPUFAMILY=x86
set _TGTCPUISA=
goto parsedcpu
)
set _TGTCPUFAMILY=__TGTCPU
set _TGTCPUISA= :parsedcpu
set _TGTCPU=%_TGTCPUFAMILY%%_TGTCPUISA%%_TGTCPUOPTIONS%
@REM // NT and NTANSI builds require special handling, since they
@REM // produce tools that run on the desktop
@REM // Set up PROJECTROOT variable first
if "%_PROJECTROOT%" == "" set _PROJECTROOT=%_PUBLICROOT%\%_TGTPROJ%
(C:\WINCE420\PUBLIC\Canoe)
@REM // Set up PROJPUBLICROOT for cloned directories, make sure to set the OS version first
set _WINCEOSVER=420
if "%_PROJPUBLICROOT%" == "" set _PROJPUBLICROOT=%_PUBLICROOT%\%_TGTPROJ%\WINCE%_WINCEOSVER%\PUBLIC
set _PROJPUBLICROOT
_PROJPUBLICROOT=c:\wince420\public\Canoe\WINCE420\PUBLIC
@REM // Set the correct _DEPTREE order. First run the top level projects
@REM // batch file. This can set the _DEPTREES
@REM // If they have not set _DEPTREES figure out what OS trees are there ...
if exist %_PROJECTROOT%\%_TGTPROJ%.bat call %_PROJECTROOT%\%_TGTPROJ%.bat
(C:\WINCE420\PUBLIC\Canoe\Canoe.bat)
set _DEPTREES=winceos
if exist %_PUBLICROOT%\dcom\cesysgen\makefile set _DEPTREES=%_DEPTREES% dcom
if exist %_PUBLICROOT%\netcf\cesysgen\makefile set _DEPTREES=%_DEPTREES% netcf
if exist %_PUBLICROOT%\ie\cesysgen\makefile set _DEPTREES=%_DEPTREES% ie
if exist %_PUBLICROOT%\script\cesysgen\makefile set _DEPTREES=%_DEPTREES% script
if exist %_PUBLICROOT%\servers\cesysgen\makefile set _DEPTREES=%_DEPTREES% servers
if exist %_PUBLICROOT%\rdp\cesysgen\makefile set _DEPTREES=%_DEPTREES% rdp
if exist %_PUBLICROOT%\shellsdk\cesysgen\makefile set _DEPTREES=%_DEPTREES% shellsdk
if exist %_PUBLICROOT%\shell\cesysgen\makefile set _DEPTREES=%_DEPTREES% shell
if exist %_PUBLICROOT%\wceshellfe\cesysgen\makefile set _DEPTREES=%_DEPTREES% wceshellfe
if exist %_PUBLICROOT%\wceappsfe\cesysgen\makefile set _DEPTREES=%_DEPTREES% wceappsfe
if exist %_PUBLICROOT%\viewers\cesysgen\makefile set _DEPTREES=%_DEPTREES% viewers
if exist %_PUBLICROOT%\directx\cesysgen\makefile set _DEPTREES=%_DEPTREES% directx
if exist %_PUBLICROOT%\pim\cesysgen\makefile set _DEPTREES=%_DEPTREES% pim
if exist %_PUBLICROOT%\datasync\cesysgen\makefile set _DEPTREES=%_DEPTREES% datasync
if exist %_PUBLICROOT%\sqlce\cesysgen\makefile set _DEPTREES=%_DEPTREES% SQLCE
REM Add new trees before this line (unless they depend on speech) so that the topmost OS project remains the same.
REM If you add or remove a deptree that contains MS private code ("Shared Source"), you must update the deptree
REM list in SrcCheck.rc (in the IDE tree, ide\tools\SrcCheck).
_DEPTREES=winceos dcom netcf ie script servers rdp shellsdk shell wceshellfe wceappsfe viewers directx datasync SQLCE
if exist %_PUBLICROOT%\speech\cesysgen\makefile set _DEPTREES=%_DEPTREES% speech
for /D %%f in (%_PUBLICROOT%\*.*) do if exist %%f\*.cec call :AddDeptTree %%~nf (speech added) @REM // Add third-party directories to deptrees
for /D %%f in (%_PROJPUBLICROOT%\*.*) do if exist %%f\*.cec call :AddDeptTree %_TGTPROJ%\wince%_WINCEOSVER%\public\%%~nf
(FSForthSysteme_I82559Kdbg added)
set _DEPTREES=%_DEPTREES% %_TGTPROJ%
(Canoe added)
So now, _DEPTREES = winceos dcom netcf ie script servers rdp shellsdk shell wceshellfe wceappsfe viewers directx datasync SQLCE speech FSForthSysteme_I82559Kdbg Canoe
if "%_CURSLMTREE%"=="" set _CURSLMTREE=%_TGTPROJ%
@REM ---------------------------------------------------------------------------
@REM ---- OK - all systems go
set _WINCECALLED=1
set _WINCEOSVER=420
set _PROJECTSDKROOT=%_PROJECTROOT%\sdk (C:\WINCE420\PUBLIC\Canoe\sdk)
set _PROJECTOAKROOT=%_PROJECTROOT%\oak
set _PROJECTDDKROOT=%_PROJECTROOT%\ddk
set _TARGETPLATROOT=%_PLATFORMROOT%\%_TGTPLAT% @REM ---------------------------------------------------------------------------
@REM --- Set the path to point the tools we will be using.
@REM ---
set path=%_SDKROOT%\bin\%_HOSTCPUTYPE%;%PATH%
if exist %_SDKROOT%\bin\%_HOSTCPUTYPE%\cepb\cepb.exe set path=%_SDKROOT%\bin\%_HOSTCPUTYPE%\cepb;%PATH%
set LIB=
set INCLUDE=
set BUILD_DEFAULT=-e -w -nmake -i -nmake -c
@REM ---------------------------------------------------------------------------
@REM ---
@REM --- Setup the user specific environment information.
@REM ---
@REM --- Initialize user settable WINCE nmake environment variables
@REM ---
if not "%BUILD_OPTIONS%"=="" echo BUILD_OPTIONS currently set to %BUILD_OPTIONS%
if "%LOCALE%" == "" set LOCALE=0409
if not "%COUNTRY%" == "" echo WARNING: The COUNTRY env setting is obsolete.
set WINCEDEBUG=retail (take note)
set WINCECOD=
set WINCEMAP=1
set WINCEOEM=
set WINCEREL=
set WINCEEMULATION=
@REM Run the platform batch file now
if exist %_TARGETPLATROOT%\%_TGTPLAT%.bat call %_TARGETPLATROOT%\%_TGTPLAT%.bat
(c:\wince420\platform\CEPC\CEPC.bat)
if "%PROCESSOR_ARCHITECTURE%" == "" goto endif_47
?
if exist %_WINCEROOT%\developr\%USERNAME%\wince.als alias -f %_WINCEROOT%\developr\%USERNAME%\wince.als
if exist %_PRIVATEROOT%\bat\wince.als alias -f %_PRIVATEROOT%\bat\wince.als
:endif_47 @REM ---------------------------------------------------------------------------
@REM ---
@REM --- For ETK, Developer environment may not exist. So pick up ETK default
@REM ---
if exist %_WINCEROOT%\public\common\oak\misc\etkenv.bat call %_WINCEROOT%\public\common\oak\misc\etkenv.bat
@REM ---------------------------------------------------------------------------
@REM ---
@REM --- Do any MSFT internal only things
@REM ---
if exist %_WINCEROOT%\private\bat\wincepriv.bat call %_WINCEROOT%\private\bat\wincepriv.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
@REM ---------------------------------------------------------------------------
@REM ---
@REM --- Load the developer's private environment initialization
@REM ---
if exist %_WINCEROOT%\developr\%USERNAME%\setenv.bat call %_WINCEROOT%\developr\%USERNAME%\setenv.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
@REM ---------------------------------------------------------------------------
@REM --- On NT we can stop the warning message
if "%PROCESSOR_ARCHITECTURE%" == "" md %_FLATRELEASEDIR%
if not "%PROCESSOR_ARCHITECTURE%" == "" md %_FLATRELEASEDIR% >nul 2>&1
@REM ---------------------------------------------------------------------------
@REM --- Check for incompatible release directory
if exist %_FLATRELEASEDIR%\*.bif goto endif_50
echo current > %_FLATRELEASEDIR%\%_TGTPROJ%.bif
echo current > %_FLATRELEASEDIR%\%_TGTPLAT%.bif
echo current > %_FLATRELEASEDIR%\%_TGTCPUFAMILY%%_TGTCPUISA%%_TGTCPUOPTIONS%.bif
:endif_50
for %%i in (%_TGTPROJ% %_TGTPLAT% %_TGTCPUFAMILY%%_TGTCPUISA%%_TGTCPUOPTIONS%) do if not exist %_FLATRELEASEDIR%\%%i.bif goto fail_relcheck
goto done_relcheck
:fail_relcheck
echo WARNING: This build window is incompatible with your current release directory.
echo The WINCEREL variable is being forced off to prevent releasing any binaries
echo automatically. You must do a "buildrel" to reinitialize the release directory
echo for the current configuration.
echo.
set WINCEREL=
:done_relcheck
@REM // Check for incompatibility of the platform and project directory
if /I "%_TGTPLAT%"=="DESKTOP" set _TGTPLAT=DESKTOP
if /I "%_TGTPLAT%"=="DESKTOP_SDK" set _TGTPLAT=DESKTOP_SDK
if /I "%_TGTPROJ%"=="COMMON" set _TGTPROJ=COMMON
if "%_TGTPLAT%"=="DESKTOP" goto endif_60
if "%_TGTPLAT%"=="DESKTOP_SDK" goto endif_60
if "%_TGTPROJ%"=="COMMON" goto endif_60
if not exist %_PLATFORMROOT%\%_TGTPLAT%\*.bif goto else_60
if exist %_PLATFORMROOT%\%_TGTPLAT%\%_TGTPROJ%.bif goto endif_65
echo WARNING: The platform you are trying use was last used in conjunction
echo with a different project. To ensure correctness of the build, the next time
echo you run CEBUILD, the platform project will be rebuilt from clean. This message
echo is for informational purposes only, no action is required on your part.
echo.
:endif_65
goto endif_60
:else_60
echo current > %_PLATFORMROOT%\%_TGTPLAT%\%_TGTPROJ%.bif
:endif_60
cd %_WINCEROOT%
@REM ---------------------------------------------------------------------------
@REM ---
@REM --- All done.
@REM ---
echo Wince %_TGTCPUFAMILY%%_TGTCPUISA%%_TGTCPUOPTIONS% %_TGTPROJ% %_TGTPLAT% Development Environment for %USERNAME% |