Build Tool (Build.exe) (Compact 2013)

3/26/2014

The Windows Embedded Compact Build tool (Build.exe) builds the source code in a directory and in specified subdirectories

Syntax

build [options]

Parameters

  • -?
    Display a list of command-line options for Build.exe.
  • -A
    Display progress and informational messages in console output.
  • -c
    Perform a clean build. Delete all existing target files before building.
  • -clean
    Equivalent to -nmake clean.
  • -j Filename
    Specifies the name for the created log files.

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

  • -m
    Run Build.exe in the idle priority class.
  • -nmake Arg
    Invoke Nmake.exe with the specified arguments. For information on argument usage, see NMAKE Reference on MSDN.
  • -O
    Generate only an _Objects.mac (list of object targets) file.
  • -p
    Remove the message prefix from the console output.
  • -R
    Intended for internal use. Reuse _table.mac (macro list), do not call nmake clean, and then rebuild all targets regardless of dependencies.
  • -x includepath
    Exclude the specified path from the list of include directories that are scanned during analysis.
  • -y
    Enable verbose scanning information.
  • ~dirname
    Exclude all directories that use the specified name from the build.
  • @filename
    Specifies a text file that contains a list of additional source directories, using the format of one directory per line.

Error Messages

The following table lists error messages returned by Build.exe.

Error message

Description

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 Build.exe is running 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 that outlines your subdirectories in the current directory of your source code tree.
  • A sources file in each subdirectory specified in the dirs file.

Remarks

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.

The Build.exe file is in the <Installation Directory>\Public\Common\Oak\Bin\i386 directory.

Note

The Windows Embedded Compact Build tool differs significantly from the Build utility in the Windows Driver Kit (WDK). Several environment variables differ, as do many sources file entries.

Build.exe performs the following procedure 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, it 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 .exe, .dll, or static .lib file and places it in the applicable subdirectory of the %SG_OUTPUT_ROOT%\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%.

During the build process, Build.exe generates several log files in the root directory from 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.

In This Section

  • Dirs File
    A text file that you use to specify subdirectories that contain source code you want to build into a run-time image using Build.exe.
  • Makefile File
    A Makefile file specifies to Build.exe how to build source files.
  • Module-Definition File
    A text file which contains statements defining the public symbols, functions and variables that are exported from an executable file.
  • Sources File
    A text file that sets the macro definitions for the source code in a subproject's subdirectory.

See Also

Reference

Sysgen Tool (Sysgen.bat)

Other Resources

Build System Command Line Tools
Building a Run-Time Image That Supports Standalone Profiling