Поделиться через


Windows Embedded Compact Build Environment Tool (Wince.bat) (Compact 2013)

3/26/2014

Wince.bat prepares the development computer 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.

Syntax

wince [-h] [_TGTCPU] [_TGTPROJ] [_TGTPLAT] [PRIVATE_OPTIONS]

Parameters

  • -h
    Displays a Help file for Wince.bat.
  • _TGTCPU
    The specific CPU that the build targets, one of the following: ARMv7, x86.
  • _TGTPROJ
    Always set to "CEBase". Do not change the value of this environment variable.
  • _TGTPLAT
    The board support package (BSP) that the OS design is based on and which the build process targets. Available BSPs on your development computer are installed in the %_WINCEROOT%\Platform directory.

    The following list contains the valid parameters:

    • NOPLAT
    • <BSP_Name>. This name corresponds to a subdirectory of %_WINCEROOT%\platform\ that has the same 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 CEBase CEPC

Remarks

From command prompt windows 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.

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 project:

  • %_TGTCPU%
  • %_TGTPROJ%
  • %_TGTPLAT%

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.

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 Path

Description

Setenv.bat

Sets private environment variables for the build window. This must be in the %_WINCEROOT%\Developer\%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 computer drive for the Windows Embedded Compact project.

These batch files allow further customization of the build process independent of the default settings in Wince.bat. Wince.bat validates individual environment variables, but does not ensure that the combination of parameters matches.

See the section titled Environment Variables 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 Embedded Compact 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.

    [] [_TGTCPU] [_TGTPROJ] [_TGTPLAT] [PRIVATE_OPTIONS]

See Also

Reference

Set Environment Variable Tool (Setenv.bat)

Other Resources

Build System Command Line Tools