3 # Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
4 # This program and the accompanying materials
5 # are licensed and made available under the terms and conditions of the BSD License
6 # which accompanies this distribution. The full text of the license may be found at
7 # http://opensource.org/licenses/bsd-license.php
9 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 # This is the build description file containing the platform
19 # independent build instructions. Platform specific instructions will
20 # be prepended to produce the final build DSC file.
25 # The info in this file is broken down into sections. The start of a section
26 # is designated by a "[" in the first column. So the [=====] separater ends
31 [=============================================================================]
33 # These get emitted at the top of the generated master makefile.
35 [=============================================================================]
38 # From the [makefile.out] section of the DSC file
43 !INCLUDE $(BUILD_DIR)\PlatformTools.env
47 [=============================================================================]
49 # These get expanded and dumped out to each component makefile after the
50 # component INF [defines] section gets parsed.
52 [=============================================================================]
55 # From the [Makefile.Common] section of the description file.
57 PROCESSOR = $(PROCESSOR)
58 BASE_NAME = $(BASE_NAME)
59 BUILD_NUMBER = $(BUILD_NUMBER)
60 VERSION_STRING = $(VERSION_STRING)
61 TOOLCHAIN = TOOLCHAIN_$(PROCESSOR)
62 FILE_GUID = $(FILE_GUID)
63 COMPONENT_TYPE = $(COMPONENT_TYPE)
64 FV_DIR = $(BUILD_DIR)\FV
65 PLATFORM = $(PROJECT_NAME)
68 # Define the global dependency files
70 !IF EXIST ($(DEST_DIR)\$(BASE_NAME)StrDefs.h)
71 INC_DEPS = $(INC_DEPS) $(DEST_DIR)\$(BASE_NAME)StrDefs.h
73 #ENV_DEPS = $(ENV_DEPS) $(EDK_SOURCE)\Sample\CommonTools.env
74 #ENV_DEPS = $(ENV_DEPS) $(BUILD_DIR)\PlatformTools.env
75 #ENV_DEPS = $(ENV_DEPS) $(BUILD_DIR)\Config.env
76 ALL_DEPS = $(INC_DEPS) $(ENV_DEPS)
78 !IF "$(LANGUAGE)" != ""
79 LANGUAGE_FLAGS = -lang $(LANGUAGE)
82 !INCLUDE $(BUILD_DIR)\PlatformTools.env
84 !IF "$(COMPONENT_TYPE)" == "PIC_PEIM" || "$(COMPONENT_TYPE)" == "PE32_PEIM" || "$(COMPONENT_TYPE)" == "RELOCATABLE_PEIM" || "$(COMPONENT_TYPE)" == "COMBINED_PEIM_DRIVER"
85 DEPEX_TYPE = EFI_SECTION_PEI_DEPEX
87 DEPEX_TYPE = EFI_SECTION_DXE_DEPEX
90 !IF "$(COMPONENT_TYPE)" != "LIBRARY" && EXIST($(BUILD_DIR)\$(PROCESSOR)\CompilerStub.lib)
91 LIBS = $(LIBS) $(BUILD_DIR)\$(PROCESSOR)\CompilerStub.lib
95 # Command flags for MAKEDEPS tool
97 DEP_FLAGS = -target $** -o $(DEP_FILE) $(INC) -ignorenotfound -q
98 DEP_FLAGS2 = -target $@ -o $(DEP_FILE) -cl
100 [=============================================================================]
102 # These are the commands to compile source files. One of these blocks gets
103 # emitted to the component's makefile for each source file. The section
104 # name is encoded as [Compile.$(PROCESSOR).source_filename_extension], where
105 # the source filename comes from the sources section of the component INF file.
107 # If the dependency list file already exists, then include it for this
108 # source file. If it doesn't exist, then this is a clean build and the
109 # dependency file will get created below and the source file will get
112 # Current behavior is that the first clean build will not create dep files.
113 # But the following second build has to create dep files before build source files.
114 # CREATEDEPS flag is used to judge whether current build is the second build or not.
117 [=============================================================================]
118 [Compile.Ia32.asm,Compile.x64.asm]
121 # Add build dependency check
123 DEP_FILE = $(DEST_DIR)\$(FILE)Asm.dep
125 !IF EXIST($(DEP_FILE))
129 !IF EXIST($(DEST_DIR)\$(FILE).obj)
130 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Asm.dep
131 !IF !EXIST($(DEP_FILE))
137 # Update dep file for next round incremental build
139 $(DEP_FILE) : $(DEST_DIR)\$(FILE).obj
140 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS) -asm
145 $(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)
146 $(ASM) $(ASM_FLAGS) $(SOURCE_FILE_NAME)
148 [=============================================================================]
149 [Compile.Ia32.c,Compile.x64.c]
152 # Add build dependency check
154 DEP_FILE = $(DEST_DIR)\$(FILE).dep
156 !IF EXIST($(DEP_FILE))
160 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
162 !IF EXIST($(DEST_DIR)\$(FILE).obj)
163 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE).dep
164 !IF !EXIST($(DEP_FILE))
170 # Update dep file for next round incremental build
172 $(DEP_FILE) : $(DEST_DIR)\$(FILE).obj
173 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)
180 $(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)
181 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
182 $(CC) $(C_FLAGS) $(SOURCE_FILE_NAME)
184 -$(CC) $(C_FLAGS) $(SOURCE_FILE_NAME) /showIncludes > $(DEST_DIR)\$(FILE).cl
185 @$(MAKEDEPS) -f $(DEST_DIR)\$(FILE).cl $(DEP_FLAGS2)
188 [=============================================================================]
192 # Add build dependency check
194 DEP_FILE = $(DEST_DIR)\$(FILE).dep
196 !IF EXIST($(DEP_FILE))
200 !IF EXIST($(DEST_DIR)\$(FILE).obj)
201 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE).dep
202 !IF !EXIST($(DEP_FILE))
208 # Update dep file for next round incremental build
210 $(DEP_FILE) : $(DEST_DIR)\$(FILE).obj
211 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)
216 $(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)
217 $(EBC_CC) $(EBC_C_FLAGS) $(SOURCE_FILE_NAME)
219 [=============================================================================]
221 # Commands for compiling a ".apr" Apriori source file.
223 [=============================================================================]
224 [Compile.Ia32.Apr,Compile.Ebc.Apr,Compile.x64.Apr]
226 # Create the raw binary file. If you get an error on the build saying it doesn't
227 # know how to create the .apr file, then you're missing (or mispelled) the
228 # "APRIORI=" on the component lines in components section in the DSC file.
230 $(DEST_DIR)\$(BASE_NAME).bin : $(SOURCE_FILE_NAME) $(INF_FILENAME)
231 $(GENAPRIORI) -v -f $(SOURCE_FILE_NAME) -o $(DEST_DIR)\$(BASE_NAME).bin
233 $(DEST_DIR)\$(BASE_NAME).sec : $(DEST_DIR)\$(BASE_NAME).bin
234 $(GENSECTION) -I $(DEST_DIR)\$(BASE_NAME).bin -O $(DEST_DIR)\$(BASE_NAME).sec -S EFI_SECTION_RAW
236 [=============================================================================]
237 [Build.Ia32.Apriori,Build.Ebc.Apriori,Build.x64.Apriori]
239 all : $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).FFS
242 # Run GenFfsFile on the package file and .raw file to create the firmware file
244 $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).FFS : $(DEST_DIR)\$(BASE_NAME).sec $(PACKAGE_FILENAME)
245 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
248 # Remove the generated temp and final files for this modules.
251 !IF ("$(FILE_GUID)" != "")
252 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
254 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
255 @del /q $(DEST_OUTPUT_DIRS)
257 [=============================================================================]
258 [Build.Ia32.Makefile,Build.Ebc.Makefile,Build.x64.Makefile]
261 # Set some required macros
263 MAKEFILE_MACROS = SOURCE_DIR=$(SOURCE_DIR) \
264 BUILD_DIR=$(BUILD_DIR) \
265 FILE_GUID=$(FILE_GUID) \
266 DEST_DIR=$(DEST_DIR) \
267 PROCESSOR=$(PROCESSOR) \
268 TOOLCHAIN=TOOLCHAIN_$(PROCESSOR) \
269 BASE_NAME=$(BASE_NAME) \
270 PACKAGE_FILENAME=$(PACKAGE_FILENAME)
273 # Just call the makefile from the source directory, passing in some
277 $(MAKE) -f $(SOURCE_DIR)\makefile.new all $(MAKEFILE_MACROS)
280 # Remove the generated temp and final files for this modules.
283 @- $(MAKE) -f $(SOURCE_DIR)\makefile.new clean $(MAKEFILE_MACROS) > NUL 2>&1
284 !IF ("$(FILE_GUID)" != "")
285 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
287 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
288 @del /q $(DEST_OUTPUT_DIRS)
290 [=============================================================================]
292 # Instructions for building a component that uses a custom makefile. Encoding
293 # is [build.$(PROCESSOR).$(BUILD_TYPE)].
295 # To build these components, simply call the makefile from the source
298 [=============================================================================]
299 [Build.Ia32.Custom_Makefile,Build.Ebc.Custom_Makefile,Build.x64.Custom_Makefile]
302 # Set some required macros
304 MAKEFILE_MACROS = SOURCE_DIR=$(SOURCE_DIR) \
305 BUILD_DIR=$(BUILD_DIR) \
306 DEST_DIR=$(DEST_DIR) \
307 FILE_GUID=$(FILE_GUID) \
308 PROCESSOR=$(PROCESSOR) \
309 TOOLCHAIN=TOOLCHAIN_$(PROCESSOR) \
310 BASE_NAME=$(BASE_NAME) \
311 PLATFORM=$(PLATFORM) \
312 SOURCE_FV=$(SOURCE_FV) \
313 PACKAGE_FILENAME=$(PACKAGE_FILENAME)
316 # Just call the makefile from the source directory, passing in some
320 $(MAKE) -f $(SOURCE_DIR)\makefile all $(MAKEFILE_MACROS)
323 # Remove the generated temp and final files for this modules.
326 @- $(MAKE) -f $(SOURCE_DIR)\makefile clean $(MAKEFILE_MACROS) > NUL 2>&1
327 !IF ("$(FILE_GUID)" != "")
328 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
330 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
331 @del /q $(DEST_OUTPUT_DIRS)
333 [=============================================================================]
335 # These commands are used to build libraries
337 [=============================================================================]
338 [Build.Ia32.LIBRARY,Build.x64.LIBRARY]
340 # LIB all the object files into to our target lib file. Put
341 # a dependency on the component's INF file in case it changes.
343 LIB_NAME = $(LIB_DIR)\$(BASE_NAME).lib
346 # $(DEP_TARGETS) are not needed for binary build.
348 !IF ("$(BINARY)" == "TRUE") || (("$(BINARY)" == "") && ("$(EFI_BINARY_LIBRARY)" == "YES"))
354 # Module can be built from source code or binary files.
356 !IF ((("$(BINARY)" == "TRUE") || (("$(BINARY)" == "") && ("$(EFI_BINARY_LIBRARY)" == "YES"))) \
357 && EXIST($(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).lib))
358 $(LIB_NAME) : $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).lib
359 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).lib $(LIB_NAME) /Y
360 if exist $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME)Obj.pdb \
361 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME)Obj.pdb $(DEST_DIR)\$(BASE_NAME)Obj.pdb /Y
363 $(LIB_NAME) : $(OBJECTS) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)
364 $(LIB) $(LIB_FLAGS) $(OBJECTS) $(LIBS) /OUT:$@
365 !IF ("$(EFI_BINARY_BUILD)" == "YES")
366 if not exist $(EFI_PLATFORM_BIN)\$(PROCESSOR) mkdir $(EFI_PLATFORM_BIN)\$(PROCESSOR)
367 if exist $(LIB_NAME) copy $(LIB_NAME) $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).lib /Y
368 if exist $(DEST_DIR)\$(BASE_NAME)Obj.pdb copy $(DEST_DIR)\$(BASE_NAME)Obj.pdb $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME)Obj.pdb /Y
372 !IF "$(CREATEDEPS)"=="YES"
374 $(MAKE) -f $(MAKEFILE_NAME) all
376 all : $(LIB_NAME) $(DEP_TARGETS)
380 # Remove the generated temp and final files for this modules.
383 !IF ("$(FILE_GUID)" != "")
384 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
386 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
387 @del /q $(DEST_OUTPUT_DIRS)
389 [=============================================================================]
392 # LIB all the object files into to our target lib file. Put
393 # a dependency on the component's INF file in case it changes.
395 LIB_NAME = $(LIB_DIR)\$(BASE_NAME).lib
397 $(LIB_NAME) : $(OBJECTS) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)
398 $(EBC_LIB) $(EBC_LIB_FLAGS) $(OBJECTS) $(LIBS) /OUT:$@
400 !IF "$(CREATEDEPS)"=="YES"
402 $(MAKE) -f $(MAKEFILE_NAME) all
404 all : $(LIB_NAME) $(DEP_TARGETS)
408 # Remove the generated temp and final files for this modules.
411 !IF ("$(FILE_GUID)" != "")
412 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
414 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
415 @del /q $(DEST_OUTPUT_DIRS)
417 [=============================================================================]
419 # This is the Build.$(PROCESSOR).$(COMPONENT_TYPE) section that tells how to
420 # convert a firmware volume into an FV FFS file. Simply run it through
421 # GenFfsFile with the appropriate package file. SOURCE_FV must be defined
422 # in the component INF file Defines section.
424 [=============================================================================]
425 [Build.Ia32.FvImageFile,Build.x64.FvImageFile]
427 all : $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).Fvi
430 # Run GenFfsFile on the package file and FV file to create the firmware
431 # volume FFS file. This FFS file maybe contain one pad section for alignment requirement.
433 $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).Fvi : $(DEST_DIR)\$(SOURCE_FV)Fv.sec $(PACKAGE_FILENAME) $(PAD_SECTION)
434 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
437 # Remove the generated temp and final files for this modules.
440 !IF ("$(FILE_GUID)" != "")
441 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
443 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
444 @del /q $(DEST_OUTPUT_DIRS)
446 [=============================================================================]
448 # Since many of the steps are the same for the different component types, we
449 # share this section for BS_DRIVER, RT_DRIVER, .... and IFDEF the parts that
450 # differ. The entire section gets dumped to the output makefile.
452 [=============================================================================]
453 [Build.Ia32.BS_DRIVER|RT_DRIVER|SAL_RT_DRIVER|PE32_PEIM|PEI_CORE|PIC_PEIM|RELOCATABLE_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]
455 !IF "$(LOCALIZE)" == "YES"
457 !IF (("$(EFI_GENERATE_HII_RESOURCE)" == "YES") && ("$(EFI_SPECIFICATION_VERSION)" >= "0x0002000A"))
459 # This will generate HII resource section in PE/COFF image.
461 # Note: when HII package list is built into resource section, Driver no longer
462 # refer to C array generated by VfrCompiler ($(FILE_NAME)Bin) and StrGather
463 # ($(BASE_NAME)Strings); while in current build rule, those C array objects
464 # will still be linked with the Driver, so please turn on link flag "/OPT:REF"
465 # to minimize the code size.
467 HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(BASE_NAME)Strings.hpk
468 LOCALIZE_TARGETS = $(LOCALIZE_TARGETS) $(DEST_DIR)\$(BASE_NAME).res
469 LINK_FLAGS_DLL = $(LINK_FLAGS_DLL) $(DEST_DIR)\$(BASE_NAME).res
471 $(DEST_DIR)\$(BASE_NAME).rc : $(HII_PACK_FILES)
472 $(HIIPACK) -g $(FILE_GUID) $(HII_PACK_FILES) -rc $(DEST_DIR)\$(BASE_NAME).rc -hii $(DEST_DIR)\$(BASE_NAME).hii
474 $(DEST_DIR)\$(BASE_NAME).res : $(DEST_DIR)\$(BASE_NAME).rc
475 $(RC) /fo $(DEST_DIR)\$(BASE_NAME).res $(DEST_DIR)\$(BASE_NAME).rc
479 !IF (("$(EFI_GENERATE_HII_EXPORT)" == "YES") && ("$(EFI_SPECIFICATION_VERSION)" < "0x0002000A"))
481 # There will be one HII pack containing all the strings. Add that file
482 # to the list of HII pack files we'll use to create our final HII export file.
484 HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(BASE_NAME)Strings.hpk
485 LOCALIZE_TARGETS = $(LOCALIZE_TARGETS) $(DEST_DIR)\$(BASE_NAME).hii
488 !IF ("$(EFI_SPECIFICATION_VERSION)" >= "0x0002000A")
490 # Note: currently -ppflag option is only available for UefiStrGather
491 # Note: /GS- will cause warning for preprocess, so filter it out from STRGATHER_PPFLAG
493 STRGATHER_PPFLAG = $(C_FLAGS: /GS-=)
494 STRGATHER_FLAGS = $(STRGATHER_FLAGS) -ppflag "$(STRGATHER_PPFLAG)" -oh $(DEST_DIR)\$(BASE_NAME)StrDefs.h
497 $(DEST_DIR)\$(BASE_NAME).sdb : $(SDB_FILES) $(SOURCE_FILES)
498 $(STRGATHER) -scan -vdbr $(STRGATHER_FLAGS) -od $(DEST_DIR)\$(BASE_NAME).sdb \
499 -skipext .uni -skipext .h $(SOURCE_FILES)
501 $(DEST_DIR)\$(BASE_NAME)Strings.c : $(DEST_DIR)\$(BASE_NAME).sdb
502 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \
503 -oc $(DEST_DIR)\$(BASE_NAME)Strings.c
505 $(DEST_DIR)\$(BASE_NAME)StrDefs.h : $(DEST_DIR)\$(BASE_NAME).sdb
506 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \
507 -oh $(DEST_DIR)\$(BASE_NAME)StrDefs.h
509 $(DEST_DIR)\$(BASE_NAME)Strings.hpk : $(DEST_DIR)\$(BASE_NAME).sdb
510 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \
511 -hpk $(DEST_DIR)\$(BASE_NAME)Strings.hpk
513 OBJECTS = $(OBJECTS) $(DEST_DIR)\$(BASE_NAME)Strings.obj
515 $(DEST_DIR)\$(BASE_NAME)Strings.obj : $(DEST_DIR)\$(BASE_NAME)Strings.c $(INF_FILENAME) $(ALL_DEPS)
516 $(CC) $(C_FLAGS) $(DEST_DIR)\$(BASE_NAME)Strings.c
518 LOCALIZE_TARGETS = $(DEST_DIR)\$(BASE_NAME)StrDefs.h $(LOCALIZE_TARGETS)
523 # If we have any objects associated with this component, then we're
524 # going to build a local library from them.
527 !ERROR No source files to build were defined in the INF file
530 TARGET_LOCAL_LIB = $(DEST_DIR)\$(BASE_NAME)Local.lib
533 # LIB all the object files into our (local) target lib file. Put
534 # a dependency on the component's INF file in case it changes.
536 $(TARGET_LOCAL_LIB) : $(OBJECTS) $(INF_FILENAME) $(ENV_DEPS)
537 $(LIB) $(LIB_FLAGS) $(OBJECTS) /OUT:$@
540 # Defines for standard intermediate files and build targets
542 TARGET_DLL = $(BIN_DIR)\$(BASE_NAME).dll
543 TARGET_EFI = $(BIN_DIR)\$(BASE_NAME).efi
544 TARGET_DPX = $(DEST_DIR)\$(BASE_NAME).dpx
545 TARGET_UI = $(DEST_DIR)\$(BASE_NAME).ui
546 TARGET_VER = $(DEST_DIR)\$(BASE_NAME).ver
547 TARGET_MAP = $(BIN_DIR)\$(BASE_NAME).map
548 TARGET_PDB = $(BIN_DIR)\$(BASE_NAME).pdb
549 TARGET_SYM = $(BIN_DIR)\$(BASE_NAME).sym
552 # Target executable section extension depends on the component type.
553 # Only define "TARGET_DXE_DPX" if it's a combined peim driver.
555 !IF "$(COMPONENT_TYPE)" == "PIC_PEIM"
556 TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pic
558 TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pe32
562 # Target FFS file extension depends on the component type
563 # Also define "TARGET_DXE_DPX" if it's a combined PEIM driver.
565 SUBSYSTEM = EFI_BOOT_SERVICE_DRIVER
567 !IF "$(COMPONENT_TYPE)" == "APPLICATION"
568 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).app
569 SUBSYSTEM = EFI_APPLICATION
570 !ELSE IF "$(COMPONENT_TYPE)" == "PEI_CORE"
571 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei
572 !ELSE IF "$(COMPONENT_TYPE)" == "PE32_PEIM"
573 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei
574 !ELSE IF "$(COMPONENT_TYPE)" == "RELOCATABLE_PEIM"
575 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei
576 !ELSE IF "$(COMPONENT_TYPE)" == "PIC_PEIM"
577 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei
578 !ELSE IF "$(COMPONENT_TYPE)" == "COMBINED_PEIM_DRIVER"
579 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei
580 TARGET_DXE_DPX = $(DEST_DIR)\$(BASE_NAME).dpxd
582 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).dxe
586 # Different methods to build section based on if PIC_PEIM
588 !IF "$(COMPONENT_TYPE)" == "PIC_PEIM"
590 $(TARGET_PE32) : $(TARGET_DLL)
591 $(PE2BIN) $(TARGET_DLL) $(DEST_DIR)\$(BASE_NAME).TMP
593 # BUGBUG: Build PEIM header, needs to go away with new PEI.
595 $(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
596 $(GENSECTION) -I $(TARGET_PIC_PEI).tmp -O $(TARGET_PE32) -S EFI_SECTION_PIC
597 del $(DEST_DIR)\$(BASE_NAME).TMP
601 $(TARGET_PE32) : $(TARGET_EFI)
602 $(GENSECTION) -I $(TARGET_EFI) -O $(TARGET_PE32) -S EFI_SECTION_PE32
605 # $(DEP_TARGETS) are not needed for binary build.
607 !IF "$(BINARY)" == "TRUE"
613 # Build module to generate *.efi file from source code or binary file.
615 !IF (("$(BINARY)" == "TRUE") && EXIST($(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi))
617 $(TARGET_EFI) : $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi
618 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi $(TARGET_EFI) /Y
619 if exist $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb \
620 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb $(TARGET_PDB) /Y
622 $(TARGET_EFI) : $(TARGET_DLL) $(INF_FILENAME)
623 $(FWIMAGE) -t 0 $(COMPONENT_TYPE) $(TARGET_DLL) $(TARGET_EFI)
624 !IF ("$(EFI_BINARY_BUILD)" == "YES")
625 if not exist $(EFI_PLATFORM_BIN)\$(PROCESSOR) mkdir $(EFI_PLATFORM_BIN)\$(PROCESSOR)
626 if exist $(TARGET_EFI) copy $(TARGET_EFI) $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi /Y
627 if exist $(TARGET_PDB) copy $(TARGET_PDB) $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb /Y
634 # Link all objects and libs to create the executable
636 $(TARGET_DLL) : $(TARGET_LOCAL_LIB) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)
637 $(LINK) $(LINK_FLAGS_DLL) $(LIBS) /ENTRY:$(IMAGE_ENTRY_POINT) \
638 $(TARGET_LOCAL_LIB) /OUT:$(TARGET_DLL) /MAP:$(TARGET_MAP) \
640 $(SETSTAMP) $(TARGET_DLL) $(BUILD_DIR)\GenStamp.txt
641 !IF "$(EFI_GENERATE_SYM_FILE)" == "YES"
642 if exist $(TARGET_PDB) $(PE2SYM) $(TARGET_PDB) $(TARGET_SYM)
645 !IF "$(EFI_ZERO_DEBUG_DATA)" == "YES"
646 $(ZERODEBUGDATA) $(TARGET_DLL)
650 # Create the user interface section
652 $(TARGET_UI) : $(INF_FILENAME)
653 $(GENSECTION) -O $(TARGET_UI) -S EFI_SECTION_USER_INTERFACE -A "$(BASE_NAME)"
656 # Create the version section
658 !IF "$(BUILD_NUMBER)" != ""
659 !IF "$(VERSION_STRING)" != ""
660 $(TARGET_VER) : $(INF_FILENAME)
661 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER) -A "$(VERSION_STRING)"
663 $(TARGET_VER) : $(INF_FILENAME)
664 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER)
667 $(TARGET_VER) : $(INF_FILENAME)
669 type $(TARGET_VER)>$(TARGET_VER)
673 # Makefile entries to create the dependency expression section.
674 # Use the DPX file from the source directory unless an override file
676 # If no DPX source file was specified, then create an empty file to
679 !IF "$(DPX_SOURCE)" != ""
680 DPX_SOURCE_FILE = $(SOURCE_DIR)\$(DPX_SOURCE)
683 !IF "$(DPX_SOURCE_OVERRIDE)" != ""
684 DPX_SOURCE_FILE = $(DPX_SOURCE_OVERRIDE)
687 !IF "$(DPX_SOURCE_FILE)" != ""
688 !IF EXIST ($(DPX_SOURCE_FILE))
691 # Add build dependency check
693 DEP_FILE = $(DEST_DIR)\$(BASE_NAME)dxs.dep
695 !IF EXIST($(DEP_FILE))
699 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
701 !IF EXIST($(TARGET_DPX))
702 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs.dep
703 !IF !EXIST($(DEP_FILE))
709 # Update dep file for next round incremental build
711 $(DEP_FILE) : $(TARGET_DPX)
712 $(MAKEDEPS) -f $(DPX_SOURCE_FILE) $(DEP_FLAGS)
716 $(TARGET_DPX) : $(DPX_SOURCE_FILE) $(INF_FILENAME)
717 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
718 $(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) > $*.tmp1
720 -$(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) /showIncludes > $*.tmp1 2> $(DEST_DIR)\$(BASE_NAME)dxs.cl
721 @$(MAKEDEPS) -f $(DEST_DIR)\$(BASE_NAME)dxs.cl $(DEP_FLAGS2)
723 $(GENDEPEX) -I $*.tmp1 -O $*.tmp2
724 $(GENSECTION) -I $*.tmp2 -O $@ -S $(DEPEX_TYPE)
728 !ERROR Dependency expression source file "$(DPX_SOURCE_FILE)" does not exist.
731 $(TARGET_DPX) : $(INF_FILENAME)
732 echo. > $(TARGET_DPX)
733 type $(TARGET_DPX) > $(TARGET_DPX)
737 # Makefile entries for DXE DPX for combined PEIM drivers.
738 # If a DXE_DPX_SOURCE file was specified in the INF file, use it. Otherwise
739 # create an empty file and use it as a DPX file.
741 !IF "$(COMPONENT_TYPE)" == "COMBINED_PEIM_DRIVER"
742 !IF "$(DXE_DPX_SOURCE)" != ""
743 !IF EXIST ($(SOURCE_DIR)\$(DXE_DPX_SOURCE))
746 # Add build dependency check
748 DEP_FILE = $(DEST_DIR)\$(BASE_NAME)dxs2.dep
750 !IF EXIST($(DEP_FILE))
754 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
756 !IF EXIST($(TARGET_DXE_DPX))
757 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs2.dep
758 !IF !EXIST($(DEP_FILE))
764 # Update dep file for next round incremental build
766 $(DEP_FILE) : $(TARGET_DXE_DPX)
767 $(MAKEDEPS) -f $(SOURCE_DIR)\$(DXE_DPX_SOURCE) $(DEP_FLAGS)
771 $(TARGET_DXE_DPX) : $(SOURCE_DIR)\$(DXE_DPX_SOURCE) $(INF_FILENAME)
772 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
773 $(CC) $(C_FLAGS_DPX) $(SOURCE_DIR)\$(DXE_DPX_SOURCE) > $*.tmp1
775 -$(CC) $(C_FLAGS_DPX) $(SOURCE_DIR)\$(DXE_DPX_SOURCE) /showIncludes > $*.tmp1 2> $(DEST_DIR)\$(BASE_NAME)dxs2.cl
776 @$(MAKEDEPS) -f $(DEST_DIR)\$(BASE_NAME)dxs2.cl $(DEP_FLAGS2)
778 $(GENDEPEX) -I $*.tmp1 -O $*.tmp2
779 $(GENSECTION) -I $*.tmp2 -O $@ -S EFI_SECTION_DXE_DEPEX
783 !ERROR Dependency expression source file "$(SOURCE_DIR)\$(DXE_DPX_SOURCE)" does not exist.
786 $(TARGET_DXE_DPX) : $(INF_FILENAME)
787 echo. > $(TARGET_DXE_DPX)
788 type $(TARGET_DXE_DPX) > $(TARGET_DXE_DPX)
793 # Describe how to build the HII export file from all the input HII pack files.
794 # Use the FFS file GUID for the package GUID in the export file. Only used
795 # when multiple VFR share strings.
797 $(DEST_DIR)\$(BASE_NAME).hii : $(HII_PACK_FILES)
798 $(HIIPACK) create -g $(FILE_GUID) -p $(HII_PACK_FILES) -o $(DEST_DIR)\$(BASE_NAME).hii
801 # If the build calls for creating an FFS file with the IFR included as
802 # a separate binary (not compiled into the driver), then build the binary
803 # section now. Note that the PACKAGE must be set correctly to actually get
804 # this IFR section pulled into the FFS file.
806 !IF ("$(HII_IFR_PACK_FILES)" != "")
808 $(DEST_DIR)\$(BASE_NAME)IfrBin.sec : $(HII_IFR_PACK_FILES)
809 $(HIIPACK) create -novarpacks -p $(HII_IFR_PACK_FILES) -o $(DEST_DIR)\$(BASE_NAME)IfrBin.hii
810 $(GENSECTION) -I $(DEST_DIR)\$(BASE_NAME)IfrBin.hii -O $(DEST_DIR)\$(BASE_NAME)IfrBin.sec -S EFI_SECTION_RAW
812 BIN_TARGETS = $(BIN_TARGETS) $(DEST_DIR)\$(BASE_NAME)IfrBin.sec
817 # Build a FFS file from the sections and package
819 $(TARGET_FFS_FILE) : $(TARGET_PE32) $(TARGET_DPX) $(TARGET_UI) $(TARGET_VER) $(TARGET_DXE_DPX) $(PACKAGE_FILENAME)
821 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
823 !IF "$(CREATEDEPS)"=="YES"
825 $(MAKE) -f $(MAKEFILE_NAME) all
827 all : $(LOCALIZE_TARGETS) $(BIN_TARGETS) $(TARGET_FFS_FILE) $(DEP_TARGETS)
831 # Remove the generated temp and final files for this modules.
834 !IF ("$(FILE_GUID)" != "")
835 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
837 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
838 @del /q $(DEST_OUTPUT_DIRS)
840 [=============================================================================]
841 [Build.Ia32.TE_PEIM,Build.x64.TE_PEIM]
843 # Define the library file we'll build if we have any objects defined.
846 TARGET_LOCAL_LIB = $(DEST_DIR)\$(BASE_NAME)Local.lib
848 # LIB all the object files into our (local) target lib file. Put
849 # a dependency on the component's INF file in case it changes.
851 $(TARGET_LOCAL_LIB) : $(OBJECTS) $(INF_FILENAME) $(ENV_DEPS)
852 $(LIB) $(LIB_FLAGS) $(OBJECTS) /OUT:$@
855 !ERROR No source files to build were defined in the INF file
859 # Defines for standard intermediate files and build targets
861 TARGET_DLL = $(BIN_DIR)\$(BASE_NAME).dll
862 TARGET_EFI = $(BIN_DIR)\$(BASE_NAME).efi
863 TARGET_DPX = $(DEST_DIR)\$(BASE_NAME).dpx
864 TARGET_UI = $(DEST_DIR)\$(BASE_NAME).ui
865 TARGET_VER = $(DEST_DIR)\$(BASE_NAME).ver
866 TARGET_MAP = $(BIN_DIR)\$(BASE_NAME).map
867 TARGET_PDB = $(BIN_DIR)\$(BASE_NAME).pdb
868 TARGET_SYM = $(BIN_DIR)\$(BASE_NAME).sym
869 TARGET_TE = $(BIN_DIR)\$(BASE_NAME).te
870 TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pe32
871 TARGET_TES = $(DEST_DIR)\$(BASE_NAME).tes
872 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei
875 # Create our TE section from our TE file
877 $(TARGET_TES) : $(TARGET_TE)
878 $(GENSECTION) -I $(TARGET_TE) -O $(TARGET_TES) -S EFI_SECTION_TE
881 # $(DEP_TARGETS) are not needed for binary build.
883 !IF "$(BINARY)" == "TRUE"
889 # Build module to generate *.efi file from source code or binary file.
891 !IF (("$(BINARY)" == "TRUE") && EXIST($(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi))
892 $(TARGET_EFI) : $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi
893 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi $(TARGET_EFI) /Y
894 if exist $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb \
895 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb $(TARGET_PDB) /Y
897 $(TARGET_EFI) : $(TARGET_DLL) $(INF_FILENAME)
898 $(FWIMAGE) $(COMPONENT_TYPE) $(TARGET_DLL) $(TARGET_EFI)
899 !IF ("$(EFI_BINARY_BUILD)" == "YES")
900 if not exist $(EFI_PLATFORM_BIN)\$(PROCESSOR) mkdir $(EFI_PLATFORM_BIN)\$(PROCESSOR)
901 if exist $(TARGET_EFI) copy $(TARGET_EFI) $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi /Y
902 if exist $(TARGET_PDB) copy $(TARGET_PDB) $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb /Y
907 # Run GenTEImage on the built .efi file to create our TE file.
909 $(TARGET_TE) : $(TARGET_EFI)
910 $(GENTEIMAGE) -o $(TARGET_TE) $(TARGET_EFI)
913 # Link all objects and libs to create the executable
915 $(TARGET_DLL) : $(TARGET_LOCAL_LIB) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)
916 $(LINK) $(LINK_FLAGS_DLL) $(LIBS) /ENTRY:$(IMAGE_ENTRY_POINT) \
917 $(TARGET_LOCAL_LIB) /OUT:$(TARGET_DLL) /MAP:$(TARGET_MAP) \
919 $(SETSTAMP) $(TARGET_DLL) $(BUILD_DIR)\GenStamp.txt
920 !IF "$(EFI_GENERATE_SYM_FILE)" == "YES"
921 if exist $(TARGET_PDB) $(PE2SYM) $(TARGET_PDB) $(TARGET_SYM)
924 !IF "$(EFI_ZERO_DEBUG_DATA)" == "YES"
925 $(ZERODEBUGDATA) $(TARGET_DLL)
929 # Create the user interface section
931 $(TARGET_UI) : $(INF_FILENAME)
932 $(GENSECTION) -O $(TARGET_UI) -S EFI_SECTION_USER_INTERFACE -A "$(BASE_NAME)"
935 # Create the version section
937 !IF "$(BUILD_NUMBER)" != ""
938 !IF "$(VERSION_STRING)" != ""
939 $(TARGET_VER) : $(INF_FILENAME)
940 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER) -A "$(VERSION_STRING)"
942 $(TARGET_VER) : $(INF_FILENAME)
943 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER)
946 $(TARGET_VER) : $(INF_FILENAME)
948 type $(TARGET_VER)>$(TARGET_VER)
952 # Makefile entries to create the dependency expression section.
953 # Use the DPX file from the source directory unless an override file
955 # If no DPX source file was specified, then create an empty file to
958 !IF "$(DPX_SOURCE)" != ""
959 DPX_SOURCE_FILE = $(SOURCE_DIR)\$(DPX_SOURCE)
962 !IF "$(DPX_SOURCE_OVERRIDE)" != ""
963 DPX_SOURCE_FILE = $(DPX_SOURCE_OVERRIDE)
966 !IF "$(DPX_SOURCE_FILE)" != ""
967 !IF EXIST ($(DPX_SOURCE_FILE))
970 # Add build dependency check
972 DEP_FILE = $(DEST_DIR)\$(BASE_NAME)dxs.dep
974 !IF EXIST($(DEP_FILE))
978 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
980 !IF EXIST($(TARGET_DPX))
981 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs.dep
982 !IF !EXIST($(DEP_FILE))
988 # Update dep file for next round incremental build
990 $(DEP_FILE) : $(TARGET_DPX)
991 $(MAKEDEPS) -f $(DPX_SOURCE_FILE) $(DEP_FLAGS)
995 $(TARGET_DPX) : $(DPX_SOURCE_FILE) $(INF_FILENAME)
996 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
997 $(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) > $*.tmp1
999 -$(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) /showIncludes > $*.tmp1 2> $(DEST_DIR)\$(BASE_NAME)dxs.cl
1000 @$(MAKEDEPS) -f $(DEST_DIR)\$(BASE_NAME)dxs.cl $(DEP_FLAGS2)
1002 $(GENDEPEX) -I $*.tmp1 -O $*.tmp2
1003 $(GENSECTION) -I $*.tmp2 -O $@ -S $(DEPEX_TYPE)
1007 !ERROR Dependency expression source file "$(DPX_SOURCE_FILE)" does not exist.
1010 $(TARGET_DPX) : $(INF_FILENAME)
1011 echo. > $(TARGET_DPX)
1012 type $(TARGET_DPX) > $(TARGET_DPX)
1016 # Build an FFS file from the sections and package
1018 $(TARGET_FFS_FILE) : $(TARGET_TES) $(TARGET_DPX) $(TARGET_UI) $(TARGET_VER) $(PACKAGE_FILENAME)
1019 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
1021 !IF "$(CREATEDEPS)"=="YES"
1022 all : $(DEP_TARGETS)
1023 $(MAKE) -f $(MAKEFILE_NAME) all
1025 all : $(TARGET_FFS_FILE) $(DEP_TARGETS)
1029 # Remove the generated temp and final files for this modules.
1032 !IF ("$(FILE_GUID)" != "")
1033 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
1035 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
1036 @del /q $(DEST_OUTPUT_DIRS)
1038 [=============================================================================]
1040 # These are the commands to build EBC EFI targets
1042 [=============================================================================]
1043 [Build.Ebc.BS_DRIVER|RT_DRIVER|APPLICATION]
1046 # Add the EBC library to our list of libs
1048 LIBS = $(LIBS) $(EBC_TOOLS_PATH)\lib\EbcLib.lib
1050 !IF "$(LOCALIZE)" == "YES"
1052 !IF (("$(EFI_GENERATE_HII_RESOURCE)" == "YES") && ("$(EFI_SPECIFICATION_VERSION)" >= "0x0002000A"))
1054 # This will generate HII resource section in PE/COFF image.
1056 # Note: when HII package list is built into resource section, Driver no longer
1057 # refer to C array generated by VfrCompiler ($(FILE_NAME)Bin) and StrGather
1058 # ($(BASE_NAME)Strings); while in current build rule, those C array objects
1059 # will still be linked with the Driver, so please turn on link flag "/OPT:REF"
1060 # to minimize the code size.
1062 HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(BASE_NAME)Strings.hpk
1063 LOCALIZE_TARGETS = $(LOCALIZE_TARGETS) $(DEST_DIR)\$(BASE_NAME).res
1064 OBJECTS = $(OBJECTS) $(DEST_DIR)\$(BASE_NAME).res
1066 $(DEST_DIR)\$(BASE_NAME).rc : $(HII_PACK_FILES)
1067 $(HIIPACK) -g $(FILE_GUID) $(HII_PACK_FILES) -rc $(DEST_DIR)\$(BASE_NAME).rc -hii $(DEST_DIR)\$(BASE_NAME).hii
1069 $(DEST_DIR)\$(BASE_NAME).res : $(DEST_DIR)\$(BASE_NAME).rc
1070 $(RC) /fo $(DEST_DIR)\$(BASE_NAME).res $(DEST_DIR)\$(BASE_NAME).rc
1074 !IF (("$(EFI_GENERATE_HII_EXPORT)" == "YES") && ("$(EFI_SPECIFICATION_VERSION)" < "0x0002000A"))
1076 # There will be one HII pack containing all the strings. Add that file
1077 # to the list of HII pack files we'll use to create our final HII export file.
1079 HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(BASE_NAME)Strings.hpk
1081 LOCALIZE_TARGETS = $(LOCALIZE_TARGETS) $(DEST_DIR)\$(BASE_NAME).hii
1084 !IF ("$(EFI_SPECIFICATION_VERSION)" >= "0x0002000A")
1086 # Note: currently -ppflag option is only available for UefiStrGather
1087 # Note: /GS- will cause warning for preprocess, so filter it out from STRGATHER_PPFLAG
1089 STRGATHER_PPFLAG = $(EBC_C_FLAGS: /GS-=)
1090 STRGATHER_FLAGS = $(STRGATHER_FLAGS) -ppflag "$(STRGATHER_PPFLAG)" -oh $(DEST_DIR)\$(BASE_NAME)StrDefs.h
1093 $(DEST_DIR)\$(BASE_NAME).sdb : $(SDB_FILES) $(SOURCE_FILES)
1094 $(STRGATHER) -scan -vdbr $(STRGATHER_FLAGS) -od $(DEST_DIR)\$(BASE_NAME).sdb \
1095 -skipext .uni -skipext .h $(SOURCE_FILES)
1097 $(DEST_DIR)\$(BASE_NAME)Strings.c : $(DEST_DIR)\$(BASE_NAME).sdb
1098 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \
1099 -oc $(DEST_DIR)\$(BASE_NAME)Strings.c
1101 $(DEST_DIR)\$(BASE_NAME)StrDefs.h : $(DEST_DIR)\$(BASE_NAME).sdb
1102 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \
1103 -oh $(DEST_DIR)\$(BASE_NAME)StrDefs.h
1105 $(DEST_DIR)\$(BASE_NAME)Strings.hpk : $(DEST_DIR)\$(BASE_NAME).sdb
1106 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \
1107 -hpk $(DEST_DIR)\$(BASE_NAME)Strings.hpk
1109 OBJECTS = $(OBJECTS) $(DEST_DIR)\$(BASE_NAME)Strings.obj
1111 $(DEST_DIR)\$(BASE_NAME)Strings.obj : $(DEST_DIR)\$(BASE_NAME)Strings.c $(INF_FILENAME) $(ALL_DEPS)
1112 $(EBC_CC) $(EBC_C_FLAGS) $(DEST_DIR)\$(BASE_NAME)Strings.c
1114 LOCALIZE_TARGETS = $(DEST_DIR)\$(BASE_NAME)StrDefs.h $(LOCALIZE_TARGETS)
1119 # If building an application, then the target is a .app, not .dxe
1121 !IF "$(COMPONENT_TYPE)" == "APPLICATION"
1122 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).app
1123 SUBSYSTEM = EFI_APPLICATION
1125 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).dxe
1126 SUBSYSTEM = EFI_BOOT_SERVICE_DRIVER
1130 # Defines for standard intermediate files and build targets
1132 TARGET_EFI = $(BIN_DIR)\$(BASE_NAME).efi
1133 TARGET_DPX = $(DEST_DIR)\$(BASE_NAME).dpx
1134 TARGET_UI = $(DEST_DIR)\$(BASE_NAME).ui
1135 TARGET_VER = $(DEST_DIR)\$(BASE_NAME).ver
1136 TARGET_MAP = $(BIN_DIR)\$(BASE_NAME).map
1137 TARGET_PDB = $(BIN_DIR)\$(BASE_NAME).pdb
1138 TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pe32
1139 TARGET_DLL = $(BIN_DIR)\$(BASE_NAME).dll
1142 # First link all the objects and libs together to make a .dll file
1144 $(TARGET_DLL) : $(OBJECTS) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)
1145 $(EBC_LINK) $(EBC_LINK_FLAGS) /SUBSYSTEM:$(SUBSYSTEM) /ENTRY:EfiStart \
1146 $(OBJECTS) $(LIBS) /OUT:$(TARGET_DLL) /MAP:$(TARGET_MAP)
1147 $(SETSTAMP) $(TARGET_DLL) $(BUILD_DIR)\GenStamp.txt
1148 !IF "$(EFI_ZERO_DEBUG_DATA)" == "YES"
1149 $(ZERODEBUGDATA) $(TARGET_DLL)
1153 # Now take the .dll file and make a .efi file
1155 $(TARGET_EFI) : $(TARGET_DLL) $(INF_FILENAME)
1156 $(FWIMAGE) -t 0 $(COMPONENT_TYPE) $(TARGET_DLL) $(TARGET_EFI)
1159 # Now take the .efi file and make a .pe32 section
1161 $(TARGET_PE32) : $(TARGET_EFI)
1162 $(GENSECTION) -I $(TARGET_EFI) -O $(TARGET_PE32) -S EFI_SECTION_PE32
1165 # Create the user interface section
1167 $(TARGET_UI) : $(INF_FILENAME)
1168 $(GENSECTION) -O $(TARGET_UI) -S EFI_SECTION_USER_INTERFACE -A "$(BASE_NAME)"
1171 # Create the version section
1173 !IF "$(BUILD_NUMBER)" != ""
1174 !IF "$(VERSION_STRING)" != ""
1175 $(TARGET_VER) : $(INF_FILENAME)
1176 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER) -A "$(VERSION_STRING)"
1178 $(TARGET_VER) : $(INF_FILENAME)
1179 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER)
1182 $(TARGET_VER) : $(INF_FILENAME)
1183 echo. > $(TARGET_VER)
1184 type $(TARGET_VER) > $(TARGET_VER)
1188 # Makefile entries to create the dependency expression section.
1189 # Use the DPX file from the source directory unless an override file
1191 # If no DPX source file was specified, then create an empty file to
1194 !IF "$(DPX_SOURCE)" != ""
1195 DPX_SOURCE_FILE = $(SOURCE_DIR)\$(DPX_SOURCE)
1198 !IF "$(DPX_SOURCE_OVERRIDE)" != ""
1199 DPX_SOURCE_FILE = $(DPX_SOURCE_OVERRIDE)
1202 !IF "$(DPX_SOURCE_FILE)" != ""
1203 !IF EXIST ($(DPX_SOURCE_FILE))
1206 # Add build dependency check
1208 DEP_FILE = $(DEST_DIR)\$(BASE_NAME)dxs.dep
1210 !IF EXIST($(DEP_FILE))
1211 !INCLUDE $(DEP_FILE)
1214 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
1216 !IF EXIST($(TARGET_DPX))
1217 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs.dep
1218 !IF !EXIST($(DEP_FILE))
1224 # Update dep file for next round incremental build
1226 $(DEP_FILE) : $(TARGET_DPX)
1227 $(MAKEDEPS) -f $(DPX_SOURCE_FILE) $(DEP_FLAGS)
1231 $(TARGET_DPX) : $(DPX_SOURCE_FILE) $(INF_FILENAME)
1232 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
1233 $(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) > $*.tmp1
1235 -$(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) /showIncludes > $*.tmp1 2> $(DEST_DIR)\$(BASE_NAME)dxs.cl
1236 @$(MAKEDEPS) -f $(DEST_DIR)\$(BASE_NAME)dxs.cl $(DEP_FLAGS2)
1238 $(GENDEPEX) -I $*.tmp1 -O $*.tmp2
1239 $(GENSECTION) -I $*.tmp2 -O $@ -S $(DEPEX_TYPE)
1243 !ERROR Dependency expression source file "$(DPX_SOURCE_FILE)" does not exist.
1246 $(TARGET_DPX) : $(INF_FILENAME)
1247 echo. > $(TARGET_DPX)
1248 type $(TARGET_DPX) > $(TARGET_DPX)
1252 # Describe how to build the HII export file from all the input HII pack files.
1253 # Use the FFS file GUID for the package GUID in the export file. Only used
1254 # when multiple VFR share strings.
1256 $(DEST_DIR)\$(BASE_NAME).hii : $(HII_PACK_FILES)
1257 $(HIIPACK) create -g $(FILE_GUID) -p $(HII_PACK_FILES) -o $(DEST_DIR)\$(BASE_NAME).hii
1260 # If the build calls for creating an FFS file with the IFR included as
1261 # a separate binary (not compiled into the driver), then build the binary
1262 # section now. Note that the PACKAGE must be set correctly to actually get
1263 # this IFR section pulled into the FFS file.
1265 !IF ("$(HII_IFR_PACK_FILES)" != "")
1267 $(DEST_DIR)\$(BASE_NAME)IfrBin.sec : $(HII_IFR_PACK_FILES)
1268 $(HIIPACK) create -novarpacks -p $(HII_IFR_PACK_FILES) -o $(DEST_DIR)\$(BASE_NAME)IfrBin.hii
1269 $(GENSECTION) -I $(DEST_DIR)\$(BASE_NAME)IfrBin.hii -O $(DEST_DIR)\$(BASE_NAME)IfrBin.sec -S EFI_SECTION_RAW
1271 BIN_TARGETS = $(BIN_TARGETS) $(DEST_DIR)\$(BASE_NAME)IfrBin.sec
1276 # Build an FFS file from the sections and package
1278 $(TARGET_FFS_FILE) : $(TARGET_PE32) $(TARGET_DPX) $(TARGET_UI) $(TARGET_VER) $(PACKAGE_FILENAME)
1279 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
1281 !IF "$(CREATEDEPS)"=="YES"
1282 all : $(DEP_TARGETS)
1283 $(MAKE) -f $(MAKEFILE_NAME) all
1285 all : $(LOCALIZE_TARGETS) $(BIN_TARGETS) $(TARGET_FFS_FILE) $(DEP_TARGETS)
1289 # Remove the generated temp and final files for this modules.
1292 !IF ("$(FILE_GUID)" != "")
1293 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
1295 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
1296 @del /q $(DEST_OUTPUT_DIRS)
1298 [=============================================================================]
1300 # These are the commands to build vendor-provided *.EFI files into an FV.
1301 # To use them, create an INF file with BUILD_TYPE=BS_DRIVER_EFI.
1302 # This section, as it now exists, only supports boot service drivers.
1304 [=============================================================================]
1305 [Build.Ia32.BS_DRIVER_EFI|RT_DRIVER_EFI|APPLICATION_EFI|PE32_PEIM_EFI,Build.x64.BS_DRIVER_EFI|RT_DRIVER_EFI|APPLICATION_EFI|PE32_PEIM_EFI]
1307 # Defines for standard intermediate files and build targets. For the source
1308 # .efi file, take the one in the source directory if it exists. If there's not
1309 # one there, look for one in the processor-specfic subdirectory.
1311 !IF EXIST ("$(SOURCE_DIR)\$(BASE_NAME).efi")
1312 TARGET_EFI = $(SOURCE_DIR)\$(BASE_NAME).efi
1313 !ELSEIF EXIST ("$(SOURCE_DIR)\$(PROCESSOR)\$(BASE_NAME).efi")
1314 TARGET_EFI = $(SOURCE_DIR)\$(PROCESSOR)\$(BASE_NAME).efi
1316 !ERROR Pre-existing $(BASE_NAME).efi file not found in $(SOURCE_DIR) nor $(SOURCE_DIR)\$(PROCESSOR)
1319 TARGET_DPX = $(DEST_DIR)\$(BASE_NAME).dpx
1320 TARGET_UI = $(DEST_DIR)\$(BASE_NAME).ui
1321 TARGET_VER = $(DEST_DIR)\$(BASE_NAME).ver
1322 TARGET_MAP = $(BIN_DIR)\$(BASE_NAME).map
1323 TARGET_PDB = $(BIN_DIR)\$(BASE_NAME).pdb
1324 TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pe32
1325 TARGET_DLL = $(BIN_DIR)\$(BASE_NAME).dll
1328 # If building an application, then the target is a .app, not .dxe
1330 !IF "$(COMPONENT_TYPE)" == "APPLICATION"
1331 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).app
1332 !ELSE IF "$(COMPONENT_TYPE)" == "PE32_PEIM"
1333 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei
1335 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).dxe
1339 # Take the .efi file and make a .pe32 file
1341 $(TARGET_PE32) : $(TARGET_EFI)
1342 $(GENSECTION) -I $(TARGET_EFI) -O $(TARGET_PE32) -S EFI_SECTION_PE32
1345 # Create the user interface section
1347 $(TARGET_UI) : $(INF_FILENAME)
1348 $(GENSECTION) -O $(TARGET_UI) -S EFI_SECTION_USER_INTERFACE -A "$(BASE_NAME)"
1351 # Create the version section
1353 !IF "$(BUILD_NUMBER)" != ""
1354 !IF "$(VERSION_STRING)" != ""
1355 $(TARGET_VER) : $(INF_FILENAME)
1356 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER) -A "$(VERSION_STRING)"
1358 $(TARGET_VER) : $(INF_FILENAME)
1359 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER)
1362 $(TARGET_VER) : $(INF_FILENAME)
1363 echo. > $(TARGET_VER)
1364 type $(TARGET_VER) > $(TARGET_VER)
1368 # Makefile entries to create the dependency expression section.
1369 # Use the DPX file from the source directory unless an override file
1371 # If no DPX source file was specified, then create an empty file to
1374 !IF "$(DPX_SOURCE)" != ""
1375 DPX_SOURCE_FILE = $(SOURCE_DIR)\$(DPX_SOURCE)
1378 !IF "$(DPX_SOURCE_OVERRIDE)" != ""
1379 DPX_SOURCE_FILE = $(DPX_SOURCE_OVERRIDE)
1382 !IF "$(DPX_SOURCE_FILE)" != ""
1383 !IF EXIST ($(DPX_SOURCE_FILE))
1386 # Add build dependency check
1388 DEP_FILE = $(DEST_DIR)\$(BASE_NAME)dxs.dep
1390 !IF EXIST($(DEP_FILE))
1391 !INCLUDE $(DEP_FILE)
1394 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
1396 !IF EXIST($(TARGET_DPX))
1397 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs.dep
1398 !IF !EXIST($(DEP_FILE))
1404 # Update dep file for next round incremental build
1406 $(DEP_FILE) : $(TARGET_DPX)
1407 $(MAKEDEPS) -f $(DPX_SOURCE_FILE) $(DEP_FLAGS)
1411 $(TARGET_DPX) : $(DPX_SOURCE_FILE) $(INF_FILENAME)
1412 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
1413 $(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) > $*.tmp1
1415 -$(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) /showIncludes > $*.tmp1 2> $(DEST_DIR)\$(BASE_NAME)dxs.cl
1416 @$(MAKEDEPS) -f $(DEST_DIR)\$(BASE_NAME)dxs.cl $(DEP_FLAGS2)
1418 $(GENDEPEX) -I $*.tmp1 -O $*.tmp2
1419 $(GENSECTION) -I $*.tmp2 -O $@ -S $(DEPEX_TYPE)
1423 !ERROR Dependency expression source file "$(DPX_SOURCE_FILE)" does not exist.
1426 $(TARGET_DPX) : $(INF_FILENAME)
1427 echo. > $(TARGET_DPX)
1428 type $(TARGET_DPX) > $(TARGET_DPX)
1432 # Build a FFS file from the sections and package
1434 $(TARGET_FFS_FILE) : $(TARGET_PE32) $(TARGET_DPX) $(TARGET_UI) $(TARGET_VER) $(PACKAGE_FILENAME)
1435 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
1437 all : $(TARGET_FFS_FILE)
1440 # Remove the generated temp and final files for this modules.
1443 !IF ("$(FILE_GUID)" != "")
1444 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
1446 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
1447 @del /q $(DEST_OUTPUT_DIRS)
1449 [=============================================================================]
1450 [Compile.Ia32.Bin|Bmp,Compile.x64.Bin|Bmp]
1452 # We simply define the binary source file name
1454 BINARY_SOURCE_FILE = $(SOURCE_FILE_NAME)
1456 [=============================================================================]
1457 [Build.Ia32.BINARY|Legacy16|Logo,Build.x64.BINARY|Legacy16|Logo]
1459 # Use GenFfsFile to convert it to an FFS file
1461 $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).ffs : $(BINARY_SOURCE_FILE) $(PACKAGE_FILENAME) $(INF_FILENAME)
1462 $(GENSECTION) -I $(BINARY_SOURCE_FILE) -O $(DEST_DIR)\$(BASE_NAME).sec -S EFI_SECTION_RAW
1463 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
1465 all : $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).ffs
1468 # Remove the generated temp and final files for this modules.
1471 !IF ("$(FILE_GUID)" != "")
1472 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
1474 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
1475 @del /q $(DEST_OUTPUT_DIRS)
1477 [=============================================================================]
1478 [Build.Ia32.RAWFILE|CONFIG,Build.x64.RAWFILE|CONFIG]
1480 # Use GenFfsFile to convert it to an raw FFS file
1482 $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).raw : $(BINARY_SOURCE_FILE) $(PACKAGE_FILENAME) $(INF_FILENAME)
1483 copy $(BINARY_SOURCE_FILE) $(DEST_DIR)\$(BASE_NAME).bin /Y
1484 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
1486 all : $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).raw
1489 # Remove the generated temp and final files for this modules.
1492 !IF ("$(FILE_GUID)" != "")
1493 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
1495 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
1496 @del /q $(DEST_OUTPUT_DIRS)
1498 [=============================================================================]
1500 # These are commands to compile unicode .uni files.
1502 [=============================================================================]
1503 [Compile.Ia32.Uni,Compile.Ebc.Uni,Compile.x64.Uni]
1505 # Emit an error message if the file's base name is the same as the
1506 # component base name. This causes build issues.
1508 !IF "$(FILE)" == "$(BASE_NAME)"
1509 !ERROR Component Unicode string file name cannot be the same as the component BASE_NAME.
1513 # Always create dep file for uni file as it can be created at the same time when
1514 # strgather is parsing uni file.
1516 DEP_FILE = $(DEST_DIR)\$(FILE)Uni.dep
1518 !IF EXIST($(DEP_FILE))
1519 !INCLUDE $(DEP_FILE)
1522 $(DEST_DIR)\$(FILE).sdb : $(SOURCE_FILE_NAME) $(INF_FILENAME)
1523 $(STRGATHER) -parse -newdb -db $(DEST_DIR)\$(FILE).sdb -dep $(DEP_FILE) $(INC) $(SOURCE_FILE_NAME)
1525 SDB_FILES = $(SDB_FILES) $(DEST_DIR)\$(FILE).sdb
1526 STRGATHER_FLAGS = $(STRGATHER_FLAGS) -db $(DEST_DIR)\$(FILE).sdb
1529 [=============================================================================]
1530 [Compile.Ia32.hfr,Compile.Ebc.hfr,Compile.x64.hfr]
1531 [=============================================================================]
1532 [Compile.Ia32.Vfr,Compile.x64.Vfr]
1535 # Add build dependency check
1537 DEP_FILE = $(DEST_DIR)\$(FILE)Vfr.dep
1539 !IF EXIST($(DEP_FILE))
1540 !INCLUDE $(DEP_FILE)
1543 !IF EXIST($(DEST_DIR)\$(FILE).obj)
1544 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Vfr.dep
1545 !IF !EXIST($(DEP_FILE))
1551 # Update dep file for next round incremental build
1553 $(DEP_FILE) : $(DEST_DIR)\$(FILE).obj
1554 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)
1556 HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(FILE).hpk
1559 # Add a dummy command for building the HII pack file. In reality, it's built
1560 # below, but the C_FLAGS macro reference the target as $@, so you can't specify
1561 # the obj and hpk files as dual targets of the same command.
1563 $(DEST_DIR)\$(FILE).hpk : $(DEST_DIR)\$(FILE).obj
1565 $(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)
1566 $(VFRCOMPILE) $(VFRCOMPILE_FLAGS) $(INC) -ibin -od $(DEST_DIR)\$(SOURCE_RELATIVE_PATH) \
1567 -l $(VFR_FLAGS) $(SOURCE_FILE_NAME)
1568 $(CC) $(C_FLAGS) $(DEST_DIR)\$(FILE).c
1570 [=============================================================================]
1573 DEP_FILE = $(DEST_DIR)\$(FILE)Vfr.dep
1575 !IF EXIST($(DEST_DIR)\$(FILE).obj)
1576 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Vfr.dep
1577 !IF !EXIST($(DEP_FILE))
1582 !IF EXIST($(DEP_FILE))
1583 !INCLUDE $(DEP_FILE)
1587 # Update dep file for next round incremental build
1589 $(DEP_FILE) : $(DEST_DIR)\$(FILE).obj
1590 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)
1592 HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(FILE).hpk
1595 # Add a dummy command for building the HII pack file. In reality, it's built
1596 # below, but the C_FLAGS macro reference the target as $@, so you can't specify
1597 # the obj and hpk files as dual targets of the same command.
1599 $(DEST_DIR)\$(FILE).hpk : $(DEST_DIR)\$(FILE).obj
1601 $(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)
1602 $(VFRCOMPILE) $(VFRCOMPILE_FLAGS) $(INC) -ibin -od $(DEST_DIR)\$(SOURCE_RELATIVE_PATH) \
1603 -l $(VFR_FLAGS) $(SOURCE_FILE_NAME)
1604 $(EBC_CC) $(EBC_C_FLAGS) $(DEST_DIR)\$(FILE).c
1606 [=============================================================================]
1608 # Commands for building IFR as uncompressed binary into the FFS file. To
1609 # use it, set COMPILE_SELECT=.vfr=Ifr_Bin for the component in the DSC file.
1611 [=============================================================================]
1612 [Compile.Ia32.Ifr_Bin,Compile.x64.Ifr_Bin]
1615 # Add build dependency check
1617 DEP_FILE = $(DEST_DIR)\$(FILE)Vfr.dep
1619 !IF EXIST($(DEP_FILE))
1620 !INCLUDE $(DEP_FILE)
1623 !IF EXIST($(DEST_DIR)\$(FILE).obj)
1624 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Vfr.dep
1625 !IF !EXIST($(DEP_FILE))
1631 # Update dep file for next round incremental build
1633 $(DEP_FILE) : $(DEST_DIR)\$(FILE).obj
1634 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)
1636 HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(FILE).hpk
1639 # Add a dummy command for building the HII pack file. In reality, it's built
1640 # below, but the C_FLAGS macro reference the target as $@, so you can't specify
1641 # the obj and hpk files as dual targets of the same command.
1643 $(DEST_DIR)\$(FILE).hpk : $(DEST_DIR)\$(FILE).obj
1645 $(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)
1646 $(VFRCOMPILE) $(VFRCOMPILE_FLAGS) $(INC) -ibin -od $(DEST_DIR)\$(SOURCE_RELATIVE_PATH) \
1647 -l $(VFR_FLAGS) $(SOURCE_FILE_NAME)
1648 $(CC) $(C_FLAGS) $(DEST_DIR)\$(FILE).c
1651 # Add to the variable that contains the list of VFR binary files we're going
1652 # to merge together at the end of the build.
1654 HII_IFR_PACK_FILES = $(HII_IFR_PACK_FILES) $(DEST_DIR)\$(FILE).hpk
1656 [=============================================================================]
1658 # Commands for building IFR as uncompressed binary into the FFS file. To
1659 # use it, set COMPILE_SELECT=.vfr=Ifr_Bin for the component in the DSC file.
1661 [=============================================================================]
1662 [Compile.Ebc.Ifr_Bin]
1665 # Add build dependency check
1667 DEP_FILE = $(DEST_DIR)\$(FILE)Vfr.dep
1669 !IF EXIST($(DEP_FILE))
1670 !INCLUDE $(DEP_FILE)
1673 !IF EXIST($(DEST_DIR)\$(FILE).obj)
1674 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Vfr.dep
1675 !IF !EXIST($(DEP_FILE))
1681 # Update dep file for next round incremental build
1683 $(DEP_FILE) : $(DEST_DIR)\$(FILE).obj
1684 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)
1686 HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(FILE).hpk
1689 # Add a dummy command for building the HII pack file. In reality, it's built
1690 # below, but the C_FLAGS macro reference the target as $@, so you can't specify
1691 # the obj and hpk files as dual targets of the same command.
1693 $(DEST_DIR)\$(FILE).hpk : $(DEST_DIR)\$(FILE).obj
1695 $(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)
1696 $(VFRCOMPILE) $(VFRCOMPILE_FLAGS) $(INC) -ibin -od $(DEST_DIR)\$(SOURCE_RELATIVE_PATH) \
1697 -l $(VFR_FLAGS) $(SOURCE_FILE_NAME)
1698 $(EBC_CC) $(EBC_C_FLAGS) $(DEST_DIR)\$(FILE).c
1701 # Add to the variable that contains the list of VFR binary files we're going
1702 # to merge together at the end of the build.
1704 HII_IFR_PACK_FILES = $(HII_IFR_PACK_FILES) $(DEST_DIR)\$(FILE).hpk
1706 [=============================================================================]
1707 [Compile.Ia32.Fv,Compile.x64.Fv]
1709 # Run GenSection on the firmware volume image.
1711 $(DEST_DIR)\$(SOURCE_FV)Fv.sec : $(SOURCE_FILE_NAME) $(INF_FILENAME)
1712 $(GENSECTION) -I $(SOURCE_FILE_NAME) -O $(DEST_DIR)\$(SOURCE_FV)Fv.sec -S EFI_SECTION_FIRMWARE_VOLUME_IMAGE
1714 [=============================================================================]