3 # Copyright (c) 2004 - 2007, 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 [=============================================================================]
152 # Add build dependency check
154 DEP_FILE = $(DEST_DIR)\$(FILE)S.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)S.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_PRO) $(SOURCE_FILE_NAME) > $(DEST_DIR)\$(FILE).pro
184 -$(CC) $(C_FLAGS_PRO) $(SOURCE_FILE_NAME) /showIncludes > $(DEST_DIR)\$(FILE).pro 2> $(DEST_DIR)\$(FILE)S.cl
185 @$(MAKEDEPS) -f $(DEST_DIR)\$(FILE)S.cl $(DEP_FLAGS2)
187 $(ASM) $(ASM_FLAGS) $(DEST_DIR)\$(FILE).pro
189 [=============================================================================]
190 [Compile.Ia32.c,Compile.Ipf.c,Compile.x64.c]
193 # Add build dependency check
195 DEP_FILE = $(DEST_DIR)\$(FILE).dep
197 !IF EXIST($(DEP_FILE))
201 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
203 !IF EXIST($(DEST_DIR)\$(FILE).obj)
204 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE).dep
205 !IF !EXIST($(DEP_FILE))
211 # Update dep file for next round incremental build
213 $(DEP_FILE) : $(DEST_DIR)\$(FILE).obj
214 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)
221 $(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)
222 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
223 $(CC) $(C_FLAGS) $(SOURCE_FILE_NAME)
225 -$(CC) $(C_FLAGS) $(SOURCE_FILE_NAME) /showIncludes > $(DEST_DIR)\$(FILE).cl
226 @$(MAKEDEPS) -f $(DEST_DIR)\$(FILE).cl $(DEP_FLAGS2)
229 [=============================================================================]
233 # Add build dependency check
235 DEP_FILE = $(DEST_DIR)\$(FILE).dep
237 !IF EXIST($(DEP_FILE))
241 !IF EXIST($(DEST_DIR)\$(FILE).obj)
242 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE).dep
243 !IF !EXIST($(DEP_FILE))
249 # Update dep file for next round incremental build
251 $(DEP_FILE) : $(DEST_DIR)\$(FILE).obj
252 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)
257 $(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)
258 $(EBC_CC) $(EBC_C_FLAGS) $(SOURCE_FILE_NAME)
260 [=============================================================================]
262 # Commands for compiling a ".apr" Apriori source file.
264 [=============================================================================]
265 [Compile.Ia32.Apr,Compile.Ipf.Apr,Compile.Ebc.Apr,Compile.x64.Apr]
267 # Create the raw binary file. If you get an error on the build saying it doesn't
268 # know how to create the .apr file, then you're missing (or mispelled) the
269 # "APRIORI=" on the component lines in components section in the DSC file.
271 $(DEST_DIR)\$(BASE_NAME).bin : $(SOURCE_FILE_NAME)
272 $(GENAPRIORI) -v -f $(SOURCE_FILE_NAME) -o $(DEST_DIR)\$(BASE_NAME).bin
274 $(DEST_DIR)\$(BASE_NAME).sec : $(DEST_DIR)\$(BASE_NAME).bin
275 $(GENSECTION) -I $(DEST_DIR)\$(BASE_NAME).bin -O $(DEST_DIR)\$(BASE_NAME).sec -S EFI_SECTION_RAW
277 [=============================================================================]
278 [Build.Ia32.Apriori,Build.Ipf.Apriori,Build.Ebc.Apriori,Build.x64.Apriori]
280 all : $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).FFS
283 # Run GenFfsFile on the package file and .raw file to create the firmware file
285 $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).FFS : $(DEST_DIR)\$(BASE_NAME).sec $(PACKAGE_FILENAME)
286 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
289 # Remove the generated temp and final files for this modules.
292 !IF ("$(FILE_GUID)" != "")
293 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
295 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
296 @del /q $(DEST_OUTPUT_DIRS)
298 [=============================================================================]
299 [Build.Ia32.Makefile,Build.Ipf.Makefile,Build.Ebc.Makefile,Build.x64.Makefile]
302 # Copy the makefile directly from the source directory, then make it
303 # writable so we can copy over it later if we try to.
305 $(DEST_DIR)\makefile.new : $(SOURCE_DIR)\makefile.new
306 copy $(SOURCE_DIR)\makefile.new $(DEST_DIR)\makefile.new
307 attrib -r $(DEST_DIR)\makefile.new
310 # Make the all target, set some required macros.
313 $(MAKE) -f $(DEST_DIR)\makefile.new all \
314 SOURCE_DIR=$(SOURCE_DIR) \
315 BUILD_DIR=$(BUILD_DIR) \
316 FILE_GUID=$(FILE_GUID) \
317 DEST_DIR=$(DEST_DIR) \
318 PROCESSOR=$(PROCESSOR) \
319 TOOLCHAIN=TOOLCHAIN_$(PROCESSOR) \
320 BASE_NAME=$(BASE_NAME) \
321 PACKAGE_FILENAME=$(PACKAGE_FILENAME)
323 all : $(DEST_DIR)\makefile.new call_makefile
326 # Remove the generated temp and final files for this modules.
329 @- $(MAKE) -f $(DEST_DIR)\makefile.new clean > NUL 2>&1
330 !IF ("$(FILE_GUID)" != "")
331 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
333 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
334 @del /q $(DEST_OUTPUT_DIRS)
336 [=============================================================================]
338 # Instructions for building a component that uses a custom makefile. Encoding
339 # is [build.$(PROCESSOR).$(BUILD_TYPE)].
341 # To build these components, simply call the makefile from the source
344 [=============================================================================]
345 [Build.Ia32.Custom_Makefile,Build.Ipf.Custom_Makefile,Build.Ebc.Custom_Makefile,Build.x64.Custom_Makefile]
348 # Just call the makefile from the source directory, passing in some
352 $(MAKE) -f $(SOURCE_DIR)\makefile all \
353 SOURCE_DIR=$(SOURCE_DIR) \
354 BUILD_DIR=$(BUILD_DIR) \
355 DEST_DIR=$(DEST_DIR) \
356 FILE_GUID=$(FILE_GUID) \
357 PROCESSOR=$(PROCESSOR) \
358 TOOLCHAIN=TOOLCHAIN_$(PROCESSOR) \
359 BASE_NAME=$(BASE_NAME) \
360 PLATFORM=$(PLATFORM) \
361 SOURCE_FV=$(SOURCE_FV) \
362 PACKAGE_FILENAME=$(PACKAGE_FILENAME)
365 # Remove the generated temp and final files for this modules.
368 @- $(MAKE) -f $(SOURCE_DIR)\makefile clean > NUL 2>&1
369 !IF ("$(FILE_GUID)" != "")
370 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
372 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
373 @del /q $(DEST_OUTPUT_DIRS)
375 [=============================================================================]
377 # These commands are used to build libraries
379 [=============================================================================]
380 [Build.Ia32.LIBRARY,Build.Ipf.LIBRARY,Build.x64.LIBRARY]
382 # LIB all the object files into to our target lib file. Put
383 # a dependency on the component's INF file in case it changes.
385 LIB_NAME = $(LIB_DIR)\$(BASE_NAME).lib
388 # $(DEP_TARGETS) are not needed for binary build.
390 !IF ("$(BINARY)" == "TRUE") || (("$(BINARY)" == "") && ("$(EFI_BINARY_LIBRARY)" == "YES"))
396 # Module can be built from source code or binary files.
398 !IF ((("$(BINARY)" == "TRUE") || (("$(BINARY)" == "") && ("$(EFI_BINARY_LIBRARY)" == "YES"))) \
399 && EXIST($(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).lib))
400 $(LIB_NAME) : $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).lib
401 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).lib $(LIB_NAME) /Y
402 if exist $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME)Obj.pdb \
403 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME)Obj.pdb $(DEST_DIR)\$(BASE_NAME)Obj.pdb /Y
405 $(LIB_NAME) : $(OBJECTS) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)
406 $(LIB) $(LIB_FLAGS) $(OBJECTS) $(LIBS) /OUT:$@
407 !IF ("$(EFI_BINARY_BUILD)" == "YES")
408 if not exist $(EFI_PLATFORM_BIN)\$(PROCESSOR) mkdir $(EFI_PLATFORM_BIN)\$(PROCESSOR)
409 if exist $(LIB_NAME) copy $(LIB_NAME) $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).lib /Y
410 if exist $(DEST_DIR)\$(BASE_NAME)Obj.pdb copy $(DEST_DIR)\$(BASE_NAME)Obj.pdb $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME)Obj.pdb /Y
414 !IF "$(CREATEDEPS)"=="YES"
416 $(MAKE) -f $(MAKEFILE_NAME) all
418 all : $(LIB_NAME) $(DEP_TARGETS)
422 # Remove the generated temp and final files for this modules.
425 !IF ("$(FILE_GUID)" != "")
426 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
428 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
429 @del /q $(DEST_OUTPUT_DIRS)
431 [=============================================================================]
434 # LIB all the object files into to our target lib file. Put
435 # a dependency on the component's INF file in case it changes.
437 LIB_NAME = $(LIB_DIR)\$(BASE_NAME).lib
439 $(LIB_NAME) : $(OBJECTS) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)
440 $(EBC_LIB) $(EBC_LIB_FLAGS) $(OBJECTS) $(LIBS) /OUT:$@
442 !IF "$(CREATEDEPS)"=="YES"
444 $(MAKE) -f $(MAKEFILE_NAME) all
446 all : $(LIB_NAME) $(DEP_TARGETS)
450 # Remove the generated temp and final files for this modules.
453 !IF ("$(FILE_GUID)" != "")
454 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
456 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
457 @del /q $(DEST_OUTPUT_DIRS)
459 [=============================================================================]
461 # This is the Build.$(PROCESSOR).$(COMPONENT_TYPE) section that tells how to
462 # convert a firmware volume into an FV FFS file. Simply run it through
463 # GenFfsFile with the appropriate package file. SOURCE_FV must be defined
464 # in the component INF file Defines section.
466 [=============================================================================]
467 [Build.Ia32.FvImageFile,Build.x64.FvImageFile,Build.Ipf.FvImageFile]
469 all : $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).Fvi
472 # Run GenFfsFile on the package file and FV file to create the firmware
473 # volume FFS file. This FFS file maybe contain one pad section for alignment requirement.
475 $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).Fvi : $(DEST_DIR)\$(SOURCE_FV)Fv.sec $(PACKAGE_FILENAME) $(PAD_SECTION)
476 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
479 # Remove the generated temp and final files for this modules.
482 !IF ("$(FILE_GUID)" != "")
483 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
485 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
486 @del /q $(DEST_OUTPUT_DIRS)
488 [=============================================================================]
490 # Since many of the steps are the same for the different component types, we
491 # share this section for BS_DRIVER, RT_DRIVER, .... and IFDEF the parts that
492 # differ. The entire section gets dumped to the output makefile.
494 [=============================================================================]
495 [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]
497 !IF "$(LOCALIZE)" == "YES"
499 !IF "$(EFI_GENERATE_HII_EXPORT)" == "YES"
500 STRGATHER_FLAGS = $(STRGATHER_FLAGS) -hpk $(DEST_DIR)\$(BASE_NAME)Strings.hpk
503 # There will be one HII pack containing all the strings. Add that file
504 # to the list of HII pack files we'll use to create our final HII export file.
506 HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(BASE_NAME)Strings.hpk
507 LOCALIZE_TARGETS = $(LOCALIZE_TARGETS) $(DEST_DIR)\$(BASE_NAME).hii
510 $(DEST_DIR)\$(BASE_NAME).sdb : $(SDB_FILES) $(SOURCE_FILES)
511 $(STRGATHER) -scan -vdbr $(STRGATHER_FLAGS) -od $(DEST_DIR)\$(BASE_NAME).sdb \
512 -skipext .uni -skipext .h $(SOURCE_FILES)
514 $(DEST_DIR)\$(BASE_NAME)Strings.c : $(DEST_DIR)\$(BASE_NAME).sdb
515 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \
516 -oc $(DEST_DIR)\$(BASE_NAME)Strings.c
518 $(DEST_DIR)\$(BASE_NAME)StrDefs.h : $(DEST_DIR)\$(BASE_NAME).sdb
519 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \
520 -oh $(DEST_DIR)\$(BASE_NAME)StrDefs.h
522 $(DEST_DIR)\$(BASE_NAME)Strings.hpk : $(DEST_DIR)\$(BASE_NAME).sdb
523 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \
524 -hpk $(DEST_DIR)\$(BASE_NAME)Strings.hpk
526 OBJECTS = $(OBJECTS) $(DEST_DIR)\$(BASE_NAME)Strings.obj
528 $(DEST_DIR)\$(BASE_NAME)Strings.obj : $(DEST_DIR)\$(BASE_NAME)Strings.c $(INF_FILENAME) $(ALL_DEPS)
529 $(CC) $(C_FLAGS) $(DEST_DIR)\$(BASE_NAME)Strings.c
531 LOCALIZE_TARGETS = $(LOCALIZE_TARGETS) $(DEST_DIR)\$(BASE_NAME)StrDefs.h
536 # If we have any objects associated with this component, then we're
537 # going to build a local library from them.
540 !ERROR No source files to build were defined in the INF file
543 TARGET_LOCAL_LIB = $(DEST_DIR)\$(BASE_NAME)Local.lib
546 # LIB all the object files into our (local) target lib file. Put
547 # a dependency on the component's INF file in case it changes.
549 $(TARGET_LOCAL_LIB) : $(OBJECTS) $(INF_FILENAME) $(ENV_DEPS)
550 $(LIB) $(LIB_FLAGS) $(OBJECTS) /OUT:$@
553 # Defines for standard intermediate files and build targets
555 TARGET_DLL = $(BIN_DIR)\$(BASE_NAME).dll
556 TARGET_EFI = $(BIN_DIR)\$(BASE_NAME).efi
557 TARGET_DPX = $(DEST_DIR)\$(BASE_NAME).dpx
558 TARGET_UI = $(DEST_DIR)\$(BASE_NAME).ui
559 TARGET_VER = $(DEST_DIR)\$(BASE_NAME).ver
560 TARGET_MAP = $(BIN_DIR)\$(BASE_NAME).map
561 TARGET_PDB = $(BIN_DIR)\$(BASE_NAME).pdb
562 TARGET_SYM = $(BIN_DIR)\$(BASE_NAME).sym
565 # Target executable section extension depends on the component type.
566 # Only define "TARGET_DXE_DPX" if it's a combined peim driver.
568 !IF "$(COMPONENT_TYPE)" == "PIC_PEIM"
569 TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pic
571 TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pe32
575 # Target FFS file extension depends on the component type
576 # Also define "TARGET_DXE_DPX" if it's a combined PEIM driver.
578 SUBSYSTEM = EFI_BOOT_SERVICE_DRIVER
580 !IF "$(COMPONENT_TYPE)" == "APPLICATION"
581 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).app
582 SUBSYSTEM = EFI_APPLICATION
583 !ELSE IF "$(COMPONENT_TYPE)" == "PEI_CORE"
584 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei
585 !ELSE IF "$(COMPONENT_TYPE)" == "PE32_PEIM"
586 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei
587 !ELSE IF "$(COMPONENT_TYPE)" == "RELOCATABLE_PEIM"
588 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei
589 !ELSE IF "$(COMPONENT_TYPE)" == "PIC_PEIM"
590 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei
591 !ELSE IF "$(COMPONENT_TYPE)" == "COMBINED_PEIM_DRIVER"
592 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei
593 TARGET_DXE_DPX = $(DEST_DIR)\$(BASE_NAME).dpxd
595 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).dxe
599 # Different methods to build section based on if PIC_PEIM
601 !IF "$(COMPONENT_TYPE)" == "PIC_PEIM"
603 $(TARGET_PE32) : $(TARGET_DLL)
604 $(PE2BIN) $(TARGET_DLL) $(DEST_DIR)\$(BASE_NAME).TMP
606 # BUGBUG: Build PEIM header, needs to go away with new PEI.
608 $(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
609 $(GENSECTION) -I $(TARGET_PIC_PEI).tmp -O $(TARGET_PE32) -S EFI_SECTION_PIC
610 del $(DEST_DIR)\$(BASE_NAME).TMP
614 $(TARGET_PE32) : $(TARGET_EFI)
615 $(GENSECTION) -I $(TARGET_EFI) -O $(TARGET_PE32) -S EFI_SECTION_PE32
618 # $(DEP_TARGETS) are not needed for binary build.
620 !IF "$(BINARY)" == "TRUE"
626 # Build module to generate *.efi file from source code or binary file.
628 !IF (("$(BINARY)" == "TRUE") && EXIST($(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi))
630 $(TARGET_EFI) : $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi
631 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi $(TARGET_EFI) /Y
632 if exist $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb \
633 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb $(TARGET_PDB) /Y
635 $(TARGET_EFI) : $(TARGET_DLL) $(INF_FILENAME)
636 $(FWIMAGE) -t 0 $(COMPONENT_TYPE) $(TARGET_DLL) $(TARGET_EFI)
637 !IF ("$(EFI_BINARY_BUILD)" == "YES")
638 if not exist $(EFI_PLATFORM_BIN)\$(PROCESSOR) mkdir $(EFI_PLATFORM_BIN)\$(PROCESSOR)
639 if exist $(TARGET_EFI) copy $(TARGET_EFI) $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi /Y
640 if exist $(TARGET_PDB) copy $(TARGET_PDB) $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb /Y
647 # Link all objects and libs to create the executable
649 $(TARGET_DLL) : $(TARGET_LOCAL_LIB) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)
650 $(LINK) $(LINK_FLAGS_DLL) $(LIBS) /ENTRY:$(IMAGE_ENTRY_POINT) \
651 $(TARGET_LOCAL_LIB) /OUT:$(TARGET_DLL) /MAP:$(TARGET_MAP) \
653 $(SETSTAMP) $(TARGET_DLL) $(BUILD_DIR)\GenStamp.txt
654 !IF "$(EFI_GENERATE_SYM_FILE)" == "YES"
655 if exist $(TARGET_PDB) $(PE2SYM) $(TARGET_PDB) $(TARGET_SYM)
658 !IF "$(EFI_ZERO_DEBUG_DATA)" == "YES"
659 $(ZERODEBUGDATA) $(TARGET_DLL)
663 # Create the user interface section
665 $(TARGET_UI) : $(INF_FILENAME)
666 $(GENSECTION) -O $(TARGET_UI) -S EFI_SECTION_USER_INTERFACE -A "$(BASE_NAME)"
669 # Create the version section
671 !IF "$(BUILD_NUMBER)" != ""
672 !IF "$(VERSION_STRING)" != ""
673 $(TARGET_VER) : $(INF_FILENAME)
674 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER) -A "$(VERSION_STRING)"
676 $(TARGET_VER) : $(INF_FILENAME)
677 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER)
682 type $(TARGET_VER)>$(TARGET_VER)
686 # Makefile entries to create the dependency expression section.
687 # Use the DPX file from the source directory unless an override file
689 # If no DPX source file was specified, then create an empty file to
692 !IF "$(DPX_SOURCE)" != ""
693 DPX_SOURCE_FILE = $(SOURCE_DIR)\$(DPX_SOURCE)
696 !IF "$(DPX_SOURCE_OVERRIDE)" != ""
697 DPX_SOURCE_FILE = $(DPX_SOURCE_OVERRIDE)
700 !IF "$(DPX_SOURCE_FILE)" != ""
701 !IF EXIST ($(DPX_SOURCE_FILE))
704 # Add build dependency check
706 DEP_FILE = $(DEST_DIR)\$(BASE_NAME)dxs.dep
708 !IF EXIST($(DEP_FILE))
712 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
714 !IF EXIST($(TARGET_DPX))
715 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs.dep
716 !IF !EXIST($(DEP_FILE))
722 # Update dep file for next round incremental build
724 $(DEP_FILE) : $(TARGET_DPX)
725 $(MAKEDEPS) -f $(DPX_SOURCE_FILE) $(DEP_FLAGS)
729 $(TARGET_DPX) : $(DPX_SOURCE_FILE) $(INF_FILENAME)
730 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
731 $(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) > $*.tmp1
733 -$(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) /showIncludes > $*.tmp1 2> $(DEST_DIR)\$(BASE_NAME)dxs.cl
734 @$(MAKEDEPS) -f $(DEST_DIR)\$(BASE_NAME)dxs.cl $(DEP_FLAGS2)
736 $(GENDEPEX) -I $*.tmp1 -O $*.tmp2
737 $(GENSECTION) -I $*.tmp2 -O $@ -S $(DEPEX_TYPE)
741 !ERROR Dependency expression source file "$(DPX_SOURCE_FILE)" does not exist.
745 echo. > $(TARGET_DPX)
746 type $(TARGET_DPX) > $(TARGET_DPX)
750 # Makefile entries for DXE DPX for combined PEIM drivers.
751 # If a DXE_DPX_SOURCE file was specified in the INF file, use it. Otherwise
752 # create an empty file and use it as a DPX file.
754 !IF "$(COMPONENT_TYPE)" == "COMBINED_PEIM_DRIVER"
755 !IF "$(DXE_DPX_SOURCE)" != ""
756 !IF EXIST ($(SOURCE_DIR)\$(DXE_DPX_SOURCE))
759 # Add build dependency check
761 DEP_FILE = $(DEST_DIR)\$(BASE_NAME)dxs2.dep
763 !IF EXIST($(DEP_FILE))
767 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
769 !IF EXIST($(TARGET_DXE_DPX))
770 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs2.dep
771 !IF !EXIST($(DEP_FILE))
777 # Update dep file for next round incremental build
779 $(DEP_FILE) : $(TARGET_DXE_DPX)
780 $(MAKEDEPS) -f $(SOURCE_DIR)\$(DXE_DPX_SOURCE) $(DEP_FLAGS)
784 $(TARGET_DXE_DPX) : $(SOURCE_DIR)\$(DXE_DPX_SOURCE) $(INF_FILENAME)
785 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
786 $(CC) $(C_FLAGS_DPX) $(SOURCE_DIR)\$(DXE_DPX_SOURCE) > $*.tmp1
788 -$(CC) $(C_FLAGS_DPX) $(SOURCE_DIR)\$(DXE_DPX_SOURCE) /showIncludes > $*.tmp1 2> $(DEST_DIR)\$(BASE_NAME)dxs2.cl
789 @$(MAKEDEPS) -f $(DEST_DIR)\$(BASE_NAME)dxs2.cl $(DEP_FLAGS2)
791 $(GENDEPEX) -I $*.tmp1 -O $*.tmp2
792 $(GENSECTION) -I $*.tmp2 -O $@ -S EFI_SECTION_DXE_DEPEX
796 !ERROR Dependency expression source file "$(SOURCE_DIR)\$(DXE_DPX_SOURCE)" does not exist.
800 echo. > $(TARGET_DXE_DPX)
801 type $(TARGET_DXE_DPX) > $(TARGET_DXE_DPX)
806 # Describe how to build the HII export file from all the input HII pack files.
807 # Use the FFS file GUID for the package GUID in the export file. Only used
808 # when multiple VFR share strings.
810 $(DEST_DIR)\$(BASE_NAME).hii : $(HII_PACK_FILES)
811 $(HIIPACK) create -g $(FILE_GUID) -p $(HII_PACK_FILES) -o $(DEST_DIR)\$(BASE_NAME).hii
814 # If the build calls for creating an FFS file with the IFR included as
815 # a separate binary (not compiled into the driver), then build the binary
816 # section now. Note that the PACKAGE must be set correctly to actually get
817 # this IFR section pulled into the FFS file.
819 !IF ("$(HII_IFR_PACK_FILES)" != "")
821 $(DEST_DIR)\$(BASE_NAME)IfrBin.sec : $(HII_IFR_PACK_FILES)
822 $(HIIPACK) create -novarpacks -p $(HII_IFR_PACK_FILES) -o $(DEST_DIR)\$(BASE_NAME)IfrBin.hii
823 $(GENSECTION) -I $(DEST_DIR)\$(BASE_NAME)IfrBin.hii -O $(DEST_DIR)\$(BASE_NAME)IfrBin.sec -S EFI_SECTION_RAW
825 BIN_TARGETS = $(BIN_TARGETS) $(DEST_DIR)\$(BASE_NAME)IfrBin.sec
830 # Build a FFS file from the sections and package
832 $(TARGET_FFS_FILE) : $(TARGET_PE32) $(TARGET_DPX) $(TARGET_UI) $(TARGET_VER) $(TARGET_DXE_DPX) $(PACKAGE_FILENAME)
834 # Some of our components require padding to align code
836 !IF "$(PROCESSOR)" == "IPF"
837 !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"
838 copy $(BIN_DIR)\Blank.pad $(DEST_DIR)
841 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
843 !IF "$(CREATEDEPS)"=="YES"
845 $(MAKE) -f $(MAKEFILE_NAME) all
847 all : $(LOCALIZE_TARGETS) $(BIN_TARGETS) $(TARGET_FFS_FILE) $(DEP_TARGETS)
851 # Remove the generated temp and final files for this modules.
854 !IF ("$(FILE_GUID)" != "")
855 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
857 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
858 @del /q $(DEST_OUTPUT_DIRS)
860 [=============================================================================]
861 [Build.Ia32.TE_PEIM,Build.Ipf.TE_PEIM,Build.x64.TE_PEIM]
863 # Define the library file we'll build if we have any objects defined.
866 TARGET_LOCAL_LIB = $(DEST_DIR)\$(BASE_NAME)Local.lib
868 # LIB all the object files into our (local) target lib file. Put
869 # a dependency on the component's INF file in case it changes.
871 $(TARGET_LOCAL_LIB) : $(OBJECTS) $(INF_FILENAME) $(ENV_DEPS)
872 $(LIB) $(LIB_FLAGS) $(OBJECTS) /OUT:$@
875 !ERROR No source files to build were defined in the INF file
879 # Defines for standard intermediate files and build targets
881 TARGET_DLL = $(BIN_DIR)\$(BASE_NAME).dll
882 TARGET_EFI = $(BIN_DIR)\$(BASE_NAME).efi
883 TARGET_DPX = $(DEST_DIR)\$(BASE_NAME).dpx
884 TARGET_UI = $(DEST_DIR)\$(BASE_NAME).ui
885 TARGET_VER = $(DEST_DIR)\$(BASE_NAME).ver
886 TARGET_MAP = $(BIN_DIR)\$(BASE_NAME).map
887 TARGET_PDB = $(BIN_DIR)\$(BASE_NAME).pdb
888 TARGET_SYM = $(BIN_DIR)\$(BASE_NAME).sym
889 TARGET_TE = $(BIN_DIR)\$(BASE_NAME).te
890 TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pe32
891 TARGET_TES = $(DEST_DIR)\$(BASE_NAME).tes
892 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei
895 # Create our TE section from our TE file
897 $(TARGET_TES) : $(TARGET_TE)
898 $(GENSECTION) -I $(TARGET_TE) -O $(TARGET_TES) -S EFI_SECTION_TE
901 # $(DEP_TARGETS) are not needed for binary build.
903 !IF "$(BINARY)" == "TRUE"
909 # Build module to generate *.efi file from source code or binary file.
911 !IF (("$(BINARY)" == "TRUE") && EXIST($(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi))
912 $(TARGET_EFI) : $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi
913 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi $(TARGET_EFI) /Y
914 if exist $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb \
915 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb $(TARGET_PDB) /Y
917 $(TARGET_EFI) : $(TARGET_DLL) $(INF_FILENAME)
918 $(FWIMAGE) $(COMPONENT_TYPE) $(TARGET_DLL) $(TARGET_EFI)
919 !IF ("$(EFI_BINARY_BUILD)" == "YES")
920 if not exist $(EFI_PLATFORM_BIN)\$(PROCESSOR) mkdir $(EFI_PLATFORM_BIN)\$(PROCESSOR)
921 if exist $(TARGET_EFI) copy $(TARGET_EFI) $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi /Y
922 if exist $(TARGET_PDB) copy $(TARGET_PDB) $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb /Y
927 # Run GenTEImage on the built .efi file to create our TE file.
929 $(TARGET_TE) : $(TARGET_EFI)
930 $(GENTEIMAGE) -o $(TARGET_TE) $(TARGET_EFI)
933 # Link all objects and libs to create the executable
935 $(TARGET_DLL) : $(TARGET_LOCAL_LIB) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)
936 $(LINK) $(LINK_FLAGS_DLL) $(LIBS) /ENTRY:$(IMAGE_ENTRY_POINT) \
937 $(TARGET_LOCAL_LIB) /OUT:$(TARGET_DLL) /MAP:$(TARGET_MAP) \
939 $(SETSTAMP) $(TARGET_DLL) $(BUILD_DIR)\GenStamp.txt
940 !IF "$(EFI_GENERATE_SYM_FILE)" == "YES"
941 if exist $(TARGET_PDB) $(PE2SYM) $(TARGET_PDB) $(TARGET_SYM)
944 !IF "$(EFI_ZERO_DEBUG_DATA)" == "YES"
945 $(ZERODEBUGDATA) $(TARGET_DLL)
949 # Create the user interface section
951 $(TARGET_UI) : $(INF_FILENAME)
952 $(GENSECTION) -O $(TARGET_UI) -S EFI_SECTION_USER_INTERFACE -A "$(BASE_NAME)"
955 # Create the version section
957 !IF "$(BUILD_NUMBER)" != ""
958 !IF "$(VERSION_STRING)" != ""
959 $(TARGET_VER) : $(INF_FILENAME)
960 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER) -A "$(VERSION_STRING)"
962 $(TARGET_VER) : $(INF_FILENAME)
963 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER)
968 type $(TARGET_VER)>$(TARGET_VER)
972 # Makefile entries to create the dependency expression section.
973 # Use the DPX file from the source directory unless an override file
975 # If no DPX source file was specified, then create an empty file to
978 !IF "$(DPX_SOURCE)" != ""
979 DPX_SOURCE_FILE = $(SOURCE_DIR)\$(DPX_SOURCE)
982 !IF "$(DPX_SOURCE_OVERRIDE)" != ""
983 DPX_SOURCE_FILE = $(DPX_SOURCE_OVERRIDE)
986 !IF "$(DPX_SOURCE_FILE)" != ""
987 !IF EXIST ($(DPX_SOURCE_FILE))
990 # Add build dependency check
992 DEP_FILE = $(DEST_DIR)\$(BASE_NAME)dxs.dep
994 !IF EXIST($(DEP_FILE))
998 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
1000 !IF EXIST($(TARGET_DPX))
1001 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs.dep
1002 !IF !EXIST($(DEP_FILE))
1008 # Update dep file for next round incremental build
1010 $(DEP_FILE) : $(TARGET_DPX)
1011 $(MAKEDEPS) -f $(DPX_SOURCE_FILE) $(DEP_FLAGS)
1015 $(TARGET_DPX) : $(DPX_SOURCE_FILE) $(INF_FILENAME)
1016 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
1017 $(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) > $*.tmp1
1019 -$(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) /showIncludes > $*.tmp1 2> $(DEST_DIR)\$(BASE_NAME)dxs.cl
1020 @$(MAKEDEPS) -f $(DEST_DIR)\$(BASE_NAME)dxs.cl $(DEP_FLAGS2)
1022 $(GENDEPEX) -I $*.tmp1 -O $*.tmp2
1023 $(GENSECTION) -I $*.tmp2 -O $@ -S $(DEPEX_TYPE)
1027 !ERROR Dependency expression source file "$(DPX_SOURCE_FILE)" does not exist.
1031 echo. > $(TARGET_DPX)
1032 type $(TARGET_DPX) > $(TARGET_DPX)
1036 # Build an FFS file from the sections and package
1038 $(TARGET_FFS_FILE) : $(TARGET_TES) $(TARGET_DPX) $(TARGET_UI) $(TARGET_VER) $(PACKAGE_FILENAME)
1039 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
1041 !IF "$(CREATEDEPS)"=="YES"
1042 all : $(DEP_TARGETS)
1043 $(MAKE) -f $(MAKEFILE_NAME) all
1045 all : $(TARGET_FFS_FILE) $(DEP_TARGETS)
1049 # Remove the generated temp and final files for this modules.
1052 !IF ("$(FILE_GUID)" != "")
1053 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
1055 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
1056 @del /q $(DEST_OUTPUT_DIRS)
1058 [=============================================================================]
1060 # These are the commands to build EBC EFI targets
1062 [=============================================================================]
1063 [Build.Ebc.BS_DRIVER|RT_DRIVER|APPLICATION]
1066 # Add the EBC library to our list of libs
1068 LIBS = $(LIBS) $(EBC_TOOLS_PATH)\lib\EbcLib.lib
1070 !IF "$(LOCALIZE)" == "YES"
1072 !IF "$(EFI_GENERATE_HII_EXPORT)" == "YES"
1073 STRGATHER_FLAGS = $(STRGATHER_FLAGS) -hpk $(DEST_DIR)\$(BASE_NAME)Strings.hpk
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 $(DEST_DIR)\$(BASE_NAME).sdb : $(SDB_FILES) $(SOURCE_FILES)
1085 $(STRGATHER) -scan -vdbr $(STRGATHER_FLAGS) -od $(DEST_DIR)\$(BASE_NAME).sdb \
1086 -skipext .uni -skipext .h $(SOURCE_FILES)
1088 $(DEST_DIR)\$(BASE_NAME)Strings.c : $(DEST_DIR)\$(BASE_NAME).sdb
1089 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \
1090 -oc $(DEST_DIR)\$(BASE_NAME)Strings.c
1092 $(DEST_DIR)\$(BASE_NAME)StrDefs.h : $(DEST_DIR)\$(BASE_NAME).sdb
1093 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \
1094 -oh $(DEST_DIR)\$(BASE_NAME)StrDefs.h
1096 $(DEST_DIR)\$(BASE_NAME)Strings.hpk : $(DEST_DIR)\$(BASE_NAME).sdb
1097 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \
1098 -hpk $(DEST_DIR)\$(BASE_NAME)Strings.hpk
1100 OBJECTS = $(OBJECTS) $(DEST_DIR)\$(BASE_NAME)Strings.obj
1102 $(DEST_DIR)\$(BASE_NAME)Strings.obj : $(DEST_DIR)\$(BASE_NAME)Strings.c $(INF_FILENAME) $(ALL_DEPS)
1103 $(EBC_CC) $(EBC_C_FLAGS) $(DEST_DIR)\$(BASE_NAME)Strings.c
1105 LOCALIZE_TARGETS = $(LOCALIZE_TARGETS) $(DEST_DIR)\$(BASE_NAME)StrDefs.h
1110 # If building an application, then the target is a .app, not .dxe
1112 !IF "$(COMPONENT_TYPE)" == "APPLICATION"
1113 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).app
1114 SUBSYSTEM = EFI_APPLICATION
1116 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).dxe
1117 SUBSYSTEM = EFI_BOOT_SERVICE_DRIVER
1121 # Defines for standard intermediate files and build targets
1123 TARGET_EFI = $(BIN_DIR)\$(BASE_NAME).efi
1124 TARGET_DPX = $(DEST_DIR)\$(BASE_NAME).dpx
1125 TARGET_UI = $(DEST_DIR)\$(BASE_NAME).ui
1126 TARGET_VER = $(DEST_DIR)\$(BASE_NAME).ver
1127 TARGET_MAP = $(BIN_DIR)\$(BASE_NAME).map
1128 TARGET_PDB = $(BIN_DIR)\$(BASE_NAME).pdb
1129 TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pe32
1130 TARGET_DLL = $(BIN_DIR)\$(BASE_NAME).dll
1133 # First link all the objects and libs together to make a .dll file
1135 $(TARGET_DLL) : $(OBJECTS) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)
1136 $(EBC_LINK) $(EBC_LINK_FLAGS) /SUBSYSTEM:$(SUBSYSTEM) /ENTRY:EfiStart \
1137 $(OBJECTS) $(LIBS) /OUT:$(TARGET_DLL) /MAP:$(TARGET_MAP)
1138 $(SETSTAMP) $(TARGET_DLL) $(BUILD_DIR)\GenStamp.txt
1139 !IF "$(EFI_ZERO_DEBUG_DATA)" == "YES"
1140 $(ZERODEBUGDATA) $(TARGET_DLL)
1144 # Now take the .dll file and make a .efi file
1146 $(TARGET_EFI) : $(TARGET_DLL) $(INF_FILENAME)
1147 $(FWIMAGE) -t 0 $(COMPONENT_TYPE) $(TARGET_DLL) $(TARGET_EFI)
1150 # Now take the .efi file and make a .pe32 section
1152 $(TARGET_PE32) : $(TARGET_EFI)
1153 $(GENSECTION) -I $(TARGET_EFI) -O $(TARGET_PE32) -S EFI_SECTION_PE32
1156 # Create the user interface section
1158 $(TARGET_UI) : $(INF_FILENAME)
1159 $(GENSECTION) -O $(TARGET_UI) -S EFI_SECTION_USER_INTERFACE -A "$(BASE_NAME)"
1162 # Create the version section
1164 !IF "$(BUILD_NUMBER)" != ""
1165 !IF "$(VERSION_STRING)" != ""
1166 $(TARGET_VER) : $(INF_FILENAME)
1167 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER) -A "$(VERSION_STRING)"
1169 $(TARGET_VER) : $(INF_FILENAME)
1170 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER)
1174 echo. > $(TARGET_VER)
1175 type $(TARGET_VER) > $(TARGET_VER)
1179 # Makefile entries to create the dependency expression section.
1180 # Use the DPX file from the source directory unless an override file
1182 # If no DPX source file was specified, then create an empty file to
1185 !IF "$(DPX_SOURCE)" != ""
1186 DPX_SOURCE_FILE = $(SOURCE_DIR)\$(DPX_SOURCE)
1189 !IF "$(DPX_SOURCE_OVERRIDE)" != ""
1190 DPX_SOURCE_FILE = $(DPX_SOURCE_OVERRIDE)
1193 !IF "$(DPX_SOURCE_FILE)" != ""
1194 !IF EXIST ($(DPX_SOURCE_FILE))
1197 # Add build dependency check
1199 DEP_FILE = $(DEST_DIR)\$(BASE_NAME)dxs.dep
1201 !IF EXIST($(DEP_FILE))
1202 !INCLUDE $(DEP_FILE)
1205 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
1207 !IF EXIST($(TARGET_DPX))
1208 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs.dep
1209 !IF !EXIST($(DEP_FILE))
1215 # Update dep file for next round incremental build
1217 $(DEP_FILE) : $(TARGET_DPX)
1218 $(MAKEDEPS) -f $(DPX_SOURCE_FILE) $(DEP_FLAGS)
1222 $(TARGET_DPX) : $(DPX_SOURCE_FILE) $(INF_FILENAME)
1223 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
1224 $(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) > $*.tmp1
1226 -$(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) /showIncludes > $*.tmp1 2> $(DEST_DIR)\$(BASE_NAME)dxs.cl
1227 @$(MAKEDEPS) -f $(DEST_DIR)\$(BASE_NAME)dxs.cl $(DEP_FLAGS2)
1229 $(GENDEPEX) -I $*.tmp1 -O $*.tmp2
1230 $(GENSECTION) -I $*.tmp2 -O $@ -S $(DEPEX_TYPE)
1234 !ERROR Dependency expression source file "$(DPX_SOURCE_FILE)" does not exist.
1238 echo. > $(TARGET_DPX)
1239 type $(TARGET_DPX) > $(TARGET_DPX)
1243 # Describe how to build the HII export file from all the input HII pack files.
1244 # Use the FFS file GUID for the package GUID in the export file. Only used
1245 # when multiple VFR share strings.
1247 $(DEST_DIR)\$(BASE_NAME).hii : $(HII_PACK_FILES)
1248 $(HIIPACK) create -g $(FILE_GUID) -p $(HII_PACK_FILES) -o $(DEST_DIR)\$(BASE_NAME).hii
1251 # If the build calls for creating an FFS file with the IFR included as
1252 # a separate binary (not compiled into the driver), then build the binary
1253 # section now. Note that the PACKAGE must be set correctly to actually get
1254 # this IFR section pulled into the FFS file.
1256 !IF ("$(HII_IFR_PACK_FILES)" != "")
1258 $(DEST_DIR)\$(BASE_NAME)IfrBin.sec : $(HII_IFR_PACK_FILES)
1259 $(HIIPACK) create -novarpacks -p $(HII_IFR_PACK_FILES) -o $(DEST_DIR)\$(BASE_NAME)IfrBin.hii
1260 $(GENSECTION) -I $(DEST_DIR)\$(BASE_NAME)IfrBin.hii -O $(DEST_DIR)\$(BASE_NAME)IfrBin.sec -S EFI_SECTION_RAW
1262 BIN_TARGETS = $(BIN_TARGETS) $(DEST_DIR)\$(BASE_NAME)IfrBin.sec
1267 # Build an FFS file from the sections and package
1269 $(TARGET_FFS_FILE) : $(TARGET_PE32) $(TARGET_DPX) $(TARGET_UI) $(TARGET_VER) $(PACKAGE_FILENAME)
1270 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
1272 !IF "$(CREATEDEPS)"=="YES"
1273 all : $(DEP_TARGETS)
1274 $(MAKE) -f $(MAKEFILE_NAME) all
1276 all : $(LOCALIZE_TARGETS) $(BIN_TARGETS) $(TARGET_FFS_FILE) $(DEP_TARGETS)
1280 # Remove the generated temp and final files for this modules.
1283 !IF ("$(FILE_GUID)" != "")
1284 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
1286 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
1287 @del /q $(DEST_OUTPUT_DIRS)
1289 [=============================================================================]
1291 # These are the commands to build vendor-provided *.EFI files into an FV.
1292 # To use them, create an INF file with BUILD_TYPE=BS_DRIVER_EFI.
1293 # This section, as it now exists, only supports boot service drivers.
1295 [=============================================================================]
1296 [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]
1298 # Defines for standard intermediate files and build targets. For the source
1299 # .efi file, take the one in the source directory if it exists. If there's not
1300 # one there, look for one in the processor-specfic subdirectory.
1302 !IF EXIST ("$(SOURCE_DIR)\$(BASE_NAME).efi")
1303 TARGET_EFI = $(SOURCE_DIR)\$(BASE_NAME).efi
1304 !ELSEIF EXIST ("$(SOURCE_DIR)\$(PROCESSOR)\$(BASE_NAME).efi")
1305 TARGET_EFI = $(SOURCE_DIR)\$(PROCESSOR)\$(BASE_NAME).efi
1307 !ERROR Pre-existing $(BASE_NAME).efi file not found in $(SOURCE_DIR) nor $(SOURCE_DIR)\$(PROCESSOR)
1310 TARGET_DPX = $(DEST_DIR)\$(BASE_NAME).dpx
1311 TARGET_UI = $(DEST_DIR)\$(BASE_NAME).ui
1312 TARGET_VER = $(DEST_DIR)\$(BASE_NAME).ver
1313 TARGET_MAP = $(BIN_DIR)\$(BASE_NAME).map
1314 TARGET_PDB = $(BIN_DIR)\$(BASE_NAME).pdb
1315 TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pe32
1316 TARGET_DLL = $(BIN_DIR)\$(BASE_NAME).dll
1319 # If building an application, then the target is a .app, not .dxe
1321 !IF "$(COMPONENT_TYPE)" == "APPLICATION"
1322 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).app
1324 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).dxe
1328 # Take the .efi file and make a .pe32 file
1330 $(TARGET_PE32) : $(TARGET_EFI)
1331 $(GENSECTION) -I $(TARGET_EFI) -O $(TARGET_PE32) -S EFI_SECTION_PE32
1334 # Create the user interface section
1336 $(TARGET_UI) : $(INF_FILENAME)
1337 $(GENSECTION) -O $(TARGET_UI) -S EFI_SECTION_USER_INTERFACE -A "$(BASE_NAME)"
1340 # Create the version section
1342 !IF "$(BUILD_NUMBER)" != ""
1343 !IF "$(VERSION_STRING)" != ""
1344 $(TARGET_VER) : $(INF_FILENAME)
1345 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER) -A "$(VERSION_STRING)"
1347 $(TARGET_VER) : $(INF_FILENAME)
1348 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER)
1352 echo. > $(TARGET_VER)
1353 type $(TARGET_VER) > $(TARGET_VER)
1357 # Makefile entries to create the dependency expression section.
1358 # Use the DPX file from the source directory unless an override file
1360 # If no DPX source file was specified, then create an empty file to
1363 !IF "$(DPX_SOURCE)" != ""
1364 DPX_SOURCE_FILE = $(SOURCE_DIR)\$(DPX_SOURCE)
1367 !IF "$(DPX_SOURCE_OVERRIDE)" != ""
1368 DPX_SOURCE_FILE = $(DPX_SOURCE_OVERRIDE)
1371 !IF "$(DPX_SOURCE_FILE)" != ""
1372 !IF EXIST ($(DPX_SOURCE_FILE))
1375 # Add build dependency check
1377 DEP_FILE = $(DEST_DIR)\$(BASE_NAME)dxs.dep
1379 !IF EXIST($(DEP_FILE))
1380 !INCLUDE $(DEP_FILE)
1383 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
1385 !IF EXIST($(TARGET_DPX))
1386 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs.dep
1387 !IF !EXIST($(DEP_FILE))
1393 # Update dep file for next round incremental build
1395 $(DEP_FILE) : $(TARGET_DPX)
1396 $(MAKEDEPS) -f $(DPX_SOURCE_FILE) $(DEP_FLAGS)
1400 $(TARGET_DPX) : $(DPX_SOURCE_FILE) $(INF_FILENAME)
1401 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
1402 $(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) > $*.tmp1
1404 -$(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) /showIncludes > $*.tmp1 2> $(DEST_DIR)\$(BASE_NAME)dxs.cl
1405 @$(MAKEDEPS) -f $(DEST_DIR)\$(BASE_NAME)dxs.cl $(DEP_FLAGS2)
1407 $(GENDEPEX) -I $*.tmp1 -O $*.tmp2
1408 $(GENSECTION) -I $*.tmp2 -O $@ -S $(DEPEX_TYPE)
1412 !ERROR Dependency expression source file "$(DPX_SOURCE_FILE)" does not exist.
1416 echo. > $(TARGET_DPX)
1417 type $(TARGET_DPX) > $(TARGET_DPX)
1421 # Build a FFS file from the sections and package
1423 $(TARGET_FFS_FILE) : $(TARGET_PE32) $(TARGET_DPX) $(TARGET_UI) $(TARGET_VER) $(PACKAGE_FILENAME)
1424 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
1426 all : $(TARGET_FFS_FILE)
1429 # Remove the generated temp and final files for this modules.
1432 !IF ("$(FILE_GUID)" != "")
1433 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
1435 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
1436 @del /q $(DEST_OUTPUT_DIRS)
1438 [=============================================================================]
1439 [Compile.Ia32.Bin|Bmp,Compile.x64.Bin|Bmp,Compile.Ipf.Bin|Bmp]
1441 # We simply copy the binary file from the source directory to the destination directory
1443 $(DEST_DIR)\$(BASE_NAME).bin : $(SOURCE_FILE_NAME)
1446 [=============================================================================]
1447 [Build.Ia32.BINARY|Legacy16|Logo,Build.Ipf.BINARY|Legacy16|Logo,Build.x64.BINARY|Legacy16|Logo]
1449 # Use GenFfsFile to convert it to an FFS file
1451 $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).ffs : $(DEST_DIR)\$(BASE_NAME).bin $(PACKAGE_FILENAME)
1452 $(GENSECTION) -I $(DEST_DIR)\$(BASE_NAME).bin -O $(DEST_DIR)\$(BASE_NAME).sec -S EFI_SECTION_RAW
1453 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
1455 all : $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).ffs
1458 # Remove the generated temp and final files for this modules.
1461 !IF ("$(FILE_GUID)" != "")
1462 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
1464 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
1465 @del /q $(DEST_OUTPUT_DIRS)
1467 [=============================================================================]
1468 [Build.Ia32.RAWFILE|CONFIG,Build.Ipf.RAWFILE|CONFIG,Build.x64.RAWFILE|CONFIG]
1470 # Use GenFfsFile to convert it to an raw FFS file
1472 $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).raw : $(DEST_DIR)\$(BASE_NAME).bin $(PACKAGE_FILENAME)
1473 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
1475 all : $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).raw
1478 # Remove the generated temp and final files for this modules.
1481 !IF ("$(FILE_GUID)" != "")
1482 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
1484 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
1485 @del /q $(DEST_OUTPUT_DIRS)
1487 [=============================================================================]
1489 # These are commands to compile unicode .uni files.
1491 [=============================================================================]
1492 [Compile.Ia32.Uni,Compile.Ipf.Uni,Compile.Ebc.Uni,Compile.x64.Uni]
1494 # Emit an error message if the file's base name is the same as the
1495 # component base name. This causes build issues.
1497 !IF "$(FILE)" == "$(BASE_NAME)"
1498 !ERROR Component Unicode string file name cannot be the same as the component BASE_NAME.
1502 # Always create dep file for uni file as it can be created at the same time when
1503 # strgather is parsing uni file.
1505 DEP_FILE = $(DEST_DIR)\$(FILE)Uni.dep
1507 !IF EXIST($(DEP_FILE))
1508 !INCLUDE $(DEP_FILE)
1511 $(DEST_DIR)\$(FILE).sdb : $(SOURCE_FILE_NAME) $(INF_FILENAME)
1512 $(STRGATHER) -parse -newdb -db $(DEST_DIR)\$(FILE).sdb -dep $(DEP_FILE) $(INC) $(SOURCE_FILE_NAME)
1514 SDB_FILES = $(SDB_FILES) $(DEST_DIR)\$(FILE).sdb
1515 STRGATHER_FLAGS = $(STRGATHER_FLAGS) -db $(DEST_DIR)\$(FILE).sdb
1518 [=============================================================================]
1519 [Compile.Ia32.Vfr,Compile.Ipf.Vfr,Compile.x64.Vfr]
1522 # Add build dependency check
1524 DEP_FILE = $(DEST_DIR)\$(FILE)Vfr.dep
1526 !IF EXIST($(DEP_FILE))
1527 !INCLUDE $(DEP_FILE)
1530 !IF EXIST($(DEST_DIR)\$(FILE).obj)
1531 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Vfr.dep
1532 !IF !EXIST($(DEP_FILE))
1538 # Update dep file for next round incremental build
1540 $(DEP_FILE) : $(DEST_DIR)\$(FILE).obj
1541 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)
1543 HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(FILE).hpk
1546 # Add a dummy command for building the HII pack file. In reality, it's built
1547 # below, but the C_FLAGS macro reference the target as $@, so you can't specify
1548 # the obj and hpk files as dual targets of the same command.
1550 $(DEST_DIR)\$(FILE).hpk : $(DEST_DIR)\$(FILE).obj
1552 $(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)
1553 $(VFRCOMPILE) $(VFRCOMPILE_FLAGS) $(INC) -ibin -od $(DEST_DIR)\$(SOURCE_RELATIVE_PATH) \
1554 -l $(VFR_FLAGS) $(SOURCE_FILE_NAME)
1555 $(CC) $(C_FLAGS) $(DEST_DIR)\$(FILE).c
1557 [=============================================================================]
1560 DEP_FILE = $(DEST_DIR)\$(FILE)Vfr.dep
1562 !IF EXIST($(DEST_DIR)\$(FILE).obj)
1563 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Vfr.dep
1564 !IF !EXIST($(DEP_FILE))
1569 !IF EXIST($(DEP_FILE))
1570 !INCLUDE $(DEP_FILE)
1574 # Update dep file for next round incremental build
1576 $(DEP_FILE) : $(DEST_DIR)\$(FILE).obj
1577 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)
1579 HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(FILE).hpk
1582 # Add a dummy command for building the HII pack file. In reality, it's built
1583 # below, but the C_FLAGS macro reference the target as $@, so you can't specify
1584 # the obj and hpk files as dual targets of the same command.
1586 $(DEST_DIR)\$(FILE).hpk : $(DEST_DIR)\$(FILE).obj
1588 $(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)
1589 $(VFRCOMPILE) $(VFRCOMPILE_FLAGS) $(INC) -ibin -od $(DEST_DIR)\$(SOURCE_RELATIVE_PATH) \
1590 -l $(VFR_FLAGS) $(SOURCE_FILE_NAME)
1591 $(EBC_CC) $(EBC_C_FLAGS) $(DEST_DIR)\$(FILE).c
1593 [=============================================================================]
1595 # Commands for building IFR as uncompressed binary into the FFS file. To
1596 # use it, set COMPILE_SELECT=.vfr=Ifr_Bin for the component in the DSC file.
1598 [=============================================================================]
1599 [Compile.Ia32.Ifr_Bin,Compile.Ipf.Ifr_Bin,Compile.x64.Ifr_Bin]
1602 # Add build dependency check
1604 DEP_FILE = $(DEST_DIR)\$(FILE)Vfr.dep
1606 !IF EXIST($(DEP_FILE))
1607 !INCLUDE $(DEP_FILE)
1610 !IF EXIST($(DEST_DIR)\$(FILE).obj)
1611 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Vfr.dep
1612 !IF !EXIST($(DEP_FILE))
1618 # Update dep file for next round incremental build
1620 $(DEP_FILE) : $(DEST_DIR)\$(FILE).obj
1621 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)
1623 HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(FILE).hpk
1626 # Add a dummy command for building the HII pack file. In reality, it's built
1627 # below, but the C_FLAGS macro reference the target as $@, so you can't specify
1628 # the obj and hpk files as dual targets of the same command.
1630 $(DEST_DIR)\$(FILE).hpk : $(DEST_DIR)\$(FILE).obj
1632 $(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)
1633 $(VFRCOMPILE) $(VFRCOMPILE_FLAGS) $(INC) -ibin -od $(DEST_DIR)\$(SOURCE_RELATIVE_PATH) \
1634 -l $(VFR_FLAGS) $(SOURCE_FILE_NAME)
1635 $(CC) $(C_FLAGS) $(DEST_DIR)\$(FILE).c
1638 # Add to the variable that contains the list of VFR binary files we're going
1639 # to merge together at the end of the build.
1641 HII_IFR_PACK_FILES = $(HII_IFR_PACK_FILES) $(DEST_DIR)\$(FILE).hpk
1643 [=============================================================================]
1645 # Commands for building IFR as uncompressed binary into the FFS file. To
1646 # use it, set COMPILE_SELECT=.vfr=Ifr_Bin for the component in the DSC file.
1648 [=============================================================================]
1649 [Compile.Ebc.Ifr_Bin]
1652 # Add build dependency check
1654 DEP_FILE = $(DEST_DIR)\$(FILE)Vfr.dep
1656 !IF EXIST($(DEP_FILE))
1657 !INCLUDE $(DEP_FILE)
1660 !IF EXIST($(DEST_DIR)\$(FILE).obj)
1661 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Vfr.dep
1662 !IF !EXIST($(DEP_FILE))
1668 # Update dep file for next round incremental build
1670 $(DEP_FILE) : $(DEST_DIR)\$(FILE).obj
1671 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)
1673 HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(FILE).hpk
1676 # Add a dummy command for building the HII pack file. In reality, it's built
1677 # below, but the C_FLAGS macro reference the target as $@, so you can't specify
1678 # the obj and hpk files as dual targets of the same command.
1680 $(DEST_DIR)\$(FILE).hpk : $(DEST_DIR)\$(FILE).obj
1682 $(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)
1683 $(VFRCOMPILE) $(VFRCOMPILE_FLAGS) $(INC) -ibin -od $(DEST_DIR)\$(SOURCE_RELATIVE_PATH) \
1684 -l $(VFR_FLAGS) $(SOURCE_FILE_NAME)
1685 $(EBC_CC) $(EBC_C_FLAGS) $(DEST_DIR)\$(FILE).c
1688 # Add to the variable that contains the list of VFR binary files we're going
1689 # to merge together at the end of the build.
1691 HII_IFR_PACK_FILES = $(HII_IFR_PACK_FILES) $(DEST_DIR)\$(FILE).hpk
1693 [=============================================================================]
1694 [Compile.Ia32.Fv,Compile.Ipf.Fv,Compile.x64.Fv]
1696 # Run GenSection on the firmware volume image.
1698 $(DEST_DIR)\$(SOURCE_FV)Fv.sec : $(SOURCE_FILE_NAME)
1699 $(GENSECTION) -I $(SOURCE_FILE_NAME) -O $(DEST_DIR)\$(SOURCE_FV)Fv.sec -S EFI_SECTION_FIRMWARE_VOLUME_IMAGE
1701 [=============================================================================]