]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Sample/Platform/Common.dsc
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Sample / Platform / Common.dsc
diff --git a/EdkCompatibilityPkg/Sample/Platform/Common.dsc b/EdkCompatibilityPkg/Sample/Platform/Common.dsc
new file mode 100644 (file)
index 0000000..c40c4e7
--- /dev/null
@@ -0,0 +1,1522 @@
+#/*++\r
+#\r
+# Copyright (c) 2004 - 2007, Intel Corporation                                                         \r
+# All rights reserved. This program and the accompanying materials                          \r
+# are licensed and made available under the terms and conditions of the BSD License         \r
+# which accompanies this distribution.  The full text of the license may be found at        \r
+# http://opensource.org/licenses/bsd-license.php                                            \r
+#                                                                                           \r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+# \r
+#  Module Name:\r
+#\r
+#    Common.dsc\r
+#\r
+#  Abstract:\r
+#\r
+#    This is the build description file containing the platform\r
+#    independent build instructions.  Platform specific instructions will\r
+#    be prepended to produce the final build DSC file.\r
+#\r
+#\r
+#  Notes:\r
+#    \r
+#    The info in this file is broken down into sections. The start of a section\r
+#    is designated by a "[" in the first column. So the [=====] separater ends\r
+#    a section.\r
+#    \r
+#--*/\r
+\r
+[=============================================================================]\r
+#\r
+# These get emitted at the top of the generated master makefile. \r
+#\r
+[=============================================================================]\r
+[Makefile.out]\r
+#\r
+# From the [makefile.out] section of the DSC file\r
+#\r
+TOOLCHAIN = \r
+MAKE      = nmake -nologo\r
+\r
+!INCLUDE $(BUILD_DIR)\PlatformTools.env\r
+\r
+all : libraries fvs\r
+\r
+[=============================================================================]\r
+#\r
+# These get expanded and dumped out to each component makefile after the\r
+# component INF [defines] section gets parsed.\r
+#\r
+[=============================================================================]\r
+[Makefile.Common]\r
+#\r
+# From the [Makefile.Common] section of the description file.\r
+#\r
+PROCESSOR        = $(PROCESSOR)\r
+BASE_NAME        = $(BASE_NAME)\r
+BUILD_NUMBER     = $(BUILD_NUMBER)\r
+VERSION_STRING   = $(VERSION_STRING)\r
+TOOLCHAIN        = TOOLCHAIN_$(PROCESSOR)\r
+FILE_GUID        = $(FILE_GUID)\r
+COMPONENT_TYPE   = $(COMPONENT_TYPE)\r
+FV_DIR           = $(BUILD_DIR)\FV\r
+PLATFORM         = $(PROJECT_NAME) \r
+\r
+#\r
+# Define the global dependency files\r
+#\r
+!IF EXIST ($(DEST_DIR)\$(BASE_NAME)StrDefs.h)\r
+INC_DEPS         = $(INC_DEPS) $(DEST_DIR)\$(BASE_NAME)StrDefs.h\r
+!ENDIF\r
+#ENV_DEPS         = $(ENV_DEPS) $(EDK_SOURCE)\Sample\CommonTools.env\r
+#ENV_DEPS         = $(ENV_DEPS) $(BUILD_DIR)\PlatformTools.env\r
+#ENV_DEPS         = $(ENV_DEPS) $(BUILD_DIR)\Config.env\r
+ALL_DEPS         = $(INC_DEPS) $(ENV_DEPS)\r
+\r
+!IF "$(LANGUAGE)" != ""\r
+LANGUAGE_FLAGS    = -lang $(LANGUAGE)\r
+!ENDIF\r
+\r
+!INCLUDE $(BUILD_DIR)\PlatformTools.env\r
+\r
+!IF "$(COMPONENT_TYPE)" == "PIC_PEIM" || "$(COMPONENT_TYPE)" == "PE32_PEIM" || "$(COMPONENT_TYPE)" == "RELOCATABLE_PEIM" || "$(COMPONENT_TYPE)" == "COMBINED_PEIM_DRIVER"\r
+DEPEX_TYPE = EFI_SECTION_PEI_DEPEX\r
+!ELSE\r
+DEPEX_TYPE = EFI_SECTION_DXE_DEPEX\r
+!ENDIF\r
+\r
+#\r
+# Command flags for MAKEDEPS tool\r
+#\r
+DEP_FLAGS = -target $** -o $(DEP_FILE) $(INC) -ignorenotfound -q\r
+\r
+[=============================================================================]\r
+#\r
+# These are the commands to compile source files. One of these blocks gets \r
+# emitted to the component's makefile for each source file. The section\r
+# name is encoded as [Compile.$(PROCESSOR).source_filename_extension], where\r
+# the source filename comes from the sources section of the component INF file.\r
+#\r
+# If the dependency list file already exists, then include it for this \r
+# source file. If it doesn't exist, then this is a clean build and the\r
+# dependency file will get created below and the source file will get \r
+# compiled. \r
+#\r
+# Current behavior is that the first clean build will not create dep files. \r
+# But the following second build has to create dep files before build source files.\r
+# CREATEDEPS flag is used to judge whether current build is the second build or not.\r
+#\r
+#\r
+[=============================================================================]\r
+[Compile.Ia32.asm,Compile.x64.asm]\r
+\r
+DEP_FILE    = $(DEST_DIR)\$(FILE)Asm.dep\r
+\r
+!IF EXIST($(DEST_DIR)\$(FILE).obj)\r
+DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Asm.dep\r
+!IF !EXIST($(DEP_FILE))\r
+CREATEDEPS = YES\r
+!ENDIF\r
+!ENDIF\r
+\r
+!IF EXIST($(DEP_FILE))\r
+!INCLUDE $(DEP_FILE)\r
+!ENDIF\r
+\r
+#\r
+# Update dep file for next round incremental build\r
+#\r
+$(DEP_FILE) : $(DEST_DIR)\$(FILE).obj\r
+  $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS) -asm\r
+\r
+#\r
+# Compile the file\r
+#\r
+$(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)\r
+  $(ASM) $(ASM_FLAGS) $(SOURCE_FILE_NAME)\r
+\r
+[=============================================================================]\r
+[Compile.Ipf.s]\r
+\r
+DEP_FILE    = $(DEST_DIR)\$(FILE)S.dep\r
+\r
+!IF EXIST($(DEST_DIR)\$(FILE).pro)\r
+DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)S.dep\r
+!IF !EXIST($(DEP_FILE))\r
+CREATEDEPS = YES\r
+!ENDIF\r
+!ENDIF\r
+\r
+!IF EXIST($(DEP_FILE))\r
+!INCLUDE $(DEP_FILE)\r
+!ENDIF\r
+\r
+#\r
+# Update dep file for next round incremental build\r
+#\r
+$(DEP_FILE) : $(DEST_DIR)\$(FILE).pro\r
+  $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)\r
+\r
+#\r
+# Compile the file\r
+#\r
+$(DEST_DIR)\$(FILE).pro : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)\r
+  $(CC) $(C_FLAGS_PRO) $(SOURCE_FILE_NAME) > $@\r
+\r
+$(DEST_DIR)\$(FILE).obj : $(DEST_DIR)\$(FILE).pro\r
+  $(ASM) $(ASM_FLAGS) $(DEST_DIR)\$(FILE).pro\r
+\r
+[=============================================================================]\r
+[Compile.Ia32.c,Compile.Ipf.c,Compile.x64.c]\r
+\r
+DEP_FILE    = $(DEST_DIR)\$(FILE).dep\r
+\r
+!IF EXIST($(DEST_DIR)\$(FILE).obj)\r
+DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE).dep\r
+!IF !EXIST($(DEP_FILE))\r
+CREATEDEPS = YES\r
+!ENDIF\r
+!ENDIF\r
+\r
+!IF EXIST($(DEP_FILE))\r
+!INCLUDE $(DEP_FILE)\r
+!ENDIF\r
+\r
+#\r
+# Update dep file for next round incremental build\r
+#\r
+$(DEP_FILE) : $(DEST_DIR)\$(FILE).obj\r
+  $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)\r
+\r
+#\r
+# Compile the file\r
+#\r
+$(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)\r
+  $(CC) $(C_FLAGS) $(SOURCE_FILE_NAME)\r
+\r
+[=============================================================================]\r
+[Compile.Ebc.c]\r
+\r
+DEP_FILE    = $(DEST_DIR)\$(FILE).dep\r
+\r
+!IF EXIST($(DEST_DIR)\$(FILE).obj)\r
+DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE).dep\r
+!IF !EXIST($(DEP_FILE))\r
+CREATEDEPS = YES\r
+!ENDIF\r
+!ENDIF\r
+\r
+!IF EXIST($(DEP_FILE))\r
+!INCLUDE $(DEP_FILE)\r
+!ENDIF\r
+\r
+#\r
+# Update dep file for next round incremental build\r
+#\r
+$(DEP_FILE) : $(DEST_DIR)\$(FILE).obj\r
+  $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)\r
+\r
+#\r
+# Compile the file\r
+#\r
+$(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)\r
+  $(EBC_CC) $(EBC_C_FLAGS) $(SOURCE_FILE_NAME)\r
+\r
+[=============================================================================]\r
+#\r
+# Commands for compiling a ".apr" Apriori source file.\r
+#\r
+[=============================================================================]\r
+[Compile.Ia32.Apr,Compile.Ipf.Apr,Compile.Ebc.Apr,Compile.x64.Apr]\r
+#\r
+# Create the raw binary file. If you get an error on the build saying it doesn't\r
+# know how to create the .apr file, then you're missing (or mispelled) the\r
+# "APRIORI=" on the component lines in components section in the DSC file.\r
+#\r
+$(DEST_DIR)\$(BASE_NAME).bin : $(SOURCE_FILE_NAME)\r
+  $(GENAPRIORI) -v -f $(SOURCE_FILE_NAME) -o $(DEST_DIR)\$(BASE_NAME).bin\r
+\r
+$(DEST_DIR)\$(BASE_NAME).sec : $(DEST_DIR)\$(BASE_NAME).bin\r
+  $(GENSECTION) -I $(DEST_DIR)\$(BASE_NAME).bin -O $(DEST_DIR)\$(BASE_NAME).sec -S EFI_SECTION_RAW\r
+\r
+[=============================================================================]\r
+[Build.Ia32.Apriori,Build.Ipf.Apriori,Build.Ebc.Apriori,Build.x64.Apriori]\r
+\r
+all : $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).FFS\r
+\r
+#\r
+# Run GenFfsFile on the package file and .raw file to create the firmware file\r
+#\r
+$(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).FFS : $(DEST_DIR)\$(BASE_NAME).sec $(PACKAGE_FILENAME)\r
+  $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V\r
+\r
+#\r
+# Remove the generated temp and final files for this modules.\r
+#\r
+clean :\r
+!IF ("$(FILE_GUID)" != "")\r
+  @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
+!ENDIF\r
+  @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
+  @del /q $(DEST_OUTPUT_DIRS) \r
+\r
+[=============================================================================]\r
+[Build.Ia32.Makefile,Build.Ipf.Makefile,Build.Ebc.Makefile,Build.x64.Makefile]\r
+\r
+#\r
+# Copy the makefile directly from the source directory, then make it\r
+# writable so we can copy over it later if we try to.\r
+#\r
+$(DEST_DIR)\makefile.new : $(SOURCE_DIR)\makefile.new\r
+  copy $(SOURCE_DIR)\makefile.new $(DEST_DIR)\makefile.new\r
+  attrib -r $(DEST_DIR)\makefile.new\r
+\r
+#\r
+# Make the all target, set some required macros.\r
+#\r
+call_makefile :\r
+  $(MAKE) -f $(DEST_DIR)\makefile.new all   \\r
+          SOURCE_DIR=$(SOURCE_DIR)          \\r
+          BUILD_DIR=$(BUILD_DIR)            \\r
+          FILE_GUID=$(FILE_GUID)            \\r
+          DEST_DIR=$(DEST_DIR)              \\r
+          PROCESSOR=$(PROCESSOR)            \\r
+          TOOLCHAIN=TOOLCHAIN_$(PROCESSOR)  \\r
+          BASE_NAME=$(BASE_NAME)            \\r
+          PACKAGE_FILENAME=$(PACKAGE_FILENAME)\r
+\r
+all : $(DEST_DIR)\makefile.new call_makefile\r
+\r
+#\r
+# Remove the generated temp and final files for this modules.\r
+#\r
+clean :\r
+  @- $(MAKE) -f $(DEST_DIR)\makefile.new clean > NUL 2>&1\r
+!IF ("$(FILE_GUID)" != "")\r
+  @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
+!ENDIF\r
+  @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
+  @del /q $(DEST_OUTPUT_DIRS) \r
+\r
+[=============================================================================]\r
+#\r
+# Instructions for building a component that uses a custom makefile. Encoding \r
+# is [build.$(PROCESSOR).$(BUILD_TYPE)].\r
+#\r
+# To build these components, simply call the makefile from the source \r
+# directory.\r
+#\r
+[=============================================================================]\r
+[Build.Ia32.Custom_Makefile,Build.Ipf.Custom_Makefile,Build.Ebc.Custom_Makefile,Build.x64.Custom_Makefile]\r
+\r
+#\r
+# Just call the makefile from the source directory, passing in some\r
+# useful info.\r
+#\r
+all : \r
+  $(MAKE) -f $(SOURCE_DIR)\makefile all    \\r
+          SOURCE_DIR=$(SOURCE_DIR)         \\r
+          BUILD_DIR=$(BUILD_DIR)           \\r
+          DEST_DIR=$(DEST_DIR)             \\r
+          FILE_GUID=$(FILE_GUID)           \\r
+          PROCESSOR=$(PROCESSOR)           \\r
+          TOOLCHAIN=TOOLCHAIN_$(PROCESSOR) \\r
+          BASE_NAME=$(BASE_NAME)           \\r
+          PLATFORM=$(PLATFORM)             \\r
+          SOURCE_FV=$(SOURCE_FV)           \\r
+          PACKAGE_FILENAME=$(PACKAGE_FILENAME)\r
+\r
+#\r
+# Remove the generated temp and final files for this modules.\r
+#\r
+clean :\r
+  @- $(MAKE) -f $(SOURCE_DIR)\makefile clean > NUL 2>&1\r
+!IF ("$(FILE_GUID)" != "")\r
+  @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
+!ENDIF\r
+  @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
+  @del /q $(DEST_OUTPUT_DIRS) \r
+\r
+[=============================================================================]\r
+#\r
+# These commands are used to build libraries\r
+#\r
+[=============================================================================]\r
+[Build.Ia32.LIBRARY,Build.Ipf.LIBRARY,Build.x64.LIBRARY]\r
+#\r
+# LIB all the object files into to our target lib file. Put\r
+# a dependency on the component's INF file in case it changes.\r
+#\r
+LIB_NAME = $(LIB_DIR)\$(BASE_NAME).lib\r
+\r
+$(LIB_NAME) : $(OBJECTS) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)\r
+  $(LIB) $(LIB_FLAGS) $(OBJECTS) $(LIBS) /OUT:$@\r
+\r
+!IF "$(CREATEDEPS)"=="YES"\r
+all : $(DEP_TARGETS)\r
+  $(MAKE) -f $(MAKEFILE_NAME) all\r
+!ELSE\r
+all : $(LIB_NAME) $(DEP_TARGETS)\r
+!ENDIF\r
+\r
+#\r
+# Remove the generated temp and final files for this modules.\r
+#\r
+clean :\r
+!IF ("$(FILE_GUID)" != "")\r
+  @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
+!ENDIF\r
+  @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
+  @del /q $(DEST_OUTPUT_DIRS) \r
+\r
+[=============================================================================]\r
+[Build.Ebc.LIBRARY]\r
+#\r
+# LIB all the object files into to our target lib file. Put\r
+# a dependency on the component's INF file in case it changes.\r
+#\r
+LIB_NAME = $(LIB_DIR)\$(BASE_NAME).lib\r
+\r
+$(LIB_NAME) : $(OBJECTS) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)\r
+   $(EBC_LIB) $(EBC_LIB_FLAGS) $(OBJECTS) $(LIBS) /OUT:$@\r
+\r
+!IF "$(CREATEDEPS)"=="YES"\r
+all : $(DEP_TARGETS)\r
+  $(MAKE) -f $(MAKEFILE_NAME) all\r
+!ELSE\r
+all : $(LIB_NAME) $(DEP_TARGETS)\r
+!ENDIF\r
+\r
+#\r
+# Remove the generated temp and final files for this modules.\r
+#\r
+clean :\r
+!IF ("$(FILE_GUID)" != "")\r
+  @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
+!ENDIF\r
+  @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
+  @del /q $(DEST_OUTPUT_DIRS) \r
+\r
+[=============================================================================]\r
+#\r
+# This is the Build.$(PROCESSOR).$(COMPONENT_TYPE) section that tells how to\r
+# convert a firmware volume into an FV FFS file. Simply run it through\r
+# GenFfsFile with the appropriate package file. SOURCE_FV must be defined\r
+# in the component INF file Defines section.\r
+#\r
+[=============================================================================]\r
+[Build.Ia32.FvImageFile,Build.x64.FvImageFile,Build.Ipf.FvImageFile]\r
+\r
+all : $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).Fvi\r
+\r
+#\r
+# Run GenFfsFile on the package file and FV file to create the firmware \r
+# volume FFS file. This FFS file maybe contain one pad section for alignment requirement.\r
+#\r
+$(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).Fvi : $(DEST_DIR)\$(SOURCE_FV)Fv.sec $(PACKAGE_FILENAME) $(PAD_SECTION) \r
+  $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V\r
+\r
+#\r
+# Remove the generated temp and final files for this modules.\r
+#\r
+clean :\r
+!IF ("$(FILE_GUID)" != "")\r
+  @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
+!ENDIF\r
+  @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
+  @del /q $(DEST_OUTPUT_DIRS) \r
+\r
+[=============================================================================]\r
+#\r
+# Since many of the steps are the same for the different component types, we \r
+# share this section for BS_DRIVER, RT_DRIVER, .... and IFDEF the parts that \r
+# differ.  The entire section gets dumped to the output makefile.\r
+#\r
+[=============================================================================]\r
+[Build.Ia32.BS_DRIVER|RT_DRIVER|SAL_RT_DRIVER|PE32_PEIM|PEI_CORE|PIC_PEIM|RELOCATABLE_PEIM|DXE_CORE|APPLICATION|COMBINED_PEIM_DRIVER, Build.Ipf.BS_DRIVER|RT_DRIVER|SAL_RT_DRIVER|PEI_CORE|PE32_PEIM|PIC_PEIM|DXE_CORE|APPLICATION|COMBINED_PEIM_DRIVER, Build.x64.BS_DRIVER|RT_DRIVER|SAL_RT_DRIVER|PE32_PEIM|PEI_CORE|PIC_PEIM|RELOCATABLE_PEIM|DXE_CORE|APPLICATION|COMBINED_PEIM_DRIVER]\r
+\r
+!IF "$(LOCALIZE)" == "YES"\r
+\r
+!IF "$(EFI_GENERATE_HII_EXPORT)" == "YES"\r
+STRGATHER_FLAGS   = $(STRGATHER_FLAGS) -hpk $(DEST_DIR)\$(BASE_NAME)Strings.hpk\r
+\r
+#\r
+# There will be one HII pack containing all the strings. Add that file\r
+# to the list of HII pack files we'll use to create our final HII export file.\r
+#\r
+HII_PACK_FILES    = $(HII_PACK_FILES) $(DEST_DIR)\$(BASE_NAME)Strings.hpk\r
+LOCALIZE_TARGETS  = $(LOCALIZE_TARGETS) $(DEST_DIR)\$(BASE_NAME).hii\r
+!ENDIF\r
+\r
+$(DEST_DIR)\$(BASE_NAME).sdb : $(SDB_FILES) $(SOURCE_FILES)\r
+  $(STRGATHER) -scan -vdbr $(STRGATHER_FLAGS) -od $(DEST_DIR)\$(BASE_NAME).sdb \\r
+    -skipext .uni -skipext .h $(SOURCE_FILES)\r
+\r
+$(DEST_DIR)\$(BASE_NAME)Strings.c : $(DEST_DIR)\$(BASE_NAME).sdb\r
+  $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \\r
+    -oc $(DEST_DIR)\$(BASE_NAME)Strings.c\r
+\r
+$(DEST_DIR)\$(BASE_NAME)StrDefs.h : $(DEST_DIR)\$(BASE_NAME).sdb\r
+  $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \\r
+    -oh $(DEST_DIR)\$(BASE_NAME)StrDefs.h\r
+\r
+$(DEST_DIR)\$(BASE_NAME)Strings.hpk : $(DEST_DIR)\$(BASE_NAME).sdb\r
+  $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \\r
+    -hpk $(DEST_DIR)\$(BASE_NAME)Strings.hpk\r
+\r
+OBJECTS = $(OBJECTS) $(DEST_DIR)\$(BASE_NAME)Strings.obj\r
+\r
+$(DEST_DIR)\$(BASE_NAME)Strings.obj : $(DEST_DIR)\$(BASE_NAME)Strings.c $(INF_FILENAME) $(ALL_DEPS)\r
+  $(CC) $(C_FLAGS) $(DEST_DIR)\$(BASE_NAME)Strings.c\r
+\r
+LOCALIZE_TARGETS = $(LOCALIZE_TARGETS) $(DEST_DIR)\$(BASE_NAME)StrDefs.h\r
+\r
+!ENDIF\r
+\r
+#\r
+# If we have any objects associated with this component, then we're\r
+# going to build a local library from them.\r
+#\r
+!IFNDEF OBJECTS\r
+!ERROR No source files to build were defined in the INF file\r
+!ENDIF\r
+\r
+TARGET_LOCAL_LIB  = $(DEST_DIR)\$(BASE_NAME)Local.lib\r
+\r
+#\r
+# LIB all the object files into our (local) target lib file. Put\r
+# a dependency on the component's INF file in case it changes.\r
+#\r
+$(TARGET_LOCAL_LIB) : $(OBJECTS)  $(INF_FILENAME) $(ENV_DEPS)\r
+  $(LIB) $(LIB_FLAGS) $(OBJECTS) /OUT:$@\r
+\r
+#\r
+# Defines for standard intermediate files and build targets\r
+#\r
+TARGET_DLL      = $(BIN_DIR)\$(BASE_NAME).dll\r
+TARGET_EFI      = $(BIN_DIR)\$(BASE_NAME).efi\r
+TARGET_DPX      = $(DEST_DIR)\$(BASE_NAME).dpx\r
+TARGET_UI       = $(DEST_DIR)\$(BASE_NAME).ui\r
+TARGET_VER      = $(DEST_DIR)\$(BASE_NAME).ver\r
+TARGET_MAP      = $(BIN_DIR)\$(BASE_NAME).map\r
+TARGET_PDB      = $(BIN_DIR)\$(BASE_NAME).pdb\r
+TARGET_SYM      = $(BIN_DIR)\$(BASE_NAME).sym\r
+\r
+#\r
+# Target executable section extension depends on the component type.\r
+# Only define "TARGET_DXE_DPX" if it's a combined peim driver.\r
+#\r
+!IF "$(COMPONENT_TYPE)" == "PIC_PEIM"\r
+TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pic\r
+!ELSE\r
+TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pe32\r
+!ENDIF\r
+\r
+#\r
+# Target FFS file extension depends on the component type\r
+# Also define "TARGET_DXE_DPX" if it's a combined PEIM driver.\r
+#\r
+SUBSYSTEM = EFI_BOOT_SERVICE_DRIVER\r
+\r
+!IF "$(COMPONENT_TYPE)" == "APPLICATION"\r
+TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).app\r
+SUBSYSTEM       = EFI_APPLICATION\r
+!ELSE IF "$(COMPONENT_TYPE)" == "PEI_CORE"\r
+TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei\r
+!ELSE IF "$(COMPONENT_TYPE)" == "PE32_PEIM"\r
+TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei\r
+!ELSE IF "$(COMPONENT_TYPE)" == "RELOCATABLE_PEIM"\r
+TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei\r
+!ELSE IF "$(COMPONENT_TYPE)" == "PIC_PEIM"\r
+TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei\r
+!ELSE IF "$(COMPONENT_TYPE)" == "COMBINED_PEIM_DRIVER"\r
+TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei\r
+TARGET_DXE_DPX  = $(DEST_DIR)\$(BASE_NAME).dpxd\r
+!ELSE\r
+TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).dxe\r
+!ENDIF\r
+\r
+#\r
+# Different methods to build section based on if PIC_PEIM\r
+#\r
+!IF "$(COMPONENT_TYPE)" == "PIC_PEIM"\r
+\r
+$(TARGET_PE32) : $(TARGET_DLL)\r
+  $(PE2BIN) $(TARGET_DLL) $(DEST_DIR)\$(BASE_NAME).TMP\r
+#\r
+# BUGBUG: Build PEIM header, needs to go away with new PEI.\r
+#\r
+  $(TEMPGENSECTION) -P $(SOURCE_DIR)\$(BASE_NAME).INF -I $(DEST_DIR)\$(BASE_NAME).TMP -O $(TARGET_PIC_PEI).tmp -M $(TARGET_MAP) -S EFI_SECTION_TYPE_NO_HEADER\r
+  $(GENSECTION) -I $(TARGET_PIC_PEI).tmp -O $(TARGET_PE32) -S EFI_SECTION_PIC\r
+  del $(DEST_DIR)\$(BASE_NAME).TMP\r
+\r
+!ELSE\r
+\r
+$(TARGET_PE32) : $(TARGET_EFI)\r
+  $(GENSECTION) -I $(TARGET_EFI) -O $(TARGET_PE32) -S EFI_SECTION_PE32\r
+\r
+#\r
+# Run FWImage on the DLL to set it as an EFI image type.\r
+#\r
+$(TARGET_EFI) : $(TARGET_DLL) $(INF_FILENAME)\r
+  $(FWIMAGE) -t 0 $(COMPONENT_TYPE) $(TARGET_DLL) $(TARGET_EFI)\r
+\r
+!ENDIF\r
+\r
+#\r
+# Link all objects and libs to create the executable\r
+#\r
+$(TARGET_DLL) : $(TARGET_LOCAL_LIB) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)\r
+  $(LINK) $(LINK_FLAGS_DLL) $(LIBS) /ENTRY:$(IMAGE_ENTRY_POINT) \\r
+     $(TARGET_LOCAL_LIB) /OUT:$(TARGET_DLL) /MAP:$(TARGET_MAP) \\r
+     /PDB:$(TARGET_PDB) \r
+  $(SETSTAMP) $(TARGET_DLL) $(BUILD_DIR)\GenStamp.txt\r
+!IF "$(EFI_GENERATE_SYM_FILE)" == "YES"\r
+  if exist $(TARGET_PDB) $(PE2SYM) $(TARGET_PDB) $(TARGET_SYM)\r
+!ENDIF\r
+\r
+!IF "$(EFI_ZERO_DEBUG_DATA)" == "YES"\r
+  $(ZERODEBUGDATA) $(TARGET_DLL)\r
+!ENDIF\r
+\r
+#\r
+# Create the user interface section\r
+#\r
+$(TARGET_UI) : $(INF_FILENAME)\r
+  $(GENSECTION) -O $(TARGET_UI) -S EFI_SECTION_USER_INTERFACE -A "$(BASE_NAME)"\r
+\r
+#\r
+# Create the version section\r
+#\r
+!IF "$(BUILD_NUMBER)" != ""\r
+!IF "$(VERSION_STRING)" != ""\r
+$(TARGET_VER) : $(INF_FILENAME)\r
+  $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER) -A "$(VERSION_STRING)"\r
+!ELSE\r
+$(TARGET_VER) : $(INF_FILENAME)\r
+  $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER)\r
+!ENDIF\r
+!ELSE\r
+$(TARGET_VER) : \r
+  echo.>$(TARGET_VER)\r
+  type $(TARGET_VER)>$(TARGET_VER)\r
+!ENDIF\r
+\r
+#\r
+# Makefile entries to create the dependency expression section.\r
+# Use the DPX file from the source directory unless an override file\r
+# was specified.\r
+# If no DPX source file was specified, then create an empty file to\r
+# be used.\r
+#\r
+!IF "$(DPX_SOURCE)" != ""\r
+DPX_SOURCE_FILE = $(SOURCE_DIR)\$(DPX_SOURCE)\r
+!ENDIF\r
+\r
+!IF "$(DPX_SOURCE_OVERRIDE)" != ""\r
+DPX_SOURCE_FILE = $(DPX_SOURCE_OVERRIDE)\r
+!ENDIF\r
+\r
+!IF "$(DPX_SOURCE_FILE)" != ""\r
+!IF EXIST ($(DPX_SOURCE_FILE))\r
+#\r
+# Add dependency check for dxs file, because dxs file depends on PPI or \r
+# PROTOCOL guid defintions.\r
+#\r
+DEP_FILE    = $(DEST_DIR)\$(BASE_NAME)dxs.dep\r
+\r
+!IF EXIST($(TARGET_DPX))\r
+DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs.dep\r
+!IF !EXIST($(DEP_FILE))\r
+CREATEDEPS = YES\r
+!ENDIF\r
+!ENDIF\r
+\r
+!IF EXIST($(DEP_FILE))\r
+!INCLUDE $(DEP_FILE)\r
+!ENDIF\r
+#\r
+# Update dep file for next round incremental build\r
+#\r
+$(DEP_FILE) : $(TARGET_DPX)\r
+  $(MAKEDEPS) -f $(DPX_SOURCE_FILE) $(DEP_FLAGS)\r
+\r
+$(TARGET_DPX) : $(DPX_SOURCE_FILE) $(INF_FILENAME)\r
+  $(CC) /nologo $(INC) $(VERSION_FLAGS) /EP $(DPX_SOURCE_FILE) > $*.tmp1\r
+  $(GENDEPEX) -I $*.tmp1 -O $*.tmp2\r
+  $(GENSECTION) -I $*.tmp2 -O $@ -S $(DEPEX_TYPE)\r
+  del $*.tmp1 > NUL\r
+  del $*.tmp2 > NUL\r
+!ELSE\r
+!ERROR Dependency expression source file "$(DPX_SOURCE_FILE)" does not exist.\r
+!ENDIF\r
+!ELSE\r
+$(TARGET_DPX) : \r
+  echo. > $(TARGET_DPX)\r
+  type $(TARGET_DPX) > $(TARGET_DPX)\r
+!ENDIF\r
+\r
+#\r
+# Makefile entries for DXE DPX for combined PEIM drivers.\r
+# If a DXE_DPX_SOURCE file was specified in the INF file, use it. Otherwise \r
+# create an empty file and use it as a DPX file.\r
+#\r
+!IF "$(COMPONENT_TYPE)" == "COMBINED_PEIM_DRIVER"\r
+!IF "$(DXE_DPX_SOURCE)" != ""\r
+!IF EXIST ($(SOURCE_DIR)\$(DXE_DPX_SOURCE))\r
+$(TARGET_DXE_DPX) : $(SOURCE_DIR)\$(DXE_DPX_SOURCE) $(INF_FILENAME)\r
+  $(CC) /nologo $(INC) $(VERSION_FLAGS) /EP $(SOURCE_DIR)\$(DXE_DPX_SOURCE) > $*.tmp1\r
+  $(GENDEPEX) -I $*.tmp1 -O $*.tmp2\r
+  $(GENSECTION) -I $*.tmp2 -O $@ -S EFI_SECTION_DXE_DEPEX\r
+  del $*.tmp1 > NUL\r
+  del $*.tmp2 > NUL\r
+!ELSE\r
+!ERROR Dependency expression source file "$(SOURCE_DIR)\$(DXE_DPX_SOURCE)" does not exist.\r
+!ENDIF\r
+!ELSE\r
+$(TARGET_DXE_DPX) : \r
+  echo. > $(TARGET_DXE_DPX)\r
+  type $(TARGET_DXE_DPX) > $(TARGET_DXE_DPX)\r
+!ENDIF\r
+!ENDIF\r
+\r
+#\r
+# Describe how to build the HII export file from all the input HII pack files.\r
+# Use the FFS file GUID for the package GUID in the export file. Only used\r
+# when multiple VFR share strings.\r
+#\r
+$(DEST_DIR)\$(BASE_NAME).hii : $(HII_PACK_FILES)\r
+  $(HIIPACK) create -g $(FILE_GUID) -p $(HII_PACK_FILES) -o $(DEST_DIR)\$(BASE_NAME).hii\r
+\r
+#\r
+# If the build calls for creating an FFS file with the IFR included as\r
+# a separate binary (not compiled into the driver), then build the binary\r
+# section now. Note that the PACKAGE must be set correctly to actually get\r
+# this IFR section pulled into the FFS file.\r
+#\r
+!IF ("$(HII_IFR_PACK_FILES)" != "")\r
+\r
+$(DEST_DIR)\$(BASE_NAME)IfrBin.sec : $(HII_IFR_PACK_FILES)\r
+  $(HIIPACK) create -novarpacks -p $(HII_IFR_PACK_FILES) -o $(DEST_DIR)\$(BASE_NAME)IfrBin.hii\r
+  $(GENSECTION) -I $(DEST_DIR)\$(BASE_NAME)IfrBin.hii -O $(DEST_DIR)\$(BASE_NAME)IfrBin.sec -S EFI_SECTION_RAW\r
+\r
+BIN_TARGETS = $(BIN_TARGETS) $(DEST_DIR)\$(BASE_NAME)IfrBin.sec\r
+\r
+!ENDIF\r
+\r
+#\r
+# Build a FFS file from the sections and package\r
+#\r
+$(TARGET_FFS_FILE) : $(TARGET_PE32) $(TARGET_DPX) $(TARGET_UI) $(TARGET_VER) $(TARGET_DXE_DPX) $(PACKAGE_FILENAME)\r
+#\r
+# Some of our components require padding to align code\r
+#\r
+!IF "$(PROCESSOR)" == "IPF"\r
+!IF "$(COMPONENT_TYPE)" == "PIC_PEIM" || "$(COMPONENT_TYPE)" == "PE32_PEIM" || "$(COMPONENT_TYPE)" == "RELOCATABLE_PEIM" || "$(COMPONENT_TYPE)" == "SECURITY_CORE" || "$(COMPONENT_TYPE)" == "PEI_CORE" || "$(COMPONENT_TYPE)" == "COMBINED_PEIM_DRIVER"\r
+  copy $(BIN_DIR)\Blank.pad $(DEST_DIR)\r
+!ENDIF\r
+!ENDIF\r
+  $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V\r
+\r
+!IF "$(CREATEDEPS)"=="YES"\r
+all : $(DEP_TARGETS)\r
+  $(MAKE) -f $(MAKEFILE_NAME) all\r
+!ELSE\r
+all : $(LOCALIZE_TARGETS) $(BIN_TARGETS) $(TARGET_FFS_FILE) $(DEP_TARGETS)\r
+!ENDIF\r
+\r
+#\r
+# Remove the generated temp and final files for this modules.\r
+#\r
+clean :\r
+!IF ("$(FILE_GUID)" != "")\r
+  @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
+!ENDIF\r
+  @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
+  @del /q $(DEST_OUTPUT_DIRS) \r
+\r
+[=============================================================================]\r
+[Build.Ia32.TE_PEIM,Build.Ipf.TE_PEIM,Build.x64.TE_PEIM]\r
+#\r
+# Define the library file we'll build if we have any objects defined.\r
+#\r
+!IFDEF OBJECTS\r
+TARGET_LOCAL_LIB  = $(DEST_DIR)\$(BASE_NAME)Local.lib\r
+#\r
+# LIB all the object files into our (local) target lib file. Put\r
+# a dependency on the component's INF file in case it changes.\r
+#\r
+$(TARGET_LOCAL_LIB) : $(OBJECTS)  $(INF_FILENAME) $(ENV_DEPS)\r
+  $(LIB) $(LIB_FLAGS) $(OBJECTS) /OUT:$@\r
+\r
+!ELSE\r
+!ERROR No source files to build were defined in the INF file\r
+!ENDIF\r
+\r
+#\r
+# Defines for standard intermediate files and build targets\r
+#\r
+TARGET_DLL        = $(BIN_DIR)\$(BASE_NAME).dll\r
+TARGET_EFI        = $(BIN_DIR)\$(BASE_NAME).efi\r
+TARGET_DPX        = $(DEST_DIR)\$(BASE_NAME).dpx\r
+TARGET_UI         = $(DEST_DIR)\$(BASE_NAME).ui\r
+TARGET_VER        = $(DEST_DIR)\$(BASE_NAME).ver\r
+TARGET_MAP        = $(BIN_DIR)\$(BASE_NAME).map\r
+TARGET_PDB        = $(BIN_DIR)\$(BASE_NAME).pdb\r
+TARGET_SYM        = $(BIN_DIR)\$(BASE_NAME).sym\r
+TARGET_TE         = $(BIN_DIR)\$(BASE_NAME).te\r
+TARGET_PE32       = $(DEST_DIR)\$(BASE_NAME).pe32\r
+TARGET_TES        = $(DEST_DIR)\$(BASE_NAME).tes\r
+TARGET_FFS_FILE   = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei\r
+\r
+#\r
+# Create our TE section from our TE file\r
+#\r
+$(TARGET_TES) : $(TARGET_TE)\r
+  $(GENSECTION) -I $(TARGET_TE) -O $(TARGET_TES) -S EFI_SECTION_TE\r
+\r
+#\r
+# Run FWImage on the DLL to set it as an EFI image type.\r
+#\r
+$(TARGET_EFI) : $(TARGET_DLL) $(INF_FILENAME)\r
+  $(FWIMAGE) $(COMPONENT_TYPE) $(TARGET_DLL) $(TARGET_EFI)\r
+\r
+#\r
+# Run GenTEImage on the built .efi file to create our TE file.\r
+#\r
+$(TARGET_TE) : $(TARGET_EFI) \r
+  $(GENTEIMAGE) -o $(TARGET_TE) $(TARGET_EFI)\r
+\r
+#\r
+# Link all objects and libs to create the executable\r
+#\r
+$(TARGET_DLL) : $(TARGET_LOCAL_LIB) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)\r
+  $(LINK) $(LINK_FLAGS_DLL) $(LIBS) /ENTRY:$(IMAGE_ENTRY_POINT) \\r
+     $(TARGET_LOCAL_LIB) /OUT:$(TARGET_DLL) /MAP:$(TARGET_MAP) \\r
+     /PDB:$(TARGET_PDB)\r
+  $(SETSTAMP) $(TARGET_DLL) $(BUILD_DIR)\GenStamp.txt\r
+!IF "$(EFI_GENERATE_SYM_FILE)" == "YES"\r
+  if exist $(TARGET_PDB) $(PE2SYM) $(TARGET_PDB) $(TARGET_SYM)\r
+!ENDIF\r
+\r
+!IF "$(EFI_ZERO_DEBUG_DATA)" == "YES"\r
+  $(ZERODEBUGDATA) $(TARGET_DLL)\r
+!ENDIF\r
+\r
+#\r
+# Create the user interface section\r
+#\r
+$(TARGET_UI) : $(INF_FILENAME)\r
+  $(GENSECTION) -O $(TARGET_UI) -S EFI_SECTION_USER_INTERFACE -A "$(BASE_NAME)"\r
+\r
+#\r
+# Create the version section\r
+#\r
+!IF "$(BUILD_NUMBER)" != ""\r
+!IF "$(VERSION_STRING)" != ""\r
+$(TARGET_VER) : $(INF_FILENAME)\r
+  $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER) -A "$(VERSION_STRING)"\r
+!ELSE\r
+$(TARGET_VER) : $(INF_FILENAME)\r
+  $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER)\r
+!ENDIF\r
+!ELSE\r
+$(TARGET_VER) : \r
+  echo.>$(TARGET_VER)\r
+  type $(TARGET_VER)>$(TARGET_VER)\r
+!ENDIF\r
+\r
+#\r
+# Makefile entries to create the dependency expression section.\r
+# Use the DPX file from the source directory unless an override file\r
+# was specified.\r
+# If no DPX source file was specified, then create an empty file to\r
+# be used.\r
+#\r
+!IF "$(DPX_SOURCE)" != ""\r
+DPX_SOURCE_FILE = $(SOURCE_DIR)\$(DPX_SOURCE)\r
+!ENDIF\r
+\r
+!IF "$(DPX_SOURCE_OVERRIDE)" != ""\r
+DPX_SOURCE_FILE = $(DPX_SOURCE_OVERRIDE)\r
+!ENDIF\r
+\r
+!IF "$(DPX_SOURCE_FILE)" != ""\r
+!IF EXIST ($(DPX_SOURCE_FILE))\r
+#\r
+# Add dependency check for dxs file, because dxs file depends on PPI or \r
+# PROTOCOL guid defintions.\r
+#\r
+DEP_FILE    = $(DEST_DIR)\$(BASE_NAME)dxs.dep\r
+\r
+!IF EXIST($(TARGET_DPX))\r
+DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs.dep\r
+!IF !EXIST($(DEP_FILE))\r
+CREATEDEPS = YES\r
+!ENDIF\r
+!ENDIF\r
+\r
+!IF EXIST($(DEP_FILE))\r
+!INCLUDE $(DEP_FILE)\r
+!ENDIF\r
+#\r
+# Update dep file for next round incremental build\r
+#\r
+$(DEP_FILE) : $(TARGET_DPX)\r
+  $(MAKEDEPS) -f $(DPX_SOURCE_FILE) $(DEP_FLAGS)\r
+\r
+$(TARGET_DPX) : $(DPX_SOURCE_FILE) $(INF_FILENAME)\r
+  $(CC) /nologo $(INC) $(VERSION_FLAGS) /EP $(DPX_SOURCE_FILE) > $*.tmp1\r
+  $(GENDEPEX) -I $*.tmp1 -O $*.tmp2\r
+  $(GENSECTION) -I $*.tmp2 -O $@ -S $(DEPEX_TYPE)\r
+  del $*.tmp1 > NUL\r
+  del $*.tmp2 > NUL\r
+!ELSE\r
+!ERROR Dependency expression source file "$(DPX_SOURCE_FILE)" does not exist.\r
+!ENDIF\r
+!ELSE\r
+$(TARGET_DPX) : \r
+  echo. > $(TARGET_DPX)\r
+  type $(TARGET_DPX) > $(TARGET_DPX)\r
+!ENDIF\r
+\r
+#\r
+# Build an FFS file from the sections and package\r
+#\r
+$(TARGET_FFS_FILE) : $(TARGET_TES) $(TARGET_DPX) $(TARGET_UI) $(TARGET_VER) $(PACKAGE_FILENAME)\r
+  $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V\r
+\r
+!IF "$(CREATEDEPS)"=="YES"\r
+all : $(DEP_TARGETS)\r
+  $(MAKE) -f $(MAKEFILE_NAME) all\r
+!ELSE\r
+all : $(TARGET_FFS_FILE) $(DEP_TARGETS)\r
+!ENDIF\r
+\r
+#\r
+# Remove the generated temp and final files for this modules.\r
+#\r
+clean :\r
+!IF ("$(FILE_GUID)" != "")\r
+  @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
+!ENDIF\r
+  @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
+  @del /q $(DEST_OUTPUT_DIRS) \r
+\r
+[=============================================================================]\r
+#\r
+# These are the commands to build EBC EFI targets\r
+#\r
+[=============================================================================]\r
+[Build.Ebc.BS_DRIVER|RT_DRIVER|APPLICATION]\r
+\r
+#\r
+# Add the EBC library to our list of libs\r
+#\r
+LIBS = $(LIBS) $(EBC_TOOLS_PATH)\lib\EbcLib.lib \r
+\r
+!IF "$(LOCALIZE)" == "YES"\r
+\r
+!IF "$(EFI_GENERATE_HII_EXPORT)" == "YES"\r
+STRGATHER_FLAGS   = $(STRGATHER_FLAGS) -hpk $(DEST_DIR)\$(BASE_NAME)Strings.hpk\r
+\r
+#\r
+# There will be one HII pack containing all the strings. Add that file\r
+# to the list of HII pack files we'll use to create our final HII export file.\r
+#\r
+HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(BASE_NAME)Strings.hpk\r
+\r
+LOCALIZE_TARGETS  = $(LOCALIZE_TARGETS) $(DEST_DIR)\$(BASE_NAME).hii\r
+!ENDIF\r
+\r
+$(DEST_DIR)\$(BASE_NAME).sdb : $(SDB_FILES) $(SOURCE_FILES)\r
+  $(STRGATHER) -scan -vdbr $(STRGATHER_FLAGS) -od $(DEST_DIR)\$(BASE_NAME).sdb \\r
+    -skipext .uni -skipext .h $(SOURCE_FILES)\r
+\r
+$(DEST_DIR)\$(BASE_NAME)Strings.c : $(DEST_DIR)\$(BASE_NAME).sdb\r
+  $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \\r
+    -oc $(DEST_DIR)\$(BASE_NAME)Strings.c\r
+\r
+$(DEST_DIR)\$(BASE_NAME)StrDefs.h : $(DEST_DIR)\$(BASE_NAME).sdb\r
+  $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \\r
+    -oh $(DEST_DIR)\$(BASE_NAME)StrDefs.h\r
+\r
+$(DEST_DIR)\$(BASE_NAME)Strings.hpk : $(DEST_DIR)\$(BASE_NAME).sdb\r
+  $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \\r
+    -hpk $(DEST_DIR)\$(BASE_NAME)Strings.hpk\r
+\r
+OBJECTS = $(OBJECTS) $(DEST_DIR)\$(BASE_NAME)Strings.obj\r
+\r
+$(DEST_DIR)\$(BASE_NAME)Strings.obj : $(DEST_DIR)\$(BASE_NAME)Strings.c $(INF_FILENAME) $(ALL_DEPS)\r
+  $(EBC_CC) $(EBC_C_FLAGS) $(DEST_DIR)\$(BASE_NAME)Strings.c\r
+\r
+LOCALIZE_TARGETS = $(LOCALIZE_TARGETS) $(DEST_DIR)\$(BASE_NAME)StrDefs.h\r
+\r
+!ENDIF\r
+\r
+#\r
+# If building an application, then the target is a .app, not .dxe\r
+#\r
+!IF "$(COMPONENT_TYPE)" == "APPLICATION"\r
+TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).app\r
+SUBSYSTEM       = EFI_APPLICATION\r
+!ELSE\r
+TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).dxe\r
+SUBSYSTEM       = EFI_BOOT_SERVICE_DRIVER\r
+!ENDIF\r
+\r
+#\r
+# Defines for standard intermediate files and build targets\r
+#\r
+TARGET_EFI  = $(BIN_DIR)\$(BASE_NAME).efi\r
+TARGET_DPX  = $(DEST_DIR)\$(BASE_NAME).dpx\r
+TARGET_UI   = $(DEST_DIR)\$(BASE_NAME).ui\r
+TARGET_VER  = $(DEST_DIR)\$(BASE_NAME).ver\r
+TARGET_MAP  = $(BIN_DIR)\$(BASE_NAME).map\r
+TARGET_PDB  = $(BIN_DIR)\$(BASE_NAME).pdb\r
+TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pe32\r
+TARGET_DLL  = $(BIN_DIR)\$(BASE_NAME).dll\r
+\r
+#\r
+# First link all the objects and libs together to make a .dll file\r
+#\r
+$(TARGET_DLL) : $(OBJECTS) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)\r
+  $(EBC_LINK) $(EBC_LINK_FLAGS) /SUBSYSTEM:$(SUBSYSTEM) /ENTRY:EfiStart \\r
+    $(OBJECTS) $(LIBS) /OUT:$(TARGET_DLL) /MAP:$(TARGET_MAP)\r
+  $(SETSTAMP) $(TARGET_DLL) $(BUILD_DIR)\GenStamp.txt\r
+!IF "$(EFI_ZERO_DEBUG_DATA)" == "YES"\r
+  $(ZERODEBUGDATA) $(TARGET_DLL)\r
+!ENDIF\r
+\r
+#\r
+# Now take the .dll file and make a .efi file\r
+#\r
+$(TARGET_EFI) : $(TARGET_DLL) $(INF_FILENAME)\r
+  $(FWIMAGE) -t 0 $(COMPONENT_TYPE) $(TARGET_DLL) $(TARGET_EFI)\r
+\r
+#\r
+# Now take the .efi file and make a .pe32 section\r
+#\r
+$(TARGET_PE32) : $(TARGET_EFI) \r
+  $(GENSECTION) -I $(TARGET_EFI) -O $(TARGET_PE32) -S EFI_SECTION_PE32\r
+\r
+#\r
+# Create the user interface section\r
+#\r
+$(TARGET_UI) : $(INF_FILENAME)\r
+  $(GENSECTION) -O $(TARGET_UI) -S EFI_SECTION_USER_INTERFACE -A "$(BASE_NAME)"\r
+\r
+#\r
+# Create the version section\r
+#\r
+!IF "$(BUILD_NUMBER)" != ""\r
+!IF "$(VERSION_STRING)" != ""\r
+$(TARGET_VER) : $(INF_FILENAME)\r
+  $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER) -A "$(VERSION_STRING)"\r
+!ELSE\r
+$(TARGET_VER) : $(INF_FILENAME)\r
+  $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER)\r
+!ENDIF\r
+!ELSE\r
+$(TARGET_VER) : \r
+  echo. > $(TARGET_VER)\r
+  type $(TARGET_VER) > $(TARGET_VER)\r
+!ENDIF\r
+\r
+#\r
+# Makefile entries to create the dependency expression section.\r
+# Use the DPX file from the source directory unless an override file\r
+# was specified.\r
+# If no DPX source file was specified, then create an empty file to\r
+# be used.\r
+#\r
+!IF "$(DPX_SOURCE)" != ""\r
+DPX_SOURCE_FILE = $(SOURCE_DIR)\$(DPX_SOURCE)\r
+!ENDIF\r
+\r
+!IF "$(DPX_SOURCE_OVERRIDE)" != ""\r
+DPX_SOURCE_FILE = $(DPX_SOURCE_OVERRIDE)\r
+!ENDIF\r
+\r
+!IF "$(DPX_SOURCE_FILE)" != ""\r
+!IF EXIST ($(DPX_SOURCE_FILE))\r
+#\r
+# Add dependency check for dxs file, because dxs file depends on PPI or \r
+# PROTOCOL guid defintions.\r
+#\r
+DEP_FILE    = $(DEST_DIR)\$(BASE_NAME)dxs.dep\r
+\r
+!IF EXIST($(TARGET_DPX))\r
+DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs.dep\r
+!IF !EXIST($(DEP_FILE))\r
+CREATEDEPS = YES\r
+!ENDIF\r
+!ENDIF\r
+\r
+!IF EXIST($(DEP_FILE))\r
+!INCLUDE $(DEP_FILE)\r
+!ENDIF\r
+#\r
+# Update dep file for next round incremental build\r
+#\r
+$(DEP_FILE) : $(TARGET_DPX)\r
+  $(MAKEDEPS) -f $(DPX_SOURCE_FILE) $(DEP_FLAGS)\r
+\r
+$(TARGET_DPX) : $(DPX_SOURCE_FILE) $(INF_FILENAME)\r
+  $(CC) /nologo $(INC) $(VERSION_FLAGS) /EP $(DPX_SOURCE_FILE) > $*.tmp1\r
+  $(GENDEPEX) -I $*.tmp1 -O $*.tmp2\r
+  $(GENSECTION) -I $*.tmp2 -O $@ -S $(DEPEX_TYPE)\r
+  del $*.tmp1 > NUL\r
+  del $*.tmp2 > NUL\r
+!ELSE\r
+!ERROR Dependency expression source file "$(DPX_SOURCE_FILE)" does not exist.\r
+!ENDIF\r
+!ELSE\r
+$(TARGET_DPX) : \r
+  echo. > $(TARGET_DPX)\r
+  type $(TARGET_DPX) > $(TARGET_DPX)\r
+!ENDIF\r
+\r
+#\r
+# Describe how to build the HII export file from all the input HII pack files.\r
+# Use the FFS file GUID for the package GUID in the export file. Only used\r
+# when multiple VFR share strings.\r
+#\r
+$(DEST_DIR)\$(BASE_NAME).hii : $(HII_PACK_FILES)\r
+  $(HIIPACK) create -g $(FILE_GUID) -p $(HII_PACK_FILES) -o $(DEST_DIR)\$(BASE_NAME).hii\r
+\r
+#\r
+# If the build calls for creating an FFS file with the IFR included as\r
+# a separate binary (not compiled into the driver), then build the binary\r
+# section now. Note that the PACKAGE must be set correctly to actually get\r
+# this IFR section pulled into the FFS file.\r
+#\r
+!IF ("$(HII_IFR_PACK_FILES)" != "")\r
+\r
+$(DEST_DIR)\$(BASE_NAME)IfrBin.sec : $(HII_IFR_PACK_FILES)\r
+  $(HIIPACK) create -novarpacks -p $(HII_IFR_PACK_FILES) -o $(DEST_DIR)\$(BASE_NAME)IfrBin.hii\r
+  $(GENSECTION) -I $(DEST_DIR)\$(BASE_NAME)IfrBin.hii -O $(DEST_DIR)\$(BASE_NAME)IfrBin.sec -S EFI_SECTION_RAW\r
+\r
+BIN_TARGETS = $(BIN_TARGETS) $(DEST_DIR)\$(BASE_NAME)IfrBin.sec\r
+\r
+!ENDIF\r
+\r
+#\r
+# Build an FFS file from the sections and package\r
+#\r
+$(TARGET_FFS_FILE) : $(TARGET_PE32) $(TARGET_DPX) $(TARGET_UI) $(TARGET_VER) $(PACKAGE_FILENAME)\r
+  $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V\r
+\r
+!IF "$(CREATEDEPS)"=="YES"\r
+all : $(DEP_TARGETS)\r
+  $(MAKE) -f $(MAKEFILE_NAME) all\r
+!ELSE\r
+all : $(LOCALIZE_TARGETS) $(BIN_TARGETS) $(TARGET_FFS_FILE) $(DEP_TARGETS)\r
+!ENDIF\r
+\r
+#\r
+# Remove the generated temp and final files for this modules.\r
+#\r
+clean :\r
+!IF ("$(FILE_GUID)" != "")\r
+  @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
+!ENDIF\r
+  @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
+  @del /q $(DEST_OUTPUT_DIRS) \r
+\r
+[=============================================================================]\r
+#\r
+# These are the commands to build vendor-provided *.EFI files into an FV.\r
+# To use them, create an INF file with BUILD_TYPE=BS_DRIVER_EFI.\r
+# This section, as it now exists, only supports boot service drivers.\r
+#\r
+[=============================================================================]\r
+[Build.Ia32.BS_DRIVER_EFI|RT_DRIVER_EFI|APPLICATION_EFI,Build.Ipf.BS_DRIVER_EFI|RT_DRIVER_EFI|APPLICATION_EFI,Build.Ebc.BS_DRIVER_EFI|RT_DRIVER_EFI|APPLICATION_EFI,Build.x64.BS_DRIVER_EFI|RT_DRIVER_EFI|APPLICATION_EFI]\r
+#\r
+# Defines for standard intermediate files and build targets. For the source\r
+# .efi file, take the one in the source directory if it exists. If there's not\r
+# one there, look for one in the processor-specfic subdirectory.\r
+#\r
+!IF EXIST ("$(SOURCE_DIR)\$(BASE_NAME).efi")\r
+TARGET_EFI        = $(SOURCE_DIR)\$(BASE_NAME).efi\r
+!ELSEIF EXIST ("$(SOURCE_DIR)\$(PROCESSOR)\$(BASE_NAME).efi")\r
+TARGET_EFI        = $(SOURCE_DIR)\$(PROCESSOR)\$(BASE_NAME).efi\r
+!ELSE\r
+!ERROR Pre-existing $(BASE_NAME).efi file not found in $(SOURCE_DIR) nor $(SOURCE_DIR)\$(PROCESSOR)\r
+!ENDIF\r
+\r
+TARGET_DPX        = $(DEST_DIR)\$(BASE_NAME).dpx\r
+TARGET_UI         = $(DEST_DIR)\$(BASE_NAME).ui\r
+TARGET_VER        = $(DEST_DIR)\$(BASE_NAME).ver\r
+TARGET_MAP        = $(BIN_DIR)\$(BASE_NAME).map\r
+TARGET_PDB        = $(BIN_DIR)\$(BASE_NAME).pdb\r
+TARGET_PE32       = $(DEST_DIR)\$(BASE_NAME).pe32\r
+TARGET_DLL        = $(BIN_DIR)\$(BASE_NAME).dll\r
+\r
+#\r
+# If building an application, then the target is a .app, not .dxe\r
+#\r
+!IF "$(COMPONENT_TYPE)" == "APPLICATION"\r
+TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).app\r
+!ELSE\r
+TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).dxe\r
+!ENDIF\r
+\r
+#\r
+# Take the .efi file and make a .pe32 file\r
+#\r
+$(TARGET_PE32) : $(TARGET_EFI) \r
+  $(GENSECTION) -I $(TARGET_EFI) -O $(TARGET_PE32) -S EFI_SECTION_PE32\r
+\r
+#\r
+# Create the user interface section\r
+#\r
+$(TARGET_UI) : $(INF_FILENAME)\r
+  $(GENSECTION) -O $(TARGET_UI) -S EFI_SECTION_USER_INTERFACE -A "$(BASE_NAME)"\r
+\r
+#\r
+# Create the version section\r
+#\r
+!IF "$(BUILD_NUMBER)" != ""\r
+!IF "$(VERSION_STRING)" != ""\r
+$(TARGET_VER) : $(INF_FILENAME)\r
+  $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER) -A "$(VERSION_STRING)"\r
+!ELSE\r
+$(TARGET_VER) : $(INF_FILENAME)\r
+  $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER)\r
+!ENDIF\r
+!ELSE\r
+$(TARGET_VER) : \r
+  echo. > $(TARGET_VER)\r
+  type $(TARGET_VER) > $(TARGET_VER)\r
+!ENDIF\r
+\r
+#\r
+# Makefile entries to create the dependency expression section.\r
+# Use the DPX file from the source directory unless an override file\r
+# was specified.\r
+# If no DPX source file was specified, then create an empty file to\r
+# be used.\r
+#\r
+!IF "$(DPX_SOURCE)" != ""\r
+DPX_SOURCE_FILE = $(SOURCE_DIR)\$(DPX_SOURCE)\r
+!ENDIF\r
+\r
+!IF "$(DPX_SOURCE_OVERRIDE)" != ""\r
+DPX_SOURCE_FILE = $(DPX_SOURCE_OVERRIDE)\r
+!ENDIF\r
+\r
+!IF "$(DPX_SOURCE_FILE)" != ""\r
+!IF EXIST ($(DPX_SOURCE_FILE))\r
+#\r
+# Add dependency check for dxs file, because dxs file depends on PPI or \r
+# PROTOCOL guid defintions.\r
+#\r
+DEP_FILE    = $(DEST_DIR)\$(BASE_NAME)dxs.dep\r
+\r
+!IF EXIST($(TARGET_DPX))\r
+DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs.dep\r
+!IF !EXIST($(DEP_FILE))\r
+CREATEDEPS = YES\r
+!ENDIF\r
+!ENDIF\r
+\r
+!IF EXIST($(DEP_FILE))\r
+!INCLUDE $(DEP_FILE)\r
+!ENDIF\r
+#\r
+# Update dep file for next round incremental build\r
+#\r
+$(DEP_FILE) : $(TARGET_DPX)\r
+  $(MAKEDEPS) -f $(DPX_SOURCE_FILE) $(DEP_FLAGS)\r
+\r
+$(TARGET_DPX) : $(DPX_SOURCE_FILE) $(INF_FILENAME)\r
+  $(CC) /nologo $(INC) $(VERSION_FLAGS) /EP $(DPX_SOURCE_FILE) > $*.tmp1\r
+  $(GENDEPEX) -I $*.tmp1 -O $*.tmp2\r
+  $(GENSECTION) -I $*.tmp2 -O $@ -S $(DEPEX_TYPE)\r
+  del $*.tmp1 > NUL\r
+  del $*.tmp2 > NUL\r
+!ELSE\r
+!ERROR Dependency expression source file "$(DPX_SOURCE_FILE)" does not exist.\r
+!ENDIF\r
+!ELSE\r
+$(TARGET_DPX) : \r
+  echo. > $(TARGET_DPX)\r
+  type $(TARGET_DPX) > $(TARGET_DPX)\r
+!ENDIF\r
+\r
+#\r
+# Build a FFS file from the sections and package\r
+#\r
+$(TARGET_FFS_FILE) : $(TARGET_PE32) $(TARGET_DPX) $(TARGET_UI) $(TARGET_VER) $(PACKAGE_FILENAME)\r
+  $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V\r
+\r
+all : $(TARGET_FFS_FILE)\r
+\r
+#\r
+# Remove the generated temp and final files for this modules.\r
+#\r
+clean :\r
+!IF ("$(FILE_GUID)" != "")\r
+  @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
+!ENDIF\r
+  @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
+  @del /q $(DEST_OUTPUT_DIRS) \r
+\r
+[=============================================================================]\r
+[Compile.Ia32.Bin|Bmp,Compile.x64.Bin|Bmp,Compile.Ipf.Bin|Bmp]\r
+#\r
+# We simply copy the binary file from the source directory to the destination directory\r
+#\r
+$(DEST_DIR)\$(BASE_NAME).bin : $(SOURCE_FILE_NAME)\r
+  copy $** $@\r
+\r
+[=============================================================================]\r
+[Build.Ia32.BINARY|Legacy16|Logo,Build.Ipf.BINARY|Legacy16|Logo,Build.x64.BINARY|Legacy16|Logo]\r
+#\r
+# Use GenFfsFile to convert it to an FFS file\r
+#\r
+$(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).ffs : $(DEST_DIR)\$(BASE_NAME).bin $(PACKAGE_FILENAME)\r
+  $(GENSECTION) -I $(DEST_DIR)\$(BASE_NAME).bin -O $(DEST_DIR)\$(BASE_NAME).sec -S EFI_SECTION_RAW\r
+  $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V\r
+\r
+all : $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).ffs\r
+\r
+#\r
+# Remove the generated temp and final files for this modules.\r
+#\r
+clean :\r
+!IF ("$(FILE_GUID)" != "")\r
+  @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
+!ENDIF\r
+  @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
+  @del /q $(DEST_OUTPUT_DIRS) \r
+\r
+[=============================================================================]\r
+[Build.Ia32.RAWFILE|CONFIG,Build.Ipf.RAWFILE|CONFIG,Build.x64.RAWFILE|CONFIG]\r
+#\r
+# Use GenFfsFile to convert it to an raw FFS file\r
+#\r
+$(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).raw : $(DEST_DIR)\$(BASE_NAME).bin $(PACKAGE_FILENAME)\r
+  $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V\r
+\r
+all : $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).raw\r
+\r
+#\r
+# Remove the generated temp and final files for this modules.\r
+#\r
+clean :\r
+!IF ("$(FILE_GUID)" != "")\r
+  @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
+!ENDIF\r
+  @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
+  @del /q $(DEST_OUTPUT_DIRS) \r
+\r
+[=============================================================================]\r
+# \r
+# These are commands to compile unicode .uni files.\r
+#\r
+[=============================================================================]\r
+[Compile.Ia32.Uni,Compile.Ipf.Uni,Compile.Ebc.Uni,Compile.x64.Uni]\r
+#\r
+# Emit an error message if the file's base name is the same as the\r
+# component base name. This causes build issues.\r
+#\r
+!IF "$(FILE)" == "$(BASE_NAME)"\r
+!ERROR Component Unicode string file name cannot be the same as the component BASE_NAME.\r
+!ENDIF\r
+\r
+#\r
+# Always create dep file for uni file as it can be created at the same time when \r
+# strgather is parsing uni file.\r
+#\r
+DEP_FILE    = $(DEST_DIR)\$(FILE)Uni.dep\r
+\r
+!IF EXIST($(DEP_FILE))\r
+!INCLUDE $(DEP_FILE)\r
+!ENDIF\r
+\r
+$(DEST_DIR)\$(FILE).sdb : $(SOURCE_FILE_NAME) $(INF_FILENAME)\r
+  $(STRGATHER) -parse -newdb -db $(DEST_DIR)\$(FILE).sdb -dep $(DEP_FILE) $(INC) $(SOURCE_FILE_NAME)\r
+\r
+SDB_FILES       = $(SDB_FILES) $(DEST_DIR)\$(FILE).sdb\r
+STRGATHER_FLAGS = $(STRGATHER_FLAGS) -db $(DEST_DIR)\$(FILE).sdb\r
+LOCALIZE        = YES\r
+\r
+[=============================================================================]\r
+[Compile.Ia32.Vfr,Compile.Ipf.Vfr,Compile.x64.Vfr]\r
+\r
+DEP_FILE    = $(DEST_DIR)\$(FILE)Vfr.dep\r
+\r
+!IF EXIST($(DEST_DIR)\$(FILE).obj)\r
+DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Vfr.dep\r
+!IF !EXIST($(DEP_FILE))\r
+CREATEDEPS = YES\r
+!ENDIF\r
+!ENDIF\r
+\r
+!IF EXIST($(DEP_FILE))\r
+!INCLUDE $(DEP_FILE)\r
+!ENDIF\r
+\r
+#\r
+# Update dep file for next round incremental build\r
+#\r
+$(DEP_FILE) : $(DEST_DIR)\$(FILE).obj\r
+  $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)\r
+\r
+HII_PACK_FILES  = $(HII_PACK_FILES) $(DEST_DIR)\$(FILE).hpk\r
+\r
+#\r
+# Add a dummy command for building the HII pack file. In reality, it's built \r
+# below, but the C_FLAGS macro reference the target as $@, so you can't specify\r
+# the obj and hpk files as dual targets of the same command.\r
+#\r
+$(DEST_DIR)\$(FILE).hpk : $(DEST_DIR)\$(FILE).obj\r
+  \r
+$(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)\r
+  $(VFRCOMPILE) $(VFRCOMPILE_FLAGS) $(INC) -ibin -od $(DEST_DIR)\$(SOURCE_RELATIVE_PATH) \\r
+    -l $(VFR_FLAGS) $(SOURCE_FILE_NAME)\r
+  $(CC) $(C_FLAGS) $(DEST_DIR)\$(FILE).c\r
+\r
+[=============================================================================]\r
+[Compile.Ebc.Vfr]\r
+\r
+DEP_FILE    = $(DEST_DIR)\$(FILE)Vfr.dep\r
+\r
+!IF EXIST($(DEST_DIR)\$(FILE).obj)\r
+DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Vfr.dep\r
+!IF !EXIST($(DEP_FILE))\r
+CREATEDEPS = YES\r
+!ENDIF\r
+!ENDIF\r
+\r
+!IF EXIST($(DEP_FILE))\r
+!INCLUDE $(DEP_FILE)\r
+!ENDIF\r
+\r
+#\r
+# Update dep file for next round incremental build\r
+#\r
+$(DEP_FILE) : $(DEST_DIR)\$(FILE).obj\r
+  $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)\r
+\r
+HII_PACK_FILES  = $(HII_PACK_FILES) $(DEST_DIR)\$(FILE).hpk\r
+\r
+#\r
+# Add a dummy command for building the HII pack file. In reality, it's built \r
+# below, but the C_FLAGS macro reference the target as $@, so you can't specify\r
+# the obj and hpk files as dual targets of the same command.\r
+#\r
+$(DEST_DIR)\$(FILE).hpk : $(DEST_DIR)\$(FILE).obj\r
+  \r
+$(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)\r
+  $(VFRCOMPILE) $(VFRCOMPILE_FLAGS) $(INC) -ibin -od $(DEST_DIR)\$(SOURCE_RELATIVE_PATH) \\r
+    -l $(VFR_FLAGS) $(SOURCE_FILE_NAME)\r
+  $(EBC_CC) $(EBC_C_FLAGS) $(DEST_DIR)\$(FILE).c\r
+\r
+[=============================================================================]\r
+#\r
+# Commands for building IFR as uncompressed binary into the FFS file. To \r
+# use it, set COMPILE_SELECT=.vfr=Ifr_Bin for the component in the DSC file.\r
+#\r
+[=============================================================================]\r
+[Compile.Ia32.Ifr_Bin,Compile.Ipf.Ifr_Bin,Compile.x64.Ifr_Bin]\r
+\r
+DEP_FILE    = $(DEST_DIR)\$(FILE)Vfr.dep\r
+\r
+!IF EXIST($(DEST_DIR)\$(FILE).obj)\r
+DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Vfr.dep\r
+!IF !EXIST($(DEP_FILE))\r
+CREATEDEPS = YES\r
+!ENDIF\r
+!ENDIF\r
+\r
+!IF EXIST($(DEP_FILE))\r
+!INCLUDE $(DEP_FILE)\r
+!ENDIF\r
+\r
+#\r
+# Update dep file for next round incremental build\r
+#\r
+$(DEP_FILE) : $(DEST_DIR)\$(FILE).obj\r
+  $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)\r
+\r
+HII_PACK_FILES  = $(HII_PACK_FILES) $(DEST_DIR)\$(FILE).hpk\r
+\r
+#\r
+# Add a dummy command for building the HII pack file. In reality, it's built \r
+# below, but the C_FLAGS macro reference the target as $@, so you can't specify\r
+# the obj and hpk files as dual targets of the same command.\r
+#\r
+$(DEST_DIR)\$(FILE).hpk : $(DEST_DIR)\$(FILE).obj\r
+  \r
+$(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)\r
+  $(VFRCOMPILE) $(VFRCOMPILE_FLAGS) $(INC) -ibin -od $(DEST_DIR)\$(SOURCE_RELATIVE_PATH) \\r
+    -l $(VFR_FLAGS) $(SOURCE_FILE_NAME)\r
+  $(CC) $(C_FLAGS) $(DEST_DIR)\$(FILE).c\r
+\r
+#\r
+# Add to the variable that contains the list of VFR binary files we're going\r
+# to merge together at the end of the build. \r
+#\r
+HII_IFR_PACK_FILES = $(HII_IFR_PACK_FILES) $(DEST_DIR)\$(FILE).hpk\r
+\r
+[=============================================================================]\r
+#\r
+# Commands for building IFR as uncompressed binary into the FFS file. To \r
+# use it, set COMPILE_SELECT=.vfr=Ifr_Bin for the component in the DSC file.\r
+#\r
+[=============================================================================]\r
+[Compile.Ebc.Ifr_Bin]\r
+\r
+DEP_FILE    = $(DEST_DIR)\$(FILE)Vfr.dep\r
+\r
+!IF EXIST($(DEST_DIR)\$(FILE).obj)\r
+DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Vfr.dep\r
+!IF !EXIST($(DEP_FILE))\r
+CREATEDEPS = YES\r
+!ENDIF\r
+!ENDIF\r
+\r
+!IF EXIST($(DEP_FILE))\r
+!INCLUDE $(DEP_FILE)\r
+!ENDIF\r
+\r
+#\r
+# Update dep file for next round incremental build\r
+#\r
+$(DEP_FILE) : $(DEST_DIR)\$(FILE).obj\r
+  $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)\r
+\r
+HII_PACK_FILES  = $(HII_PACK_FILES) $(DEST_DIR)\$(FILE).hpk\r
+\r
+#\r
+# Add a dummy command for building the HII pack file. In reality, it's built \r
+# below, but the C_FLAGS macro reference the target as $@, so you can't specify\r
+# the obj and hpk files as dual targets of the same command.\r
+#\r
+$(DEST_DIR)\$(FILE).hpk : $(DEST_DIR)\$(FILE).obj\r
+  \r
+$(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)\r
+  $(VFRCOMPILE) $(VFRCOMPILE_FLAGS) $(INC) -ibin -od $(DEST_DIR)\$(SOURCE_RELATIVE_PATH) \\r
+    -l $(VFR_FLAGS) $(SOURCE_FILE_NAME)\r
+  $(EBC_CC) $(EBC_C_FLAGS) $(DEST_DIR)\$(FILE).c\r
+\r
+#\r
+# Add to the variable that contains the list of VFR binary files we're going\r
+# to merge together at the end of the build. \r
+#\r
+HII_IFR_PACK_FILES = $(HII_IFR_PACK_FILES) $(DEST_DIR)\$(FILE).hpk\r
+\r
+[=============================================================================]\r
+[Compile.Ia32.Fv,Compile.Ipf.Fv,Compile.x64.Fv]\r
+#\r
+# Run GenSection on the firmware volume image.\r
+#\r
+$(DEST_DIR)\$(SOURCE_FV)Fv.sec : $(SOURCE_FILE_NAME)\r
+  $(GENSECTION) -I $(SOURCE_FILE_NAME) -O $(DEST_DIR)\$(SOURCE_FV)Fv.sec -S EFI_SECTION_FIRMWARE_VOLUME_IMAGE\r
+\r
+[=============================================================================]\r