Compartilhar via


Build Tool (Windows CE 5.0)

Send Feedback

The Windows CE Build tool (Build.exe) builds the source code in a directory and in specified subdirectories. Build.exe uses dirs and sources files to determine the following:

  • Which directories to traverse

  • Which C-language and Microsoft Visual C++® source files to compile

  • What type of binary file to build

    **Note   **The Microsoft® Windows CE Build tool differs significantly from the Build utility in the Microsoft Windows NT® 4.0 Device Driver Kit (DDK). Several environment variables differ, as do many sources file entries.

Build.exe performs the following procedures in each directory it runs:

  1. Build.exe looks for a dirs file in the current directory; then, if the dirs file exists, the file directs Build.exe to additional subdirectories that contain source code or additional dirs files.

  2. If there is no dirs file in the current directory, Build.exe searches for a sources file.

    The sources file contains a list of C or C++ source files to compile, and the type of executable file to build, if any.

  3. If Build.exe finds a sources file in the current directory, Build.exe calls the Microsoft Program Maintenance Utility (Nmake.exe), also known as the Nmake tool, to compile the specified C or C++ sources files or to link an object module.

    When successful, Build.exe completes a binary executable file (.exe), dynamic-link library file (.dll), or static Common Object File Format file (.lib) and places it in the applicable subdirectory of the %PROJECTOAKROOT% directory.

    The %PROJECTOAKROOT% directory is equivalent to the %_PROJECTROOT%\Oak directory. In general, you can build only one binary file in a subdirectory, either a .lib, .exe, or.dll file.

    The following table shows the subdirectory where Build.exe places completed binary files.

    File type Subdirectory
    .exe, .dll Target\%_TGTCPU%\%WINCEDEBUG%.

    If the environment variable WINCEREL is defined, the .exe or .dll file is also copied to the %_FLATRELEASEDIR% directory.

    .lib Lib\%_TGTCPU%\%WINCEDEBUG%.
build [Parameters]

Parameters

  • -?
    Displays a list of command-line options for Build.exe, in the Public\Common\Oak\Bin\i386 directory in the directory where you installed the Windows CE OS.

    This list is displayed when the current directory contains buildable content.

  • -b
    Displays the full text of error messages.

  • -c
    Deletes all object files.

  • -C
    Deletes all .lib object files.

  • -clean
    Executes -nmake clean.

  • -d
    Displays debug information.

  • -e
    Generates Build.log, Build.wrn, and Build.err files in which Build.exe stores messages produced during the build process.

  • -E
    Keeps the Build.log, Build.wrn, and Build.err files (use with -z).

  • -F
    Prints the full path when displaying errors and warnings to stdout.

  • -i
    Ignores compiler warning messages.

  • -jFile
    Uses File as the name for log files.

  • -k
    Keeps out-of-date targets.

  • -l
    Runs a link pass only; does not compile.

  • -L
    Runs a compile pass only; does not link.

  • -m
    Runs Build.exe in the idle priority class.

  • -M [n]
    Runs Build.exe on n microprocessors (for multiprocessor computers).

    If the dirs and sources files in your OS design have dependencies, this can cause synchronization issues. For more information, see SYNCHRONIZE_DRAIN and SYNCHRONIZE_BLOCK.

  • -nmakeArg
    Invokes Nmake.exe with Arg.

  • -o
    Displays out-of-date files.

  • -O
    Generates an _Objects.mac file for the current directory.

  • -p
    Pauses before compile and link phases.

  • -P
    Prints the elapsed time after every directory.

  • -q
    Queries dependencies only; does not run Nmake.exe.

  • -rDirectory
    Restarts a clean build at Directory.**

  • -s
    Displays a status line at the top of the command window.

  • -S
    Displays a status line with include file line counts.

  • -t
    Displays the first level of the dependency tree.

  • -T
    Displays the dependency tree.

  • -$
    Displays the dependency tree hierarchically.

  • -u
    Displays unused BUILD_OPTIONS.

  • -v
    Enables include-file version checking.

  • -w
    Shows warnings on screen.

  • -why
    Lists reasons for building targets.

  • -xFile
    Excludes the include file from dependency checks.

  • -y
    Shows files that are scanned.

  • -z
    Does not check dependencies of or scan source files — one-pass compile and link.

  • -Z
    Does not check dependencies of or scan source files — two-pass compile and link.

  • Other
    Specifies additional source directories.

Error Messages

  • No _TGTCPU environment variable set

  • No _TGTCPUFAMILY environment variable set

  • Unknown _TGTCPU variable

    The environment variables %_TGTCPU% or %_TGTCPUFAMILY%, which are normally set by Wince.bat, were not set. This error generally occurs if you did not use Wince.bat to start the command prompt build window for your OS design.

  • Error finding topmost directory containing dirs file

    The current directory in which you run Build.exe does not contain a dirs file or a sources file. Build.exe cannot determine which code directories to build. To troubleshoot, be sure you have the following:

    • A dirs file, outlining your subdirectories, in the current directory of your source code tree.
    • A sources file in each subdirectory specified in the dirs file.

Example

The following code example shows how to use Build.exe to perform a clean build that forces a rescan of all source and include files.

build -cfs

Remarks

During the build process, Build.exe generates several log files in the root directory where it was called.

The following table shows the log files and their contents.

Log file Description
Build.log Contains a log of commands invoked by Nmake.exe.
Build.wrn Contains a list of warnings generated during the build process.
Build.err Contains a list of errors generated during the build process.

**Note   **Build.exe reports some compiler and linker warnings only in the Build.wrn file. Do not expect all warnings to be returned as messages in the command prompt build window.

See Also

Building a Run-Time Image That Supports the Kernel Profiler | Sysgen Tool

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.