Build Utility Command-Line Parameters

The Build command-line has the following syntax:

build [Switches] [Directories] 

Parameters

  • Switches
    Each switch must be preceded by either a slash ('/') or hyphen ('-') character. However, if you are specifying a sequence of switches that do not have arguments, you can use a single slash or hyphen and no spaces. For example, build /c /Z /g can be shortened to build /cZg.

    The following is a complete list of command-line switches for the Build utility.

    Switch Effect

    /#

    Force _objects.mac to be regenerated.

    /0

    Pass 0 generation only. The build process will not compile and link through Pass 1 and Pass 2.

    /2

    Only do a two-pass build -- skip Pass 0. The build process will compile and link through Pass 1 and Pass 2.

    /3

    Same as /Z.

    /a

    Enable synchronized blocks and drains during link pass.

    /b

    Display full error message text without truncating anything.

    /c

    Delete all object files.

    /C

    Delete all .lib files.

    /clean

    The same as /nmake clean.

    /D

    Check dependencies before building. Scans the source files, parses #include statements, checks the timestamps of header files, deletes out-of-date object files, and prevents running in directories that are up-to-date. Do not use with /Z.

    /DirInclude:[!]<type>[,<type>]

    The Build utility includes any directory decorated with a type specified by the <type> argument. If the exclamation point (!) is used, the Build utility excludes any directory decorated with a type specified by the <type> argument.

    Directories are decorated with one or more types in the Dirs file through either the DIRS or OPTIONAL_DIRS macros.

    Valid types are Product, Test, and Tool.

    /e

    Generate the log, error, and warning files. (For more information, see Using Log Files.)

    /E

    Always keep the log files.

    /F

    When displaying errors/warnings to stdout, print the full path.

    /g

    Uses colored text when displaying warnings, errors, and summary text.

    /G

    Enable target-specific Dirs files only if there is just one target.

    /i

    Ignore extraneous compiler warning messages.

    /I

    Do not display thread index when you perform a multiprocessor build.

    /jFilename

    Use Filename as the name for log files. Filename should not include the file name extension, although it may include a directory path. See Specifying the Location of Created Files for more information.

    /jpath Path

    Use Path as the directory for log files instead of using the current directory. See Specifying the Location of Created Files for more information.

    /k

    Keep out-of-date targets instead of deleting them.

    /l

    Link only. Do not perform any compilation.

    /L

    Compile only. Do not perform any linking.

    /M [Threads]

    Multiprocessor build. Without Threads, the /M switch causes Build to start one thread for each processor. If Threads is present, it specifies the exact number of threads to start. When /M is used without Threads on a single-processor computer. It has no effect.

    /m

    Background mode. Run the Build utility in the idle priority class.

    /nmake Arg

    Specifies the argument to pass to the NMAKE utility.

    /o

    Display out-of-date files.

    /O

    Generate obj\_objects.mac file for current directory.

    /p

    Pause before compile and link phases.

    /P

    Print elapsed time after every directory.

    /q

    Query only; do not run the NMAKE utility.

    /r Path

    Restarts a clean build at the specified path.

    /s

    Display a status line at the top of the display.

    /S

    Display a status line with header file line counts.

    /t

    Display the first level of the dependency tree.

    /T

    Display the complete dependency tree.

    /u

    Display all unused BUILD_OPTIONS.

    /$

    Display the complete dependency tree hierarchically.

    /v

    Enable header file version checking.

    /w

    Display warnings on screen.

    /why

    List reasons for building targets.

    /x Filename

    Excludes the specified header file from dependency checks.

    /y

    Displays all files scanned.

    /Z or /z

    Prevents dependency checking or scanning of source files. Compiles and links. Do not use with /D.

    /x86

    Build targets for the x86 architecture.

    /386

    Same as /x86.

    /ia64

    Build targets for the Itanium architecture.

    /amd64

    Build targets for the x64-based architecture.

    /arm

    Build targets for processors that use the ARM architecture. This processor is not supported by the Windows Driver Kit (WDK).

    /all

    Same as /x86 /ia64 /amd64 /arm.

    /?

    Display help text with a list of all command-line switches.

     

  • Directories
    This parameter is not preceded by a hyphen and is used to control the build of additional directories. One or more Directories parameters may be specified.

    This parameter uses the arguments shown in the following table.

    Argument Effect

    *

    Build all optional source directories that are specified by the OPTIONAL_DIRS macro, which is specified within the Dirs file.

    ~[DirName]

    Specify directories that are not to be built. All directories matching DirName will be excluded from the build. In addition, these directories must be listed in the Dirs file.

    ![Relative path\\DirName]

    Exclude only the specified directory from the build. The path given is relative to where the Build utility is started.

     

 

 

Send comments about this topic to Microsoft

Build date: 5/3/2011