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 [=============================================================================]
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) $(INF_FILENAME)
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 # Set some required macros
304 MAKEFILE_MACROS = SOURCE_DIR=$(SOURCE_DIR) \
305 BUILD_DIR=$(BUILD_DIR) \
306 FILE_GUID=$(FILE_GUID) \
307 DEST_DIR=$(DEST_DIR) \
308 PROCESSOR=$(PROCESSOR) \
309 TOOLCHAIN=TOOLCHAIN_$(PROCESSOR) \
310 BASE_NAME=$(BASE_NAME) \
311 PACKAGE_FILENAME=$(PACKAGE_FILENAME)
314 # Just call the makefile from the source directory, passing in some
318 $(MAKE) -f $(SOURCE_DIR)\makefile.new all $(MAKEFILE_MACROS)
321 # Remove the generated temp and final files for this modules.
324 @- $(MAKE) -f $(SOURCE_DIR)\makefile.new clean $(MAKEFILE_MACROS) > NUL 2>&1
325 !IF ("$(FILE_GUID)" != "")
326 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
328 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
329 @del /q $(DEST_OUTPUT_DIRS)
331 [=============================================================================]
333 # Instructions for building a component that uses a custom makefile. Encoding
334 # is [build.$(PROCESSOR).$(BUILD_TYPE)].
336 # To build these components, simply call the makefile from the source
339 [=============================================================================]
340 [Build.Ia32.Custom_Makefile,Build.Ipf.Custom_Makefile,Build.Ebc.Custom_Makefile,Build.x64.Custom_Makefile]
343 # Set some required macros
345 MAKEFILE_MACROS = SOURCE_DIR=$(SOURCE_DIR) \
346 BUILD_DIR=$(BUILD_DIR) \
347 DEST_DIR=$(DEST_DIR) \
348 FILE_GUID=$(FILE_GUID) \
349 PROCESSOR=$(PROCESSOR) \
350 TOOLCHAIN=TOOLCHAIN_$(PROCESSOR) \
351 BASE_NAME=$(BASE_NAME) \
352 PLATFORM=$(PLATFORM) \
353 SOURCE_FV=$(SOURCE_FV) \
354 PACKAGE_FILENAME=$(PACKAGE_FILENAME)
357 # Just call the makefile from the source directory, passing in some
361 $(MAKE) -f $(SOURCE_DIR)\makefile all $(MAKEFILE_MACROS)
364 # Remove the generated temp and final files for this modules.
367 @- $(MAKE) -f $(SOURCE_DIR)\makefile clean $(MAKEFILE_MACROS) > NUL 2>&1
368 !IF ("$(FILE_GUID)" != "")
369 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
371 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
372 @del /q $(DEST_OUTPUT_DIRS)
374 [=============================================================================]
376 # These commands are used to build libraries
378 [=============================================================================]
379 [Build.Ia32.LIBRARY,Build.Ipf.LIBRARY,Build.x64.LIBRARY]
381 # LIB all the object files into to our target lib file. Put
382 # a dependency on the component's INF file in case it changes.
384 LIB_NAME = $(LIB_DIR)\$(BASE_NAME).lib
387 # $(DEP_TARGETS) are not needed for binary build.
389 !IF ("$(BINARY)" == "TRUE") || (("$(BINARY)" == "") && ("$(EFI_BINARY_LIBRARY)" == "YES"))
395 # Module can be built from source code or binary files.
397 !IF ((("$(BINARY)" == "TRUE") || (("$(BINARY)" == "") && ("$(EFI_BINARY_LIBRARY)" == "YES"))) \
398 && EXIST($(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).lib))
399 $(LIB_NAME) : $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).lib
400 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).lib $(LIB_NAME) /Y
401 if exist $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME)Obj.pdb \
402 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME)Obj.pdb $(DEST_DIR)\$(BASE_NAME)Obj.pdb /Y
404 $(LIB_NAME) : $(OBJECTS) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)
405 $(LIB) $(LIB_FLAGS) $(OBJECTS) $(LIBS) /OUT:$@
406 !IF ("$(EFI_BINARY_BUILD)" == "YES")
407 if not exist $(EFI_PLATFORM_BIN)\$(PROCESSOR) mkdir $(EFI_PLATFORM_BIN)\$(PROCESSOR)
408 if exist $(LIB_NAME) copy $(LIB_NAME) $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).lib /Y
409 if exist $(DEST_DIR)\$(BASE_NAME)Obj.pdb copy $(DEST_DIR)\$(BASE_NAME)Obj.pdb $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME)Obj.pdb /Y
413 !IF "$(CREATEDEPS)"=="YES"
415 $(MAKE) -f $(MAKEFILE_NAME) all
417 all : $(LIB_NAME) $(DEP_TARGETS)
421 # Remove the generated temp and final files for this modules.
424 !IF ("$(FILE_GUID)" != "")
425 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
427 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
428 @del /q $(DEST_OUTPUT_DIRS)
430 [=============================================================================]
433 # LIB all the object files into to our target lib file. Put
434 # a dependency on the component's INF file in case it changes.
436 LIB_NAME = $(LIB_DIR)\$(BASE_NAME).lib
438 $(LIB_NAME) : $(OBJECTS) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)
439 $(EBC_LIB) $(EBC_LIB_FLAGS) $(OBJECTS) $(LIBS) /OUT:$@
441 !IF "$(CREATEDEPS)"=="YES"
443 $(MAKE) -f $(MAKEFILE_NAME) all
445 all : $(LIB_NAME) $(DEP_TARGETS)
449 # Remove the generated temp and final files for this modules.
452 !IF ("$(FILE_GUID)" != "")
453 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
455 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
456 @del /q $(DEST_OUTPUT_DIRS)
458 [=============================================================================]
460 # This is the Build.$(PROCESSOR).$(COMPONENT_TYPE) section that tells how to
461 # convert a firmware volume into an FV FFS file. Simply run it through
462 # GenFfsFile with the appropriate package file. SOURCE_FV must be defined
463 # in the component INF file Defines section.
465 [=============================================================================]
466 [Build.Ia32.FvImageFile,Build.x64.FvImageFile,Build.Ipf.FvImageFile]
468 all : $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).Fvi
471 # Run GenFfsFile on the package file and FV file to create the firmware
472 # volume FFS file. This FFS file maybe contain one pad section for alignment requirement.
474 $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).Fvi : $(DEST_DIR)\$(SOURCE_FV)Fv.sec $(PACKAGE_FILENAME) $(PAD_SECTION)
475 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
478 # Remove the generated temp and final files for this modules.
481 !IF ("$(FILE_GUID)" != "")
482 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
484 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
485 @del /q $(DEST_OUTPUT_DIRS)
487 [=============================================================================]
489 # Since many of the steps are the same for the different component types, we
490 # share this section for BS_DRIVER, RT_DRIVER, .... and IFDEF the parts that
491 # differ. The entire section gets dumped to the output makefile.
493 [=============================================================================]
494 [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]
496 !IF "$(LOCALIZE)" == "YES"
498 !IF (("$(EFI_GENERATE_HII_RESOURCE)" == "YES") && ("$(EFI_SPECIFICATION_VERSION)" >= "0x0002000A"))
500 # This will generate HII resource section in PE/COFF image.
502 # Note: when HII package list is built into resource section, Driver no longer
503 # refer to C array generated by VfrCompiler ($(FILE_NAME)Bin) and StrGather
504 # ($(BASE_NAME)Strings); while in current build rule, those C array objects
505 # will still be linked with the Driver, so please turn on link flag "/OPT:REF"
506 # to minimize the code size.
508 HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(BASE_NAME)Strings.hpk
509 LOCALIZE_TARGETS = $(LOCALIZE_TARGETS) $(DEST_DIR)\$(BASE_NAME).res
510 LINK_FLAGS_DLL = $(LINK_FLAGS_DLL) $(DEST_DIR)\$(BASE_NAME).res
512 $(DEST_DIR)\$(BASE_NAME).rc : $(HII_PACK_FILES)
513 $(HIIPACK) -g $(FILE_GUID) $(HII_PACK_FILES) -rc $(DEST_DIR)\$(BASE_NAME).rc -hii $(DEST_DIR)\$(BASE_NAME).hii
515 $(DEST_DIR)\$(BASE_NAME).res : $(DEST_DIR)\$(BASE_NAME).rc
516 $(RC) /fo $(DEST_DIR)\$(BASE_NAME).res $(DEST_DIR)\$(BASE_NAME).rc
520 !IF (("$(EFI_GENERATE_HII_EXPORT)" == "YES") && ("$(EFI_SPECIFICATION_VERSION)" < "0x0002000A"))
522 # There will be one HII pack containing all the strings. Add that file
523 # to the list of HII pack files we'll use to create our final HII export file.
525 HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(BASE_NAME)Strings.hpk
526 LOCALIZE_TARGETS = $(LOCALIZE_TARGETS) $(DEST_DIR)\$(BASE_NAME).hii
529 !IF ("$(EFI_SPECIFICATION_VERSION)" >= "0x0002000A")
531 # Note: currently -ppflag option is only available for UefiStrGather
532 # Note: /GS- will cause warning for preprocess, so filter it out from STRGATHER_PPFLAG
534 STRGATHER_PPFLAG = $(C_FLAGS: /GS-=)
535 STRGATHER_FLAGS = $(STRGATHER_FLAGS) -ppflag "$(STRGATHER_PPFLAG)" -oh $(DEST_DIR)\$(BASE_NAME)StrDefs.h
538 $(DEST_DIR)\$(BASE_NAME).sdb : $(SDB_FILES) $(SOURCE_FILES)
539 $(STRGATHER) -scan -vdbr $(STRGATHER_FLAGS) -od $(DEST_DIR)\$(BASE_NAME).sdb \
540 -skipext .uni -skipext .h $(SOURCE_FILES)
542 $(DEST_DIR)\$(BASE_NAME)Strings.c : $(DEST_DIR)\$(BASE_NAME).sdb
543 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \
544 -oc $(DEST_DIR)\$(BASE_NAME)Strings.c
546 $(DEST_DIR)\$(BASE_NAME)StrDefs.h : $(DEST_DIR)\$(BASE_NAME).sdb
547 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \
548 -oh $(DEST_DIR)\$(BASE_NAME)StrDefs.h
550 $(DEST_DIR)\$(BASE_NAME)Strings.hpk : $(DEST_DIR)\$(BASE_NAME).sdb
551 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \
552 -hpk $(DEST_DIR)\$(BASE_NAME)Strings.hpk
554 OBJECTS = $(OBJECTS) $(DEST_DIR)\$(BASE_NAME)Strings.obj
556 $(DEST_DIR)\$(BASE_NAME)Strings.obj : $(DEST_DIR)\$(BASE_NAME)Strings.c $(INF_FILENAME) $(ALL_DEPS)
557 $(CC) $(C_FLAGS) $(DEST_DIR)\$(BASE_NAME)Strings.c
559 LOCALIZE_TARGETS = $(DEST_DIR)\$(BASE_NAME)StrDefs.h $(LOCALIZE_TARGETS)
564 # If we have any objects associated with this component, then we're
565 # going to build a local library from them.
568 !ERROR No source files to build were defined in the INF file
571 TARGET_LOCAL_LIB = $(DEST_DIR)\$(BASE_NAME)Local.lib
574 # LIB all the object files into our (local) target lib file. Put
575 # a dependency on the component's INF file in case it changes.
577 $(TARGET_LOCAL_LIB) : $(OBJECTS) $(INF_FILENAME) $(ENV_DEPS)
578 $(LIB) $(LIB_FLAGS) $(OBJECTS) /OUT:$@
581 # Defines for standard intermediate files and build targets
583 TARGET_DLL = $(BIN_DIR)\$(BASE_NAME).dll
584 TARGET_EFI = $(BIN_DIR)\$(BASE_NAME).efi
585 TARGET_DPX = $(DEST_DIR)\$(BASE_NAME).dpx
586 TARGET_UI = $(DEST_DIR)\$(BASE_NAME).ui
587 TARGET_VER = $(DEST_DIR)\$(BASE_NAME).ver
588 TARGET_MAP = $(BIN_DIR)\$(BASE_NAME).map
589 TARGET_PDB = $(BIN_DIR)\$(BASE_NAME).pdb
590 TARGET_SYM = $(BIN_DIR)\$(BASE_NAME).sym
593 # Target executable section extension depends on the component type.
594 # Only define "TARGET_DXE_DPX" if it's a combined peim driver.
596 !IF "$(COMPONENT_TYPE)" == "PIC_PEIM"
597 TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pic
599 TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pe32
603 # Target FFS file extension depends on the component type
604 # Also define "TARGET_DXE_DPX" if it's a combined PEIM driver.
606 SUBSYSTEM = EFI_BOOT_SERVICE_DRIVER
608 !IF "$(COMPONENT_TYPE)" == "APPLICATION"
609 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).app
610 SUBSYSTEM = EFI_APPLICATION
611 !ELSE IF "$(COMPONENT_TYPE)" == "PEI_CORE"
612 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei
613 !ELSE IF "$(COMPONENT_TYPE)" == "PE32_PEIM"
614 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei
615 !ELSE IF "$(COMPONENT_TYPE)" == "RELOCATABLE_PEIM"
616 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei
617 !ELSE IF "$(COMPONENT_TYPE)" == "PIC_PEIM"
618 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei
619 !ELSE IF "$(COMPONENT_TYPE)" == "COMBINED_PEIM_DRIVER"
620 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei
621 TARGET_DXE_DPX = $(DEST_DIR)\$(BASE_NAME).dpxd
623 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).dxe
627 # Different methods to build section based on if PIC_PEIM
629 !IF "$(COMPONENT_TYPE)" == "PIC_PEIM"
631 $(TARGET_PE32) : $(TARGET_DLL)
632 $(PE2BIN) $(TARGET_DLL) $(DEST_DIR)\$(BASE_NAME).TMP
634 # BUGBUG: Build PEIM header, needs to go away with new PEI.
636 $(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
637 $(GENSECTION) -I $(TARGET_PIC_PEI).tmp -O $(TARGET_PE32) -S EFI_SECTION_PIC
638 del $(DEST_DIR)\$(BASE_NAME).TMP
642 $(TARGET_PE32) : $(TARGET_EFI)
643 $(GENSECTION) -I $(TARGET_EFI) -O $(TARGET_PE32) -S EFI_SECTION_PE32
646 # $(DEP_TARGETS) are not needed for binary build.
648 !IF "$(BINARY)" == "TRUE"
654 # Build module to generate *.efi file from source code or binary file.
656 !IF (("$(BINARY)" == "TRUE") && EXIST($(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi))
658 $(TARGET_EFI) : $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi
659 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi $(TARGET_EFI) /Y
660 if exist $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb \
661 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb $(TARGET_PDB) /Y
663 $(TARGET_EFI) : $(TARGET_DLL) $(INF_FILENAME)
664 $(FWIMAGE) -t 0 $(COMPONENT_TYPE) $(TARGET_DLL) $(TARGET_EFI)
665 !IF ("$(EFI_BINARY_BUILD)" == "YES")
666 if not exist $(EFI_PLATFORM_BIN)\$(PROCESSOR) mkdir $(EFI_PLATFORM_BIN)\$(PROCESSOR)
667 if exist $(TARGET_EFI) copy $(TARGET_EFI) $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi /Y
668 if exist $(TARGET_PDB) copy $(TARGET_PDB) $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb /Y
675 # Link all objects and libs to create the executable
677 $(TARGET_DLL) : $(TARGET_LOCAL_LIB) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)
678 $(LINK) $(LINK_FLAGS_DLL) $(LIBS) /ENTRY:$(IMAGE_ENTRY_POINT) \
679 $(TARGET_LOCAL_LIB) /OUT:$(TARGET_DLL) /MAP:$(TARGET_MAP) \
681 $(SETSTAMP) $(TARGET_DLL) $(BUILD_DIR)\GenStamp.txt
682 !IF "$(EFI_GENERATE_SYM_FILE)" == "YES"
683 if exist $(TARGET_PDB) $(PE2SYM) $(TARGET_PDB) $(TARGET_SYM)
686 !IF "$(EFI_ZERO_DEBUG_DATA)" == "YES"
687 $(ZERODEBUGDATA) $(TARGET_DLL)
691 # Create the user interface section
693 $(TARGET_UI) : $(INF_FILENAME)
694 $(GENSECTION) -O $(TARGET_UI) -S EFI_SECTION_USER_INTERFACE -A "$(BASE_NAME)"
697 # Create the version section
699 !IF "$(BUILD_NUMBER)" != ""
700 !IF "$(VERSION_STRING)" != ""
701 $(TARGET_VER) : $(INF_FILENAME)
702 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER) -A "$(VERSION_STRING)"
704 $(TARGET_VER) : $(INF_FILENAME)
705 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER)
708 $(TARGET_VER) : $(INF_FILENAME)
710 type $(TARGET_VER)>$(TARGET_VER)
714 # Makefile entries to create the dependency expression section.
715 # Use the DPX file from the source directory unless an override file
717 # If no DPX source file was specified, then create an empty file to
720 !IF "$(DPX_SOURCE)" != ""
721 DPX_SOURCE_FILE = $(SOURCE_DIR)\$(DPX_SOURCE)
724 !IF "$(DPX_SOURCE_OVERRIDE)" != ""
725 DPX_SOURCE_FILE = $(DPX_SOURCE_OVERRIDE)
728 !IF "$(DPX_SOURCE_FILE)" != ""
729 !IF EXIST ($(DPX_SOURCE_FILE))
732 # Add build dependency check
734 DEP_FILE = $(DEST_DIR)\$(BASE_NAME)dxs.dep
736 !IF EXIST($(DEP_FILE))
740 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
742 !IF EXIST($(TARGET_DPX))
743 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs.dep
744 !IF !EXIST($(DEP_FILE))
750 # Update dep file for next round incremental build
752 $(DEP_FILE) : $(TARGET_DPX)
753 $(MAKEDEPS) -f $(DPX_SOURCE_FILE) $(DEP_FLAGS)
757 $(TARGET_DPX) : $(DPX_SOURCE_FILE) $(INF_FILENAME)
758 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
759 $(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) > $*.tmp1
761 -$(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) /showIncludes > $*.tmp1 2> $(DEST_DIR)\$(BASE_NAME)dxs.cl
762 @$(MAKEDEPS) -f $(DEST_DIR)\$(BASE_NAME)dxs.cl $(DEP_FLAGS2)
764 $(GENDEPEX) -I $*.tmp1 -O $*.tmp2
765 $(GENSECTION) -I $*.tmp2 -O $@ -S $(DEPEX_TYPE)
769 !ERROR Dependency expression source file "$(DPX_SOURCE_FILE)" does not exist.
772 $(TARGET_DPX) : $(INF_FILENAME)
773 echo. > $(TARGET_DPX)
774 type $(TARGET_DPX) > $(TARGET_DPX)
778 # Makefile entries for DXE DPX for combined PEIM drivers.
779 # If a DXE_DPX_SOURCE file was specified in the INF file, use it. Otherwise
780 # create an empty file and use it as a DPX file.
782 !IF "$(COMPONENT_TYPE)" == "COMBINED_PEIM_DRIVER"
783 !IF "$(DXE_DPX_SOURCE)" != ""
784 !IF EXIST ($(SOURCE_DIR)\$(DXE_DPX_SOURCE))
787 # Add build dependency check
789 DEP_FILE = $(DEST_DIR)\$(BASE_NAME)dxs2.dep
791 !IF EXIST($(DEP_FILE))
795 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
797 !IF EXIST($(TARGET_DXE_DPX))
798 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs2.dep
799 !IF !EXIST($(DEP_FILE))
805 # Update dep file for next round incremental build
807 $(DEP_FILE) : $(TARGET_DXE_DPX)
808 $(MAKEDEPS) -f $(SOURCE_DIR)\$(DXE_DPX_SOURCE) $(DEP_FLAGS)
812 $(TARGET_DXE_DPX) : $(SOURCE_DIR)\$(DXE_DPX_SOURCE) $(INF_FILENAME)
813 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
814 $(CC) $(C_FLAGS_DPX) $(SOURCE_DIR)\$(DXE_DPX_SOURCE) > $*.tmp1
816 -$(CC) $(C_FLAGS_DPX) $(SOURCE_DIR)\$(DXE_DPX_SOURCE) /showIncludes > $*.tmp1 2> $(DEST_DIR)\$(BASE_NAME)dxs2.cl
817 @$(MAKEDEPS) -f $(DEST_DIR)\$(BASE_NAME)dxs2.cl $(DEP_FLAGS2)
819 $(GENDEPEX) -I $*.tmp1 -O $*.tmp2
820 $(GENSECTION) -I $*.tmp2 -O $@ -S EFI_SECTION_DXE_DEPEX
824 !ERROR Dependency expression source file "$(SOURCE_DIR)\$(DXE_DPX_SOURCE)" does not exist.
827 $(TARGET_DXE_DPX) : $(INF_FILENAME)
828 echo. > $(TARGET_DXE_DPX)
829 type $(TARGET_DXE_DPX) > $(TARGET_DXE_DPX)
834 # Describe how to build the HII export file from all the input HII pack files.
835 # Use the FFS file GUID for the package GUID in the export file. Only used
836 # when multiple VFR share strings.
838 $(DEST_DIR)\$(BASE_NAME).hii : $(HII_PACK_FILES)
839 $(HIIPACK) create -g $(FILE_GUID) -p $(HII_PACK_FILES) -o $(DEST_DIR)\$(BASE_NAME).hii
842 # If the build calls for creating an FFS file with the IFR included as
843 # a separate binary (not compiled into the driver), then build the binary
844 # section now. Note that the PACKAGE must be set correctly to actually get
845 # this IFR section pulled into the FFS file.
847 !IF ("$(HII_IFR_PACK_FILES)" != "")
849 $(DEST_DIR)\$(BASE_NAME)IfrBin.sec : $(HII_IFR_PACK_FILES)
850 $(HIIPACK) create -novarpacks -p $(HII_IFR_PACK_FILES) -o $(DEST_DIR)\$(BASE_NAME)IfrBin.hii
851 $(GENSECTION) -I $(DEST_DIR)\$(BASE_NAME)IfrBin.hii -O $(DEST_DIR)\$(BASE_NAME)IfrBin.sec -S EFI_SECTION_RAW
853 BIN_TARGETS = $(BIN_TARGETS) $(DEST_DIR)\$(BASE_NAME)IfrBin.sec
858 # Build a FFS file from the sections and package
860 $(TARGET_FFS_FILE) : $(TARGET_PE32) $(TARGET_DPX) $(TARGET_UI) $(TARGET_VER) $(TARGET_DXE_DPX) $(PACKAGE_FILENAME)
862 # Some of our components require padding to align code
864 !IF "$(PROCESSOR)" == "IPF"
865 !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"
866 copy $(BIN_DIR)\Blank.pad $(DEST_DIR)
869 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
871 !IF "$(CREATEDEPS)"=="YES"
873 $(MAKE) -f $(MAKEFILE_NAME) all
875 all : $(LOCALIZE_TARGETS) $(BIN_TARGETS) $(TARGET_FFS_FILE) $(DEP_TARGETS)
879 # Remove the generated temp and final files for this modules.
882 !IF ("$(FILE_GUID)" != "")
883 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
885 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
886 @del /q $(DEST_OUTPUT_DIRS)
888 [=============================================================================]
889 [Build.Ia32.TE_PEIM,Build.Ipf.TE_PEIM,Build.x64.TE_PEIM]
891 # Define the library file we'll build if we have any objects defined.
894 TARGET_LOCAL_LIB = $(DEST_DIR)\$(BASE_NAME)Local.lib
896 # LIB all the object files into our (local) target lib file. Put
897 # a dependency on the component's INF file in case it changes.
899 $(TARGET_LOCAL_LIB) : $(OBJECTS) $(INF_FILENAME) $(ENV_DEPS)
900 $(LIB) $(LIB_FLAGS) $(OBJECTS) /OUT:$@
903 !ERROR No source files to build were defined in the INF file
907 # Defines for standard intermediate files and build targets
909 TARGET_DLL = $(BIN_DIR)\$(BASE_NAME).dll
910 TARGET_EFI = $(BIN_DIR)\$(BASE_NAME).efi
911 TARGET_DPX = $(DEST_DIR)\$(BASE_NAME).dpx
912 TARGET_UI = $(DEST_DIR)\$(BASE_NAME).ui
913 TARGET_VER = $(DEST_DIR)\$(BASE_NAME).ver
914 TARGET_MAP = $(BIN_DIR)\$(BASE_NAME).map
915 TARGET_PDB = $(BIN_DIR)\$(BASE_NAME).pdb
916 TARGET_SYM = $(BIN_DIR)\$(BASE_NAME).sym
917 TARGET_TE = $(BIN_DIR)\$(BASE_NAME).te
918 TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pe32
919 TARGET_TES = $(DEST_DIR)\$(BASE_NAME).tes
920 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei
923 # Create our TE section from our TE file
925 $(TARGET_TES) : $(TARGET_TE)
926 $(GENSECTION) -I $(TARGET_TE) -O $(TARGET_TES) -S EFI_SECTION_TE
929 # $(DEP_TARGETS) are not needed for binary build.
931 !IF "$(BINARY)" == "TRUE"
937 # Build module to generate *.efi file from source code or binary file.
939 !IF (("$(BINARY)" == "TRUE") && EXIST($(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi))
940 $(TARGET_EFI) : $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi
941 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi $(TARGET_EFI) /Y
942 if exist $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb \
943 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb $(TARGET_PDB) /Y
945 $(TARGET_EFI) : $(TARGET_DLL) $(INF_FILENAME)
946 $(FWIMAGE) $(COMPONENT_TYPE) $(TARGET_DLL) $(TARGET_EFI)
947 !IF ("$(EFI_BINARY_BUILD)" == "YES")
948 if not exist $(EFI_PLATFORM_BIN)\$(PROCESSOR) mkdir $(EFI_PLATFORM_BIN)\$(PROCESSOR)
949 if exist $(TARGET_EFI) copy $(TARGET_EFI) $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi /Y
950 if exist $(TARGET_PDB) copy $(TARGET_PDB) $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb /Y
955 # Run GenTEImage on the built .efi file to create our TE file.
957 $(TARGET_TE) : $(TARGET_EFI)
958 $(GENTEIMAGE) -o $(TARGET_TE) $(TARGET_EFI)
961 # Link all objects and libs to create the executable
963 $(TARGET_DLL) : $(TARGET_LOCAL_LIB) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)
964 $(LINK) $(LINK_FLAGS_DLL) $(LIBS) /ENTRY:$(IMAGE_ENTRY_POINT) \
965 $(TARGET_LOCAL_LIB) /OUT:$(TARGET_DLL) /MAP:$(TARGET_MAP) \
967 $(SETSTAMP) $(TARGET_DLL) $(BUILD_DIR)\GenStamp.txt
968 !IF "$(EFI_GENERATE_SYM_FILE)" == "YES"
969 if exist $(TARGET_PDB) $(PE2SYM) $(TARGET_PDB) $(TARGET_SYM)
972 !IF "$(EFI_ZERO_DEBUG_DATA)" == "YES"
973 $(ZERODEBUGDATA) $(TARGET_DLL)
977 # Create the user interface section
979 $(TARGET_UI) : $(INF_FILENAME)
980 $(GENSECTION) -O $(TARGET_UI) -S EFI_SECTION_USER_INTERFACE -A "$(BASE_NAME)"
983 # Create the version section
985 !IF "$(BUILD_NUMBER)" != ""
986 !IF "$(VERSION_STRING)" != ""
987 $(TARGET_VER) : $(INF_FILENAME)
988 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER) -A "$(VERSION_STRING)"
990 $(TARGET_VER) : $(INF_FILENAME)
991 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER)
994 $(TARGET_VER) : $(INF_FILENAME)
996 type $(TARGET_VER)>$(TARGET_VER)
1000 # Makefile entries to create the dependency expression section.
1001 # Use the DPX file from the source directory unless an override file
1003 # If no DPX source file was specified, then create an empty file to
1006 !IF "$(DPX_SOURCE)" != ""
1007 DPX_SOURCE_FILE = $(SOURCE_DIR)\$(DPX_SOURCE)
1010 !IF "$(DPX_SOURCE_OVERRIDE)" != ""
1011 DPX_SOURCE_FILE = $(DPX_SOURCE_OVERRIDE)
1014 !IF "$(DPX_SOURCE_FILE)" != ""
1015 !IF EXIST ($(DPX_SOURCE_FILE))
1018 # Add build dependency check
1020 DEP_FILE = $(DEST_DIR)\$(BASE_NAME)dxs.dep
1022 !IF EXIST($(DEP_FILE))
1023 !INCLUDE $(DEP_FILE)
1026 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
1028 !IF EXIST($(TARGET_DPX))
1029 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs.dep
1030 !IF !EXIST($(DEP_FILE))
1036 # Update dep file for next round incremental build
1038 $(DEP_FILE) : $(TARGET_DPX)
1039 $(MAKEDEPS) -f $(DPX_SOURCE_FILE) $(DEP_FLAGS)
1043 $(TARGET_DPX) : $(DPX_SOURCE_FILE) $(INF_FILENAME)
1044 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
1045 $(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) > $*.tmp1
1047 -$(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) /showIncludes > $*.tmp1 2> $(DEST_DIR)\$(BASE_NAME)dxs.cl
1048 @$(MAKEDEPS) -f $(DEST_DIR)\$(BASE_NAME)dxs.cl $(DEP_FLAGS2)
1050 $(GENDEPEX) -I $*.tmp1 -O $*.tmp2
1051 $(GENSECTION) -I $*.tmp2 -O $@ -S $(DEPEX_TYPE)
1055 !ERROR Dependency expression source file "$(DPX_SOURCE_FILE)" does not exist.
1058 $(TARGET_DPX) : $(INF_FILENAME)
1059 echo. > $(TARGET_DPX)
1060 type $(TARGET_DPX) > $(TARGET_DPX)
1064 # Build an FFS file from the sections and package
1066 $(TARGET_FFS_FILE) : $(TARGET_TES) $(TARGET_DPX) $(TARGET_UI) $(TARGET_VER) $(PACKAGE_FILENAME)
1067 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
1069 !IF "$(CREATEDEPS)"=="YES"
1070 all : $(DEP_TARGETS)
1071 $(MAKE) -f $(MAKEFILE_NAME) all
1073 all : $(TARGET_FFS_FILE) $(DEP_TARGETS)
1077 # Remove the generated temp and final files for this modules.
1080 !IF ("$(FILE_GUID)" != "")
1081 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
1083 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
1084 @del /q $(DEST_OUTPUT_DIRS)
1086 [=============================================================================]
1088 # These are the commands to build EBC EFI targets
1090 [=============================================================================]
1091 [Build.Ebc.BS_DRIVER|RT_DRIVER|APPLICATION]
1094 # Add the EBC library to our list of libs
1096 LIBS = $(LIBS) $(EBC_TOOLS_PATH)\lib\EbcLib.lib
1098 !IF "$(LOCALIZE)" == "YES"
1100 !IF (("$(EFI_GENERATE_HII_RESOURCE)" == "YES") && ("$(EFI_SPECIFICATION_VERSION)" >= "0x0002000A"))
1102 # This will generate HII resource section in PE/COFF image.
1104 # Note: when HII package list is built into resource section, Driver no longer
1105 # refer to C array generated by VfrCompiler ($(FILE_NAME)Bin) and StrGather
1106 # ($(BASE_NAME)Strings); while in current build rule, those C array objects
1107 # will still be linked with the Driver, so please turn on link flag "/OPT:REF"
1108 # to minimize the code size.
1110 HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(BASE_NAME)Strings.hpk
1111 LOCALIZE_TARGETS = $(LOCALIZE_TARGETS) $(DEST_DIR)\$(BASE_NAME).res
1112 OBJECTS = $(OBJECTS) $(DEST_DIR)\$(BASE_NAME).res
1114 $(DEST_DIR)\$(BASE_NAME).rc : $(HII_PACK_FILES)
1115 $(HIIPACK) -g $(FILE_GUID) $(HII_PACK_FILES) -rc $(DEST_DIR)\$(BASE_NAME).rc -hii $(DEST_DIR)\$(BASE_NAME).hii
1117 $(DEST_DIR)\$(BASE_NAME).res : $(DEST_DIR)\$(BASE_NAME).rc
1118 $(RC) /fo $(DEST_DIR)\$(BASE_NAME).res $(DEST_DIR)\$(BASE_NAME).rc
1122 !IF (("$(EFI_GENERATE_HII_EXPORT)" == "YES") && ("$(EFI_SPECIFICATION_VERSION)" < "0x0002000A"))
1124 # There will be one HII pack containing all the strings. Add that file
1125 # to the list of HII pack files we'll use to create our final HII export file.
1127 HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(BASE_NAME)Strings.hpk
1129 LOCALIZE_TARGETS = $(LOCALIZE_TARGETS) $(DEST_DIR)\$(BASE_NAME).hii
1132 !IF ("$(EFI_SPECIFICATION_VERSION)" >= "0x0002000A")
1134 # Note: currently -ppflag option is only available for UefiStrGather
1135 # Note: /GS- will cause warning for preprocess, so filter it out from STRGATHER_PPFLAG
1137 STRGATHER_PPFLAG = $(EBC_C_FLAGS: /GS-=)
1138 STRGATHER_FLAGS = $(STRGATHER_FLAGS) -ppflag "$(STRGATHER_PPFLAG)" -oh $(DEST_DIR)\$(BASE_NAME)StrDefs.h
1141 $(DEST_DIR)\$(BASE_NAME).sdb : $(SDB_FILES) $(SOURCE_FILES)
1142 $(STRGATHER) -scan -vdbr $(STRGATHER_FLAGS) -od $(DEST_DIR)\$(BASE_NAME).sdb \
1143 -skipext .uni -skipext .h $(SOURCE_FILES)
1145 $(DEST_DIR)\$(BASE_NAME)Strings.c : $(DEST_DIR)\$(BASE_NAME).sdb
1146 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \
1147 -oc $(DEST_DIR)\$(BASE_NAME)Strings.c
1149 $(DEST_DIR)\$(BASE_NAME)StrDefs.h : $(DEST_DIR)\$(BASE_NAME).sdb
1150 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \
1151 -oh $(DEST_DIR)\$(BASE_NAME)StrDefs.h
1153 $(DEST_DIR)\$(BASE_NAME)Strings.hpk : $(DEST_DIR)\$(BASE_NAME).sdb
1154 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \
1155 -hpk $(DEST_DIR)\$(BASE_NAME)Strings.hpk
1157 OBJECTS = $(OBJECTS) $(DEST_DIR)\$(BASE_NAME)Strings.obj
1159 $(DEST_DIR)\$(BASE_NAME)Strings.obj : $(DEST_DIR)\$(BASE_NAME)Strings.c $(INF_FILENAME) $(ALL_DEPS)
1160 $(EBC_CC) $(EBC_C_FLAGS) $(DEST_DIR)\$(BASE_NAME)Strings.c
1162 LOCALIZE_TARGETS = $(DEST_DIR)\$(BASE_NAME)StrDefs.h $(LOCALIZE_TARGETS)
1167 # If building an application, then the target is a .app, not .dxe
1169 !IF "$(COMPONENT_TYPE)" == "APPLICATION"
1170 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).app
1171 SUBSYSTEM = EFI_APPLICATION
1173 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).dxe
1174 SUBSYSTEM = EFI_BOOT_SERVICE_DRIVER
1178 # Defines for standard intermediate files and build targets
1180 TARGET_EFI = $(BIN_DIR)\$(BASE_NAME).efi
1181 TARGET_DPX = $(DEST_DIR)\$(BASE_NAME).dpx
1182 TARGET_UI = $(DEST_DIR)\$(BASE_NAME).ui
1183 TARGET_VER = $(DEST_DIR)\$(BASE_NAME).ver
1184 TARGET_MAP = $(BIN_DIR)\$(BASE_NAME).map
1185 TARGET_PDB = $(BIN_DIR)\$(BASE_NAME).pdb
1186 TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pe32
1187 TARGET_DLL = $(BIN_DIR)\$(BASE_NAME).dll
1190 # First link all the objects and libs together to make a .dll file
1192 $(TARGET_DLL) : $(OBJECTS) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)
1193 $(EBC_LINK) $(EBC_LINK_FLAGS) /SUBSYSTEM:$(SUBSYSTEM) /ENTRY:EfiStart \
1194 $(OBJECTS) $(LIBS) /OUT:$(TARGET_DLL) /MAP:$(TARGET_MAP)
1195 $(SETSTAMP) $(TARGET_DLL) $(BUILD_DIR)\GenStamp.txt
1196 !IF "$(EFI_ZERO_DEBUG_DATA)" == "YES"
1197 $(ZERODEBUGDATA) $(TARGET_DLL)
1201 # Now take the .dll file and make a .efi file
1203 $(TARGET_EFI) : $(TARGET_DLL) $(INF_FILENAME)
1204 $(FWIMAGE) -t 0 $(COMPONENT_TYPE) $(TARGET_DLL) $(TARGET_EFI)
1207 # Now take the .efi file and make a .pe32 section
1209 $(TARGET_PE32) : $(TARGET_EFI)
1210 $(GENSECTION) -I $(TARGET_EFI) -O $(TARGET_PE32) -S EFI_SECTION_PE32
1213 # Create the user interface section
1215 $(TARGET_UI) : $(INF_FILENAME)
1216 $(GENSECTION) -O $(TARGET_UI) -S EFI_SECTION_USER_INTERFACE -A "$(BASE_NAME)"
1219 # Create the version section
1221 !IF "$(BUILD_NUMBER)" != ""
1222 !IF "$(VERSION_STRING)" != ""
1223 $(TARGET_VER) : $(INF_FILENAME)
1224 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER) -A "$(VERSION_STRING)"
1226 $(TARGET_VER) : $(INF_FILENAME)
1227 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER)
1230 $(TARGET_VER) : $(INF_FILENAME)
1231 echo. > $(TARGET_VER)
1232 type $(TARGET_VER) > $(TARGET_VER)
1236 # Makefile entries to create the dependency expression section.
1237 # Use the DPX file from the source directory unless an override file
1239 # If no DPX source file was specified, then create an empty file to
1242 !IF "$(DPX_SOURCE)" != ""
1243 DPX_SOURCE_FILE = $(SOURCE_DIR)\$(DPX_SOURCE)
1246 !IF "$(DPX_SOURCE_OVERRIDE)" != ""
1247 DPX_SOURCE_FILE = $(DPX_SOURCE_OVERRIDE)
1250 !IF "$(DPX_SOURCE_FILE)" != ""
1251 !IF EXIST ($(DPX_SOURCE_FILE))
1254 # Add build dependency check
1256 DEP_FILE = $(DEST_DIR)\$(BASE_NAME)dxs.dep
1258 !IF EXIST($(DEP_FILE))
1259 !INCLUDE $(DEP_FILE)
1262 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
1264 !IF EXIST($(TARGET_DPX))
1265 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs.dep
1266 !IF !EXIST($(DEP_FILE))
1272 # Update dep file for next round incremental build
1274 $(DEP_FILE) : $(TARGET_DPX)
1275 $(MAKEDEPS) -f $(DPX_SOURCE_FILE) $(DEP_FLAGS)
1279 $(TARGET_DPX) : $(DPX_SOURCE_FILE) $(INF_FILENAME)
1280 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
1281 $(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) > $*.tmp1
1283 -$(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) /showIncludes > $*.tmp1 2> $(DEST_DIR)\$(BASE_NAME)dxs.cl
1284 @$(MAKEDEPS) -f $(DEST_DIR)\$(BASE_NAME)dxs.cl $(DEP_FLAGS2)
1286 $(GENDEPEX) -I $*.tmp1 -O $*.tmp2
1287 $(GENSECTION) -I $*.tmp2 -O $@ -S $(DEPEX_TYPE)
1291 !ERROR Dependency expression source file "$(DPX_SOURCE_FILE)" does not exist.
1294 $(TARGET_DPX) : $(INF_FILENAME)
1295 echo. > $(TARGET_DPX)
1296 type $(TARGET_DPX) > $(TARGET_DPX)
1300 # Describe how to build the HII export file from all the input HII pack files.
1301 # Use the FFS file GUID for the package GUID in the export file. Only used
1302 # when multiple VFR share strings.
1304 $(DEST_DIR)\$(BASE_NAME).hii : $(HII_PACK_FILES)
1305 $(HIIPACK) create -g $(FILE_GUID) -p $(HII_PACK_FILES) -o $(DEST_DIR)\$(BASE_NAME).hii
1308 # If the build calls for creating an FFS file with the IFR included as
1309 # a separate binary (not compiled into the driver), then build the binary
1310 # section now. Note that the PACKAGE must be set correctly to actually get
1311 # this IFR section pulled into the FFS file.
1313 !IF ("$(HII_IFR_PACK_FILES)" != "")
1315 $(DEST_DIR)\$(BASE_NAME)IfrBin.sec : $(HII_IFR_PACK_FILES)
1316 $(HIIPACK) create -novarpacks -p $(HII_IFR_PACK_FILES) -o $(DEST_DIR)\$(BASE_NAME)IfrBin.hii
1317 $(GENSECTION) -I $(DEST_DIR)\$(BASE_NAME)IfrBin.hii -O $(DEST_DIR)\$(BASE_NAME)IfrBin.sec -S EFI_SECTION_RAW
1319 BIN_TARGETS = $(BIN_TARGETS) $(DEST_DIR)\$(BASE_NAME)IfrBin.sec
1324 # Build an FFS file from the sections and package
1326 $(TARGET_FFS_FILE) : $(TARGET_PE32) $(TARGET_DPX) $(TARGET_UI) $(TARGET_VER) $(PACKAGE_FILENAME)
1327 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
1329 !IF "$(CREATEDEPS)"=="YES"
1330 all : $(DEP_TARGETS)
1331 $(MAKE) -f $(MAKEFILE_NAME) all
1333 all : $(LOCALIZE_TARGETS) $(BIN_TARGETS) $(TARGET_FFS_FILE) $(DEP_TARGETS)
1337 # Remove the generated temp and final files for this modules.
1340 !IF ("$(FILE_GUID)" != "")
1341 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
1343 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
1344 @del /q $(DEST_OUTPUT_DIRS)
1346 [=============================================================================]
1348 # These are the commands to build vendor-provided *.EFI files into an FV.
1349 # To use them, create an INF file with BUILD_TYPE=BS_DRIVER_EFI.
1350 # This section, as it now exists, only supports boot service drivers.
1352 [=============================================================================]
1353 [Build.Ia32.BS_DRIVER_EFI|RT_DRIVER_EFI|APPLICATION_EFI|PE32_PEIM_EFI,Build.Ipf.BS_DRIVER_EFI|RT_DRIVER_EFI|APPLICATION_EFI|PE32_PEIM_EFI,Build.Ebc.BS_DRIVER_EFI|RT_DRIVER_EFI|APPLICATION_EFI,Build.x64.BS_DRIVER_EFI|RT_DRIVER_EFI|APPLICATION_EFI|PE32_PEIM_EFI]
1355 # Defines for standard intermediate files and build targets. For the source
1356 # .efi file, take the one in the source directory if it exists. If there's not
1357 # one there, look for one in the processor-specfic subdirectory.
1359 !IF EXIST ("$(SOURCE_DIR)\$(BASE_NAME).efi")
1360 TARGET_EFI = $(SOURCE_DIR)\$(BASE_NAME).efi
1361 !ELSEIF EXIST ("$(SOURCE_DIR)\$(PROCESSOR)\$(BASE_NAME).efi")
1362 TARGET_EFI = $(SOURCE_DIR)\$(PROCESSOR)\$(BASE_NAME).efi
1364 !ERROR Pre-existing $(BASE_NAME).efi file not found in $(SOURCE_DIR) nor $(SOURCE_DIR)\$(PROCESSOR)
1367 TARGET_DPX = $(DEST_DIR)\$(BASE_NAME).dpx
1368 TARGET_UI = $(DEST_DIR)\$(BASE_NAME).ui
1369 TARGET_VER = $(DEST_DIR)\$(BASE_NAME).ver
1370 TARGET_MAP = $(BIN_DIR)\$(BASE_NAME).map
1371 TARGET_PDB = $(BIN_DIR)\$(BASE_NAME).pdb
1372 TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pe32
1373 TARGET_DLL = $(BIN_DIR)\$(BASE_NAME).dll
1376 # If building an application, then the target is a .app, not .dxe
1378 !IF "$(COMPONENT_TYPE)" == "APPLICATION"
1379 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).app
1380 !ELSE IF "$(COMPONENT_TYPE)" == "PE32_PEIM"
1381 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei
1383 TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).dxe
1387 # Take the .efi file and make a .pe32 file
1389 $(TARGET_PE32) : $(TARGET_EFI)
1390 $(GENSECTION) -I $(TARGET_EFI) -O $(TARGET_PE32) -S EFI_SECTION_PE32
1393 # Create the user interface section
1395 $(TARGET_UI) : $(INF_FILENAME)
1396 $(GENSECTION) -O $(TARGET_UI) -S EFI_SECTION_USER_INTERFACE -A "$(BASE_NAME)"
1399 # Create the version section
1401 !IF "$(BUILD_NUMBER)" != ""
1402 !IF "$(VERSION_STRING)" != ""
1403 $(TARGET_VER) : $(INF_FILENAME)
1404 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER) -A "$(VERSION_STRING)"
1406 $(TARGET_VER) : $(INF_FILENAME)
1407 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER)
1410 $(TARGET_VER) : $(INF_FILENAME)
1411 echo. > $(TARGET_VER)
1412 type $(TARGET_VER) > $(TARGET_VER)
1416 # Makefile entries to create the dependency expression section.
1417 # Use the DPX file from the source directory unless an override file
1419 # If no DPX source file was specified, then create an empty file to
1422 !IF "$(DPX_SOURCE)" != ""
1423 DPX_SOURCE_FILE = $(SOURCE_DIR)\$(DPX_SOURCE)
1426 !IF "$(DPX_SOURCE_OVERRIDE)" != ""
1427 DPX_SOURCE_FILE = $(DPX_SOURCE_OVERRIDE)
1430 !IF "$(DPX_SOURCE_FILE)" != ""
1431 !IF EXIST ($(DPX_SOURCE_FILE))
1434 # Add build dependency check
1436 DEP_FILE = $(DEST_DIR)\$(BASE_NAME)dxs.dep
1438 !IF EXIST($(DEP_FILE))
1439 !INCLUDE $(DEP_FILE)
1442 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
1444 !IF EXIST($(TARGET_DPX))
1445 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs.dep
1446 !IF !EXIST($(DEP_FILE))
1452 # Update dep file for next round incremental build
1454 $(DEP_FILE) : $(TARGET_DPX)
1455 $(MAKEDEPS) -f $(DPX_SOURCE_FILE) $(DEP_FLAGS)
1459 $(TARGET_DPX) : $(DPX_SOURCE_FILE) $(INF_FILENAME)
1460 !IF "$(EFI_USE_CL_FOR_DEP)" != "YES"
1461 $(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) > $*.tmp1
1463 -$(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) /showIncludes > $*.tmp1 2> $(DEST_DIR)\$(BASE_NAME)dxs.cl
1464 @$(MAKEDEPS) -f $(DEST_DIR)\$(BASE_NAME)dxs.cl $(DEP_FLAGS2)
1466 $(GENDEPEX) -I $*.tmp1 -O $*.tmp2
1467 $(GENSECTION) -I $*.tmp2 -O $@ -S $(DEPEX_TYPE)
1471 !ERROR Dependency expression source file "$(DPX_SOURCE_FILE)" does not exist.
1474 $(TARGET_DPX) : $(INF_FILENAME)
1475 echo. > $(TARGET_DPX)
1476 type $(TARGET_DPX) > $(TARGET_DPX)
1480 # Build a FFS file from the sections and package
1482 $(TARGET_FFS_FILE) : $(TARGET_PE32) $(TARGET_DPX) $(TARGET_UI) $(TARGET_VER) $(PACKAGE_FILENAME)
1483 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
1485 all : $(TARGET_FFS_FILE)
1488 # Remove the generated temp and final files for this modules.
1491 !IF ("$(FILE_GUID)" != "")
1492 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
1494 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
1495 @del /q $(DEST_OUTPUT_DIRS)
1497 [=============================================================================]
1498 [Compile.Ia32.Bin|Bmp,Compile.x64.Bin|Bmp,Compile.Ipf.Bin|Bmp]
1500 # We simply define the binary source file name
1502 BINARY_SOURCE_FILE = $(SOURCE_FILE_NAME)
1504 [=============================================================================]
1505 [Build.Ia32.BINARY|Legacy16|Logo,Build.Ipf.BINARY|Legacy16|Logo,Build.x64.BINARY|Legacy16|Logo]
1507 # Use GenFfsFile to convert it to an FFS file
1509 $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).ffs : $(BINARY_SOURCE_FILE) $(PACKAGE_FILENAME) $(INF_FILENAME)
1510 $(GENSECTION) -I $(BINARY_SOURCE_FILE) -O $(DEST_DIR)\$(BASE_NAME).sec -S EFI_SECTION_RAW
1511 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
1513 all : $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).ffs
1516 # Remove the generated temp and final files for this modules.
1519 !IF ("$(FILE_GUID)" != "")
1520 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
1522 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
1523 @del /q $(DEST_OUTPUT_DIRS)
1525 [=============================================================================]
1526 [Build.Ia32.RAWFILE|CONFIG,Build.Ipf.RAWFILE|CONFIG,Build.x64.RAWFILE|CONFIG]
1528 # Use GenFfsFile to convert it to an raw FFS file
1530 $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).raw : $(BINARY_SOURCE_FILE) $(PACKAGE_FILENAME) $(INF_FILENAME)
1531 copy $(BINARY_SOURCE_FILE) $(DEST_DIR)\$(BASE_NAME).bin /Y
1532 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V
1534 all : $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).raw
1537 # Remove the generated temp and final files for this modules.
1540 !IF ("$(FILE_GUID)" != "")
1541 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*
1543 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*
1544 @del /q $(DEST_OUTPUT_DIRS)
1546 [=============================================================================]
1548 # These are commands to compile unicode .uni files.
1550 [=============================================================================]
1551 [Compile.Ia32.Uni,Compile.Ipf.Uni,Compile.Ebc.Uni,Compile.x64.Uni]
1553 # Emit an error message if the file's base name is the same as the
1554 # component base name. This causes build issues.
1556 !IF "$(FILE)" == "$(BASE_NAME)"
1557 !ERROR Component Unicode string file name cannot be the same as the component BASE_NAME.
1561 # Always create dep file for uni file as it can be created at the same time when
1562 # strgather is parsing uni file.
1564 DEP_FILE = $(DEST_DIR)\$(FILE)Uni.dep
1566 !IF EXIST($(DEP_FILE))
1567 !INCLUDE $(DEP_FILE)
1570 $(DEST_DIR)\$(FILE).sdb : $(SOURCE_FILE_NAME) $(INF_FILENAME)
1571 $(STRGATHER) -parse -newdb -db $(DEST_DIR)\$(FILE).sdb -dep $(DEP_FILE) $(INC) $(SOURCE_FILE_NAME)
1573 SDB_FILES = $(SDB_FILES) $(DEST_DIR)\$(FILE).sdb
1574 STRGATHER_FLAGS = $(STRGATHER_FLAGS) -db $(DEST_DIR)\$(FILE).sdb
1577 [=============================================================================]
1578 [Compile.Ia32.hfr,Compile.Ipf.hfr,Compile.Ebc.hfr,Compile.x64.hfr]
1579 [=============================================================================]
1580 [Compile.Ia32.Vfr,Compile.Ipf.Vfr,Compile.x64.Vfr]
1583 # Add build dependency check
1585 DEP_FILE = $(DEST_DIR)\$(FILE)Vfr.dep
1587 !IF EXIST($(DEP_FILE))
1588 !INCLUDE $(DEP_FILE)
1591 !IF EXIST($(DEST_DIR)\$(FILE).obj)
1592 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Vfr.dep
1593 !IF !EXIST($(DEP_FILE))
1599 # Update dep file for next round incremental build
1601 $(DEP_FILE) : $(DEST_DIR)\$(FILE).obj
1602 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)
1604 HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(FILE).hpk
1607 # Add a dummy command for building the HII pack file. In reality, it's built
1608 # below, but the C_FLAGS macro reference the target as $@, so you can't specify
1609 # the obj and hpk files as dual targets of the same command.
1611 $(DEST_DIR)\$(FILE).hpk : $(DEST_DIR)\$(FILE).obj
1613 $(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)
1614 $(VFRCOMPILE) $(VFRCOMPILE_FLAGS) $(INC) -ibin -od $(DEST_DIR)\$(SOURCE_RELATIVE_PATH) \
1615 -l $(VFR_FLAGS) $(SOURCE_FILE_NAME)
1616 $(CC) $(C_FLAGS) $(DEST_DIR)\$(FILE).c
1618 [=============================================================================]
1621 DEP_FILE = $(DEST_DIR)\$(FILE)Vfr.dep
1623 !IF EXIST($(DEST_DIR)\$(FILE).obj)
1624 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Vfr.dep
1625 !IF !EXIST($(DEP_FILE))
1630 !IF EXIST($(DEP_FILE))
1631 !INCLUDE $(DEP_FILE)
1635 # Update dep file for next round incremental build
1637 $(DEP_FILE) : $(DEST_DIR)\$(FILE).obj
1638 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)
1640 HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(FILE).hpk
1643 # Add a dummy command for building the HII pack file. In reality, it's built
1644 # below, but the C_FLAGS macro reference the target as $@, so you can't specify
1645 # the obj and hpk files as dual targets of the same command.
1647 $(DEST_DIR)\$(FILE).hpk : $(DEST_DIR)\$(FILE).obj
1649 $(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)
1650 $(VFRCOMPILE) $(VFRCOMPILE_FLAGS) $(INC) -ibin -od $(DEST_DIR)\$(SOURCE_RELATIVE_PATH) \
1651 -l $(VFR_FLAGS) $(SOURCE_FILE_NAME)
1652 $(EBC_CC) $(EBC_C_FLAGS) $(DEST_DIR)\$(FILE).c
1654 [=============================================================================]
1656 # Commands for building IFR as uncompressed binary into the FFS file. To
1657 # use it, set COMPILE_SELECT=.vfr=Ifr_Bin for the component in the DSC file.
1659 [=============================================================================]
1660 [Compile.Ia32.Ifr_Bin,Compile.Ipf.Ifr_Bin,Compile.x64.Ifr_Bin]
1663 # Add build dependency check
1665 DEP_FILE = $(DEST_DIR)\$(FILE)Vfr.dep
1667 !IF EXIST($(DEP_FILE))
1668 !INCLUDE $(DEP_FILE)
1671 !IF EXIST($(DEST_DIR)\$(FILE).obj)
1672 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Vfr.dep
1673 !IF !EXIST($(DEP_FILE))
1679 # Update dep file for next round incremental build
1681 $(DEP_FILE) : $(DEST_DIR)\$(FILE).obj
1682 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)
1684 HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(FILE).hpk
1687 # Add a dummy command for building the HII pack file. In reality, it's built
1688 # below, but the C_FLAGS macro reference the target as $@, so you can't specify
1689 # the obj and hpk files as dual targets of the same command.
1691 $(DEST_DIR)\$(FILE).hpk : $(DEST_DIR)\$(FILE).obj
1693 $(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)
1694 $(VFRCOMPILE) $(VFRCOMPILE_FLAGS) $(INC) -ibin -od $(DEST_DIR)\$(SOURCE_RELATIVE_PATH) \
1695 -l $(VFR_FLAGS) $(SOURCE_FILE_NAME)
1696 $(CC) $(C_FLAGS) $(DEST_DIR)\$(FILE).c
1699 # Add to the variable that contains the list of VFR binary files we're going
1700 # to merge together at the end of the build.
1702 HII_IFR_PACK_FILES = $(HII_IFR_PACK_FILES) $(DEST_DIR)\$(FILE).hpk
1704 [=============================================================================]
1706 # Commands for building IFR as uncompressed binary into the FFS file. To
1707 # use it, set COMPILE_SELECT=.vfr=Ifr_Bin for the component in the DSC file.
1709 [=============================================================================]
1710 [Compile.Ebc.Ifr_Bin]
1713 # Add build dependency check
1715 DEP_FILE = $(DEST_DIR)\$(FILE)Vfr.dep
1717 !IF EXIST($(DEP_FILE))
1718 !INCLUDE $(DEP_FILE)
1721 !IF EXIST($(DEST_DIR)\$(FILE).obj)
1722 DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Vfr.dep
1723 !IF !EXIST($(DEP_FILE))
1729 # Update dep file for next round incremental build
1731 $(DEP_FILE) : $(DEST_DIR)\$(FILE).obj
1732 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)
1734 HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(FILE).hpk
1737 # Add a dummy command for building the HII pack file. In reality, it's built
1738 # below, but the C_FLAGS macro reference the target as $@, so you can't specify
1739 # the obj and hpk files as dual targets of the same command.
1741 $(DEST_DIR)\$(FILE).hpk : $(DEST_DIR)\$(FILE).obj
1743 $(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)
1744 $(VFRCOMPILE) $(VFRCOMPILE_FLAGS) $(INC) -ibin -od $(DEST_DIR)\$(SOURCE_RELATIVE_PATH) \
1745 -l $(VFR_FLAGS) $(SOURCE_FILE_NAME)
1746 $(EBC_CC) $(EBC_C_FLAGS) $(DEST_DIR)\$(FILE).c
1749 # Add to the variable that contains the list of VFR binary files we're going
1750 # to merge together at the end of the build.
1752 HII_IFR_PACK_FILES = $(HII_IFR_PACK_FILES) $(DEST_DIR)\$(FILE).hpk
1754 [=============================================================================]
1755 [Compile.Ia32.Fv,Compile.Ipf.Fv,Compile.x64.Fv]
1757 # Run GenSection on the firmware volume image.
1759 $(DEST_DIR)\$(SOURCE_FV)Fv.sec : $(SOURCE_FILE_NAME) $(INF_FILENAME)
1760 $(GENSECTION) -I $(SOURCE_FILE_NAME) -O $(DEST_DIR)\$(SOURCE_FV)Fv.sec -S EFI_SECTION_FIRMWARE_VOLUME_IMAGE
1762 [=============================================================================]