4.2 Build Process Overview

Prior to executing a build command, specific system environment variables must be initialized: WORKSPACE, EDK_TOOLS_PATH are required for all builds, while ECP_SOURCE, EFI_SOURCE and EDK_SOURCE are only required to build EDK II platforms that contain EDK components and EDK libraries. Additionally, the provided EDK II tool set must be present in a directory that is in the system environment variable: PATH. The edksetup scripts provided in the root directory of the EDK II development tree will set the WORKSPACE and EDK_TOOLS_PATH, as well as modify the system environment variable, PATH to ensure that the tools can execute. Refer to "Build Environment" for more information.

Command-line options to the build command will override values defined in meta-data files.

The EDK II Build Process is handled in three major stages:

  • Pre-build or AutoGen stage: parse meta-data files, UCS-2LE encoded files and VFR files to generate some C source code files and the Makefiles.

  • Build or $(MAKE) stage: process source code files to create PE32/PE32+/COFF images that are processed to EFI format using NMAKE (Microsoft operating system development platforms) or MAKE (for UNIX style operating system development platforms).

  • Post-build or ImageGen stage: takes the binary, EFI format files and creates EFI "FLASH" images, EFI update capsules, UEFI applications or PCI Option ROMs.

Figure 18 shows the relationship of these three stages.

Figure 18 EDK II Platform Build Process Flow

Note: In Figure 18, Meta-Data Files indicates build tool meta-data files: buildrule.txt, tools_def.txt, target.txt and the like.


The Build process is organized so that if a FLASH image file is not required, such as in generating a Binary Module that will be distributed to other end-users, stage three can be skipped. Drivers, Option ROM and/or UEFI applications can also be distributed in this fashion.


Note: The Nt32Pkg (Nt32Pkg/Nt32Pkg.dsc) emulation platform requires Windows header files. In order to include Windows header files, execute the edk2setup.bat utility with the --nt32 option. This option will detect the Microsoft Visual Studio installation and will execute it's setup command, for example, vsvars32.bat.