Name
Build.exe – the master command that provides the developer with a single command for selecting various options of a build
Synopsis
Build.exe [options] [target]
Description
Build.exe is the master command line (CLI) tool that provides the developer with a single command for selecting various options of a build.  In general, it checks the environment variables, gets the user’s configuration from either the CLI or target.txt, parses the dsc, dec, inf, target.txt, tools_def.txt, generates .C, .H files and the Makefiles for one or more modules and/or the active platform, calls a make (NMake or make) program to process these Makefiles, then optionally calls GenFds to generate an fd file.
The build tool supports two kinds of path specifications on command line - an absolutely path or a relative (to the WORKSPACE environment variable) path – in command line.
Options
There are no required options. 
-a, --arch <ARCH>
ARCH is one of list: IA32, X64, IPF or EBC,  which overrides target.txt's TARGET_ARCH  definition. To specify more ARCH, please  repeat this option.
-p, --platform PlatformName.dsc
Build the platform specified by the DSC file  name argument, overrides target.txt's  ACTIVE_PLATFORM definition.
-m, --module ModuleName.inf
Build the module specified by the INF file name argument.
-b, --buildtarget <TARGET>
TARGET is one of list: DEBUG, RELEASE,  which overrides target.txt's TARGET definition. To specify more TARGET, please repeat this option.
-t, --tagname Tagname
Using the Tool Chain Tagname to build the platform, overrides target.txt's TOOL_CHAIN_TAG definition.
-f --fdf Filename.fdf
The name of the FDF file to use, which overrides the setting in the DSC file.
-r --rom-image ROM_IMAGE_NAME
The name of FD to be generated. The name must be from [FD] section in FDF file.
-i --fv-image FV_IMAGE_NAME
The name of FV to be generated. The name must be from [FV] section in FDF file.
-n NUM
Build the platform using multi-threaded compiler. The value overrides target.txt's MULTIPLE_THREAD and MAX_CONCURRENT_THREAD_NUMBER. Less than 2 will disable multi-thread builds.
-x --sku-id SKU_ID
Using this name of SKU ID to build the platform, overriding SKUID_IDENTIFIER in DSC file.
-u --skip-autogen
Skip AutoGen step. Note the build may fail if there’s no AutoGen-ed files before.
-e --re-parse
Re-parse all meta-data files. Use this option if you encounter inconsistency issue.
-w --warning-as-error
Treat warning in tools as error.
-j --log LOGFILE
Put screen output in specified file.
-s –silent
Tell “make” tool to run “silently”. Internally, a ‘-s’ switch will be passed to “make” tool. Don’t use this option if your “make” tool doesn’t support ‘-s’. Instead, if your “make” tool uses other option to do the same, you could add it to the XX_XX_XX_MAKE_FLAGS in tools_def.txt.
-d, --debug [#]
Enable debug messages at specified level. It is used by Tool itself.
-q, --quiet
Disable all messages except FATAL ERRORS.
-v, --verbose
Turn on verbose output with informational messages printed.
--version
Show program's copyright and version number then exit.
-h, --help
Print the copyright, version and usage of this program then exit.
Target
If no target is given, then default target is ALL.
ALL           Build everything for either the platform or module.
GenC         Auto-generate all C files for either the platform or module.
GenMake     Generate the Makefiles – if auto-generated files are missing,
                    then auto-generate all C files first for either the platform or module.
Fds            Create the FD Image files.
Libraries      Build all EDK Libraries and EDK II Library Instances which are specified.
Modules       Build all EDK components and EDK II modules which are specified.
Clean         Remove intermediate files generated by the NMAKE command (leaving
                    the auto-generated C format, FD image files, PE32 output files, PCH 
                    files and LIB files).
CleanAll      Remove all intermmediate, auto-generated, FV and FD image files – 
                   state of the tree should be exactly as if a fresh checkout or install has 
                   occurred.
CleanLib     Remove intermediate files generated by the NMAKE command AND LIB 
                   files (leaving the auto-generated, FV and FD image files, PE32 output 
                   files and PCH files)
run           Run platform (for emulator platform only)

Examples
Assume that $(WORKSPACE) is C:\MyWorkspace
Build platform: Nt32Pkg.dsc
Specify the platform description file on the command line.
C:\MyWorkspace>build -p Nt32Pkg\Nt32Pkg.dsc –a IA32
Build the platform in the current working directory if it contains a platform description file.
C:\MyWorkspace\Nt32Pkg>build –a IA32
Build the active platform specified in the target.txt file.
C:\ MyWorkspace>build –a Ia32

Build Module: HelloWorld.inf
Specify the platform and Module on the command line.
C:\MyWorkspace>build -p Nt32Pkg\Nt32Pkg.dsc –a IA32 \
 –m MdeModulePkg/Application/HelloWorld/HelloWorld.inf
Specify the Module on the command line and use the active platform specified in the target.txt file.
C:\MyWorkspace>build –a IA32 \
–m MdeModulePkg/Application/HelloWorld/HelloWorld.inf
Build the module in the current working directory if it contains a module description file and specify the platform on the command line.
C:\ MyWorkspace\MdeModulePkg\Application\HelloWorld>build –a Ia32 \
–p Nt32Pkg\Nt32Pkg.dsc
Build the module in the current working directory and use the active platform specified in the target.txt file.
C:\ MyWorkspace\MdeModulePkg\Application\HelloWorld>build –a Ia32 
Bugs 
No known bugs.
Report bugs to issues@buildtools.tianocore.org
Files 
target.txt, tools_def.txt, platform.dsc, flashmap.fdf, package.dec and module.inf.
See also
GenFds.exe
License
Copyright (c)  1999-2009 Intel Corporation. All rights reserved.

This program and the accompanying materials are licensed and made available under the terms and
conditions of the BSD License which accompanies this distribution.  The full text of the license may be
found at:
http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES
OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.