Windows CE Build Environment Tool

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 platform-dependent environment variables related to the platform. 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. See the environment variable descriptions, outlined in the "Environment Variables" section, before modifying Wince.bat or the local batch files that are used by Wince.bat.

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 built features 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 model that the build will target. The following list contains the valid parameters:

    • ARMV4
    • ARMV4T
    • ARMV4I
    • MIPS16
    • MIPSII
    • MIPSII_FP
    • MIPSIV
    • MIPSIV_FP
    • SH3
    • SH4
    • X86
    • NT
    • NTANSI
  • _TGTPROJ
    The project directory name that the build will use. You may define your own project setting.

  • _TGTPLAT
    The platform that the build will target. Currently, target device(s) are available and can be found in the %_WINCEROOT%\Platform\Cepc directory. You may define your own platform setting. The following list contains the valid parameters:

    • NOPLAT
    • DESKTOP
    • DESKTOP_SDK

    If set, NOPLAT causes the OS to be built without building the platform.

  • 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 development 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 OS Image for Use with an Ethernet Card | Building a Platform Using the Build Demo Tool | Environment Variables | Set Environment Variable Tool

 Last updated on Friday, October 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.