Windows CE Build Environment Tool (Windows CE 5.0)
Wince.bat prepares the development workstation build environment by using three input parameters to determine the build environment, the location of the source files used during the build process, and the files created during the build process.
When Wince.bat is executed in the command prompt build window, it uses the following three input parameters to set the environment variables specific to the Windows CE project.
- %_TGTCPU%
- %_TGTPROJ%
- %_TGTPLAT%
These variables are used throughout the build process to build the appropriate targets.
**Note **If Setdrive.exe or Setdrv.bat fails, Wince.bat fails.
If the following environment variables are not set before Wince.bat is run, Wince.bat sets them to their default values.
set _FLATRELEASEDIR=%_WINCEROOT%\release
set _PROJECTROOT=%_PUBLICROOT%\%_TGTPROJ%
%_WINCEROOT% must be set before running Wince.bat. Otherwise, Wince.bat reports an error and exits.
Wince.bat continues to set a series of environment variables. In addition, Wince.bat calls several batch files, which can also contain environment variables. The following table shows the batch files that Wince.bat calls.
Batch file | Description |
---|---|
Setenv.bat | Sets private environment variables for the build window. This must be in the %_WINCEROOT%\Developr\%USERNAME% directory. |
%_TGTPLAT%.bat | Sets OS design-dependent environment variables related to the OS design. This must be in the %_WINCEROOT%\Platform\%_TGTPLAT% directory. |
%_TGTPROJ%.bat | Sets project-dependent environment variables.
Each configuration and demonstration project folder in the Public directory contains a batch file named after the corresponding project. This must be in the %_PROJECTROOT% directory. |
%_WINCEROOT%\Setdrv.bat | Sets the development workstation drive for the Windows CE project. |
%_WINCEROOT%\Public\Common\Oak\Misc\Etkenv.bat | Unconditionally sets IMGNODEBUGGER to 1. |
These optional batch files allow further customization of the build process independent of the default settings in Wince.bat. Wince.batvalidates individual environment variables, but does not ensure that the combination of parameters matches.
Before modifying Wince.bat or the local batch files that are used by Wince.bat, for more information, see Environment Variables.
After the environment variables are set, Wince.bat creates the %_FLATRELEASEDIR% directory. Wince.bat then checks for the presence of certain .bif files in the %_FLATRELEASEDIR% directory that contain the current parameters of your Windows CE project.
The following table shows the .bif files and their location.
Build information file | Location |
---|---|
%_TGTPROJ%.bif | %_FLATRELEASEDIR% |
%_TGTPLAT%.bif | %_FLATRELEASEDIR% |
%_TGTCPU%.bif | %_FLATRELEASEDIR% |
%_TGTPROJ%.bif | Platform\%_TGTPLAT% |
If these .bif files are not present, Wince.bat creates the .bif files in the %_FLATRELEASEDIR% directory and continues setting the build environment.
If these .bif files exist, Wince.bat uses their presence as a flag to indicate that a %_FLATRELEASEDIR% directory exists.
Wince.bat checks that the current build variables, %_TGTCPU%, %_TGTPROJ%, and %_TGTPLAT%, are compatible with the current build process. If they are not compatible, Wince.bat displays a warning message and does not automatically copy build results to the %_FLATRELEASEDIR% directory.
wince [-h] [_TGTCPU] [_TGTPROJ] [_TGTPLAT] [PRIVATE_OPTIONS]
**Note **The parameters for wince are case sensitive.
Parameters
-h
Displays a Help file for Wince.bat._TGTCPU
The specific CPU that the build targets. The following list contains the valid parameters:ARM ARMV4I MIPS16 MIPSII MIPSII_FP MIPSIV MIPSIV_FP SH4 X86 NT NTANSI _TGTPROJ
The OS design directory name that the build uses._TGTPLAT
The board support package (BSP) that the OS design is based on and which the build process targets. Available BSPs on your development workstation are installed in the %_WINCEROOT%\Platform directory.The following list contains the valid parameters:
- NOPLAT
- <BSP_Name>
If set, NOPLAT causes the OS tree to be built without building the run-time image. This enables you to optimize the development process when you work with multiple BSPs that use the same CPU.
You build source code in the OS tree once, and then build only BSP-specific code by changing the target directory to the BSP directory you want and running build commands from a command-line prompt.
PRIVATE_OPTIONS
Any additional parameters are passed without interpretation to Setenv.bat.
Error Messages
This build window is incompatible with your current release directory. The WINCEREL variable is being forced off to prevent releasing any binaries automatically. You must do a "buildrel" to reinitialize the release directory for the current configuration.
If one type of binary is copied into the release directory and Wince.bat is run with parameters that are not compatible with the existing binaries, Wince.bat issues this error message and terminates the build process.
To have multiple active release directories, either modify Setenv.bat to assign a different directory to the %_FLATRELEASEDIR% environment variable or delete the existing directory, %_WINCEROOT%\Release.
Example
The following code example shows how to use Wince.bat to set up a project environment for a member of the x86 CPU family. The project directory is Myproj and is targeted for the CEPC hardware platform.
wince x86 MYPROJ CEPC
Remarks
Wince.bat sets many environment variables for the Windows CE build environment.
Before running Wince.bat, verify that the three input parameters have valid names and are presented in their correct order. The input parameters are case sensitive.
Run the command prompt build windows to verify that the environment variables are valid. Be sure that _WINCEROOT is set.
Run Wince.bat from a command prompt window that executes from %_WINCEROOT%\Public\Common\Oak\Misc.
See Also
Building a CEPC Run-Time Image for Use with an Ethernet Card | Building a Run-time Image Using the Build Demo Tool | Environment Variables | Set Environment Variable Tool
Send Feedback on this topic to the authors