Build Tool (Windows Embedded CE 6.0)

1/5/2010

The Windows Embedded 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 Windows Embedded 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%.

Parameters

  • -?
    Displays a list of command-line options for Build.exe

    The Build.exe in the Public\Common\Oak\Bin\i386 directory in the directory where you installed the Windows Embedded CE OS.

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

  • -c
    Deletes all object files.
  • -C
    Deletes all .lib files, and then builds object .lib files and export .lib files in the current directory and the specified subdirectories.
  • -clean
    Executes -nmake clean.
  • -d
    Displays debug information.
  • -j Filename
    Uses the specified filename as the name for the log files that are created.

    For example, if MyLogFile is specified using this parameter, the log files MyLogFile.err, MyLogFile.wrn, and MyLogFile.log are created.

  • -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 + 1]
    Runs Build.exe on development workstations that have n microprocessors installed. For more information, see BUILD_MULTIPROCESSOR, located in Miscellaneous Environment Variables.

    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.

  • -nmake Arg
    Invokes Nmake.exe with Arg.
  • -O
    Generates an _Objects.mac file for the current directory.
  • -p
    Removes message prefix from console output.
  • -x includepath
    Excludes the specified path 'includepath' from the list of include directories that are scanned during analysis.
  • -y
    Enables verbose scanning information.
  • ~dirname
    Excludes all directories that use the name 'dirname' from the build.
  • @filename
    Specifies a text file 'filename' that contains a list of additional source directories using the format of one directory per line.

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.

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

Concepts

Build System Tools
Sysgen Tool

Other Resources

Building a Run-Time Image That Supports the Kernel Profiler