]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Sample/Platform/Common.dsc
EdkCompatibilityPkg: Removing ipf from edk2.
[mirror_edk2.git] / EdkCompatibilityPkg / Sample / Platform / Common.dsc
CommitLineData
3eb9473e 1#/*++\r
2#\r
3e99020d 3# Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
4b1e1121 4# This program and the accompanying materials \r
3eb9473e 5# are licensed and made available under the terms and conditions of the BSD License \r
6# which accompanies this distribution. The full text of the license may be found at \r
7# http://opensource.org/licenses/bsd-license.php \r
8# \r
9# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11# \r
12# Module Name:\r
13#\r
14# Common.dsc\r
15#\r
16# Abstract:\r
17#\r
18# This is the build description file containing the platform\r
19# independent build instructions. Platform specific instructions will\r
20# be prepended to produce the final build DSC file.\r
21#\r
22#\r
23# Notes:\r
24# \r
25# The info in this file is broken down into sections. The start of a section\r
26# is designated by a "[" in the first column. So the [=====] separater ends\r
27# a section.\r
28# \r
29#--*/\r
30\r
31[=============================================================================]\r
32#\r
33# These get emitted at the top of the generated master makefile. \r
34#\r
35[=============================================================================]\r
36[Makefile.out]\r
37#\r
38# From the [makefile.out] section of the DSC file\r
39#\r
40TOOLCHAIN = \r
41MAKE = nmake -nologo\r
42\r
43!INCLUDE $(BUILD_DIR)\PlatformTools.env\r
44\r
45all : libraries fvs\r
46\r
47[=============================================================================]\r
48#\r
49# These get expanded and dumped out to each component makefile after the\r
50# component INF [defines] section gets parsed.\r
51#\r
52[=============================================================================]\r
53[Makefile.Common]\r
54#\r
55# From the [Makefile.Common] section of the description file.\r
56#\r
57PROCESSOR = $(PROCESSOR)\r
58BASE_NAME = $(BASE_NAME)\r
59BUILD_NUMBER = $(BUILD_NUMBER)\r
60VERSION_STRING = $(VERSION_STRING)\r
61TOOLCHAIN = TOOLCHAIN_$(PROCESSOR)\r
62FILE_GUID = $(FILE_GUID)\r
63COMPONENT_TYPE = $(COMPONENT_TYPE)\r
64FV_DIR = $(BUILD_DIR)\FV\r
65PLATFORM = $(PROJECT_NAME) \r
66\r
67#\r
68# Define the global dependency files\r
69#\r
70!IF EXIST ($(DEST_DIR)\$(BASE_NAME)StrDefs.h)\r
71INC_DEPS = $(INC_DEPS) $(DEST_DIR)\$(BASE_NAME)StrDefs.h\r
72!ENDIF\r
73#ENV_DEPS = $(ENV_DEPS) $(EDK_SOURCE)\Sample\CommonTools.env\r
74#ENV_DEPS = $(ENV_DEPS) $(BUILD_DIR)\PlatformTools.env\r
75#ENV_DEPS = $(ENV_DEPS) $(BUILD_DIR)\Config.env\r
76ALL_DEPS = $(INC_DEPS) $(ENV_DEPS)\r
77\r
78!IF "$(LANGUAGE)" != ""\r
79LANGUAGE_FLAGS = -lang $(LANGUAGE)\r
80!ENDIF\r
81\r
82!INCLUDE $(BUILD_DIR)\PlatformTools.env\r
83\r
84!IF "$(COMPONENT_TYPE)" == "PIC_PEIM" || "$(COMPONENT_TYPE)" == "PE32_PEIM" || "$(COMPONENT_TYPE)" == "RELOCATABLE_PEIM" || "$(COMPONENT_TYPE)" == "COMBINED_PEIM_DRIVER"\r
85DEPEX_TYPE = EFI_SECTION_PEI_DEPEX\r
86!ELSE\r
87DEPEX_TYPE = EFI_SECTION_DXE_DEPEX\r
88!ENDIF\r
89\r
95d675b5 90!IF "$(COMPONENT_TYPE)" != "LIBRARY" && EXIST($(BUILD_DIR)\$(PROCESSOR)\CompilerStub.lib)\r
91LIBS = $(LIBS) $(BUILD_DIR)\$(PROCESSOR)\CompilerStub.lib\r
92!ENDIF\r
93\r
3eb9473e 94#\r
95# Command flags for MAKEDEPS tool\r
96#\r
97DEP_FLAGS = -target $** -o $(DEP_FILE) $(INC) -ignorenotfound -q\r
95d675b5 98DEP_FLAGS2 = -target $@ -o $(DEP_FILE) -cl\r
3eb9473e 99\r
100[=============================================================================]\r
101#\r
102# These are the commands to compile source files. One of these blocks gets \r
103# emitted to the component's makefile for each source file. The section\r
104# name is encoded as [Compile.$(PROCESSOR).source_filename_extension], where\r
105# the source filename comes from the sources section of the component INF file.\r
106#\r
107# If the dependency list file already exists, then include it for this \r
108# source file. If it doesn't exist, then this is a clean build and the\r
109# dependency file will get created below and the source file will get \r
110# compiled. \r
111#\r
112# Current behavior is that the first clean build will not create dep files. \r
113# But the following second build has to create dep files before build source files.\r
114# CREATEDEPS flag is used to judge whether current build is the second build or not.\r
115#\r
116#\r
117[=============================================================================]\r
118[Compile.Ia32.asm,Compile.x64.asm]\r
119\r
95d675b5 120#\r
121# Add build dependency check\r
122#\r
3eb9473e 123DEP_FILE = $(DEST_DIR)\$(FILE)Asm.dep\r
124\r
95d675b5 125!IF EXIST($(DEP_FILE))\r
126!INCLUDE $(DEP_FILE)\r
127!ENDIF\r
128\r
3eb9473e 129!IF EXIST($(DEST_DIR)\$(FILE).obj)\r
130DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Asm.dep\r
131!IF !EXIST($(DEP_FILE))\r
132CREATEDEPS = YES\r
133!ENDIF\r
134!ENDIF\r
135\r
3eb9473e 136#\r
137# Update dep file for next round incremental build\r
138#\r
139$(DEP_FILE) : $(DEST_DIR)\$(FILE).obj\r
140 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS) -asm\r
141\r
142#\r
143# Compile the file\r
144#\r
145$(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)\r
146 $(ASM) $(ASM_FLAGS) $(SOURCE_FILE_NAME)\r
147\r
148[=============================================================================]\r
bc7c34af 149[Compile.Ia32.c,Compile.x64.c]\r
3eb9473e 150\r
95d675b5 151#\r
152# Add build dependency check\r
153#\r
3eb9473e 154DEP_FILE = $(DEST_DIR)\$(FILE).dep\r
155\r
95d675b5 156!IF EXIST($(DEP_FILE))\r
157!INCLUDE $(DEP_FILE)\r
158!ENDIF\r
159\r
160!IF "$(EFI_USE_CL_FOR_DEP)" != "YES"\r
161\r
3eb9473e 162!IF EXIST($(DEST_DIR)\$(FILE).obj)\r
163DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE).dep\r
164!IF !EXIST($(DEP_FILE))\r
165CREATEDEPS = YES\r
166!ENDIF\r
167!ENDIF\r
168\r
3eb9473e 169#\r
170# Update dep file for next round incremental build\r
171#\r
172$(DEP_FILE) : $(DEST_DIR)\$(FILE).obj\r
173 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)\r
174\r
95d675b5 175!ENDIF\r
176 \r
3eb9473e 177#\r
178# Compile the file\r
179#\r
180$(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)\r
95d675b5 181!IF "$(EFI_USE_CL_FOR_DEP)" != "YES"\r
3eb9473e 182 $(CC) $(C_FLAGS) $(SOURCE_FILE_NAME)\r
95d675b5 183!ELSE\r
184 -$(CC) $(C_FLAGS) $(SOURCE_FILE_NAME) /showIncludes > $(DEST_DIR)\$(FILE).cl\r
185 @$(MAKEDEPS) -f $(DEST_DIR)\$(FILE).cl $(DEP_FLAGS2)\r
186!ENDIF\r
3eb9473e 187\r
188[=============================================================================]\r
189[Compile.Ebc.c]\r
190\r
95d675b5 191#\r
192# Add build dependency check\r
193#\r
3eb9473e 194DEP_FILE = $(DEST_DIR)\$(FILE).dep\r
195\r
95d675b5 196!IF EXIST($(DEP_FILE))\r
197!INCLUDE $(DEP_FILE)\r
198!ENDIF\r
199\r
3eb9473e 200!IF EXIST($(DEST_DIR)\$(FILE).obj)\r
201DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE).dep\r
202!IF !EXIST($(DEP_FILE))\r
203CREATEDEPS = YES\r
204!ENDIF\r
205!ENDIF\r
206\r
3eb9473e 207#\r
208# Update dep file for next round incremental build\r
209#\r
210$(DEP_FILE) : $(DEST_DIR)\$(FILE).obj\r
211 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)\r
212\r
213#\r
214# Compile the file\r
215#\r
216$(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)\r
217 $(EBC_CC) $(EBC_C_FLAGS) $(SOURCE_FILE_NAME)\r
218\r
219[=============================================================================]\r
220#\r
221# Commands for compiling a ".apr" Apriori source file.\r
222#\r
223[=============================================================================]\r
bc7c34af 224[Compile.Ia32.Apr,Compile.Ebc.Apr,Compile.x64.Apr]\r
3eb9473e 225#\r
226# Create the raw binary file. If you get an error on the build saying it doesn't\r
227# know how to create the .apr file, then you're missing (or mispelled) the\r
228# "APRIORI=" on the component lines in components section in the DSC file.\r
229#\r
3e99020d 230$(DEST_DIR)\$(BASE_NAME).bin : $(SOURCE_FILE_NAME) $(INF_FILENAME)\r
3eb9473e 231 $(GENAPRIORI) -v -f $(SOURCE_FILE_NAME) -o $(DEST_DIR)\$(BASE_NAME).bin\r
232\r
233$(DEST_DIR)\$(BASE_NAME).sec : $(DEST_DIR)\$(BASE_NAME).bin\r
234 $(GENSECTION) -I $(DEST_DIR)\$(BASE_NAME).bin -O $(DEST_DIR)\$(BASE_NAME).sec -S EFI_SECTION_RAW\r
235\r
236[=============================================================================]\r
bc7c34af 237[Build.Ia32.Apriori,Build.Ebc.Apriori,Build.x64.Apriori]\r
3eb9473e 238\r
239all : $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).FFS\r
240\r
241#\r
242# Run GenFfsFile on the package file and .raw file to create the firmware file\r
243#\r
244$(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).FFS : $(DEST_DIR)\$(BASE_NAME).sec $(PACKAGE_FILENAME)\r
245 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V\r
246\r
247#\r
248# Remove the generated temp and final files for this modules.\r
249#\r
250clean :\r
251!IF ("$(FILE_GUID)" != "")\r
252 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
253!ENDIF\r
254 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
255 @del /q $(DEST_OUTPUT_DIRS) \r
256\r
257[=============================================================================]\r
bc7c34af 258[Build.Ia32.Makefile,Build.Ebc.Makefile,Build.x64.Makefile]\r
3eb9473e 259\r
260#\r
3e99020d 261# Set some required macros\r
3eb9473e 262#\r
3e99020d
LG
263MAKEFILE_MACROS = SOURCE_DIR=$(SOURCE_DIR) \\r
264 BUILD_DIR=$(BUILD_DIR) \\r
265 FILE_GUID=$(FILE_GUID) \\r
266 DEST_DIR=$(DEST_DIR) \\r
267 PROCESSOR=$(PROCESSOR) \\r
268 TOOLCHAIN=TOOLCHAIN_$(PROCESSOR) \\r
269 BASE_NAME=$(BASE_NAME) \\r
270 PACKAGE_FILENAME=$(PACKAGE_FILENAME)\r
3eb9473e 271\r
272#\r
3e99020d
LG
273# Just call the makefile from the source directory, passing in some\r
274# useful info.\r
3eb9473e 275#\r
3e99020d
LG
276all :\r
277 $(MAKE) -f $(SOURCE_DIR)\makefile.new all $(MAKEFILE_MACROS)\r
3eb9473e 278\r
279#\r
280# Remove the generated temp and final files for this modules.\r
281#\r
282clean :\r
3e99020d 283 @- $(MAKE) -f $(SOURCE_DIR)\makefile.new clean $(MAKEFILE_MACROS) > NUL 2>&1\r
3eb9473e 284!IF ("$(FILE_GUID)" != "")\r
285 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
286!ENDIF\r
287 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
288 @del /q $(DEST_OUTPUT_DIRS) \r
289\r
290[=============================================================================]\r
291#\r
292# Instructions for building a component that uses a custom makefile. Encoding \r
293# is [build.$(PROCESSOR).$(BUILD_TYPE)].\r
294#\r
295# To build these components, simply call the makefile from the source \r
296# directory.\r
297#\r
298[=============================================================================]\r
bc7c34af 299[Build.Ia32.Custom_Makefile,Build.Ebc.Custom_Makefile,Build.x64.Custom_Makefile]\r
3eb9473e 300\r
3e99020d
LG
301#\r
302# Set some required macros\r
303#\r
304MAKEFILE_MACROS = SOURCE_DIR=$(SOURCE_DIR) \\r
305 BUILD_DIR=$(BUILD_DIR) \\r
306 DEST_DIR=$(DEST_DIR) \\r
307 FILE_GUID=$(FILE_GUID) \\r
308 PROCESSOR=$(PROCESSOR) \\r
309 TOOLCHAIN=TOOLCHAIN_$(PROCESSOR) \\r
310 BASE_NAME=$(BASE_NAME) \\r
311 PLATFORM=$(PLATFORM) \\r
312 SOURCE_FV=$(SOURCE_FV) \\r
313 PACKAGE_FILENAME=$(PACKAGE_FILENAME)\r
314\r
3eb9473e 315#\r
316# Just call the makefile from the source directory, passing in some\r
317# useful info.\r
318#\r
319all : \r
3e99020d 320 $(MAKE) -f $(SOURCE_DIR)\makefile all $(MAKEFILE_MACROS)\r
3eb9473e 321\r
322#\r
323# Remove the generated temp and final files for this modules.\r
324#\r
325clean :\r
3e99020d 326 @- $(MAKE) -f $(SOURCE_DIR)\makefile clean $(MAKEFILE_MACROS) > NUL 2>&1\r
3eb9473e 327!IF ("$(FILE_GUID)" != "")\r
328 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
329!ENDIF\r
330 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
331 @del /q $(DEST_OUTPUT_DIRS) \r
332\r
333[=============================================================================]\r
334#\r
335# These commands are used to build libraries\r
336#\r
337[=============================================================================]\r
bc7c34af 338[Build.Ia32.LIBRARY,Build.x64.LIBRARY]\r
3eb9473e 339#\r
340# LIB all the object files into to our target lib file. Put\r
341# a dependency on the component's INF file in case it changes.\r
342#\r
343LIB_NAME = $(LIB_DIR)\$(BASE_NAME).lib\r
344\r
95d675b5 345#\r
346# $(DEP_TARGETS) are not needed for binary build.\r
347#\r
348!IF ("$(BINARY)" == "TRUE") || (("$(BINARY)" == "") && ("$(EFI_BINARY_LIBRARY)" == "YES"))\r
349DEP_TARGETS=\r
350CREATEDEPS=\r
351!ENDIF\r
352\r
353#\r
354# Module can be built from source code or binary files. \r
355#\r
356!IF ((("$(BINARY)" == "TRUE") || (("$(BINARY)" == "") && ("$(EFI_BINARY_LIBRARY)" == "YES"))) \\r
357 && EXIST($(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).lib))\r
358$(LIB_NAME) : $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).lib\r
359 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).lib $(LIB_NAME) /Y\r
360 if exist $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME)Obj.pdb \\r
361 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME)Obj.pdb $(DEST_DIR)\$(BASE_NAME)Obj.pdb /Y\r
362!ELSE\r
3eb9473e 363$(LIB_NAME) : $(OBJECTS) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)\r
364 $(LIB) $(LIB_FLAGS) $(OBJECTS) $(LIBS) /OUT:$@\r
95d675b5 365!IF ("$(EFI_BINARY_BUILD)" == "YES")\r
366 if not exist $(EFI_PLATFORM_BIN)\$(PROCESSOR) mkdir $(EFI_PLATFORM_BIN)\$(PROCESSOR)\r
367 if exist $(LIB_NAME) copy $(LIB_NAME) $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).lib /Y\r
368 if exist $(DEST_DIR)\$(BASE_NAME)Obj.pdb copy $(DEST_DIR)\$(BASE_NAME)Obj.pdb $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME)Obj.pdb /Y\r
369!ENDIF\r
370!ENDIF\r
3eb9473e 371\r
372!IF "$(CREATEDEPS)"=="YES"\r
373all : $(DEP_TARGETS)\r
374 $(MAKE) -f $(MAKEFILE_NAME) all\r
375!ELSE\r
376all : $(LIB_NAME) $(DEP_TARGETS)\r
377!ENDIF\r
378\r
379#\r
380# Remove the generated temp and final files for this modules.\r
381#\r
382clean :\r
383!IF ("$(FILE_GUID)" != "")\r
384 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
385!ENDIF\r
386 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
387 @del /q $(DEST_OUTPUT_DIRS) \r
388\r
389[=============================================================================]\r
390[Build.Ebc.LIBRARY]\r
391#\r
392# LIB all the object files into to our target lib file. Put\r
393# a dependency on the component's INF file in case it changes.\r
394#\r
395LIB_NAME = $(LIB_DIR)\$(BASE_NAME).lib\r
396\r
397$(LIB_NAME) : $(OBJECTS) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)\r
398 $(EBC_LIB) $(EBC_LIB_FLAGS) $(OBJECTS) $(LIBS) /OUT:$@\r
399\r
400!IF "$(CREATEDEPS)"=="YES"\r
401all : $(DEP_TARGETS)\r
402 $(MAKE) -f $(MAKEFILE_NAME) all\r
403!ELSE\r
404all : $(LIB_NAME) $(DEP_TARGETS)\r
405!ENDIF\r
406\r
407#\r
408# Remove the generated temp and final files for this modules.\r
409#\r
410clean :\r
411!IF ("$(FILE_GUID)" != "")\r
412 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
413!ENDIF\r
414 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
415 @del /q $(DEST_OUTPUT_DIRS) \r
416\r
417[=============================================================================]\r
418#\r
419# This is the Build.$(PROCESSOR).$(COMPONENT_TYPE) section that tells how to\r
420# convert a firmware volume into an FV FFS file. Simply run it through\r
421# GenFfsFile with the appropriate package file. SOURCE_FV must be defined\r
422# in the component INF file Defines section.\r
423#\r
424[=============================================================================]\r
bc7c34af 425[Build.Ia32.FvImageFile,Build.x64.FvImageFile]\r
3eb9473e 426\r
427all : $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).Fvi\r
428\r
429#\r
430# Run GenFfsFile on the package file and FV file to create the firmware \r
431# volume FFS file. This FFS file maybe contain one pad section for alignment requirement.\r
432#\r
433$(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).Fvi : $(DEST_DIR)\$(SOURCE_FV)Fv.sec $(PACKAGE_FILENAME) $(PAD_SECTION) \r
434 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V\r
435\r
436#\r
437# Remove the generated temp and final files for this modules.\r
438#\r
439clean :\r
440!IF ("$(FILE_GUID)" != "")\r
441 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
442!ENDIF\r
443 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
444 @del /q $(DEST_OUTPUT_DIRS) \r
445\r
446[=============================================================================]\r
447#\r
448# Since many of the steps are the same for the different component types, we \r
449# share this section for BS_DRIVER, RT_DRIVER, .... and IFDEF the parts that \r
450# differ. The entire section gets dumped to the output makefile.\r
451#\r
452[=============================================================================]\r
bc7c34af 453[Build.Ia32.BS_DRIVER|RT_DRIVER|SAL_RT_DRIVER|PE32_PEIM|PEI_CORE|PIC_PEIM|RELOCATABLE_PEIM|DXE_CORE|APPLICATION|COMBINED_PEIM_DRIVER, Build.x64.BS_DRIVER|RT_DRIVER|SAL_RT_DRIVER|PE32_PEIM|PEI_CORE|PIC_PEIM|RELOCATABLE_PEIM|DXE_CORE|APPLICATION|COMBINED_PEIM_DRIVER]\r
3eb9473e 454\r
455!IF "$(LOCALIZE)" == "YES"\r
456\r
3e99020d
LG
457!IF (("$(EFI_GENERATE_HII_RESOURCE)" == "YES") && ("$(EFI_SPECIFICATION_VERSION)" >= "0x0002000A"))\r
458#\r
459# This will generate HII resource section in PE/COFF image.\r
460#\r
461# Note: when HII package list is built into resource section, Driver no longer\r
462# refer to C array generated by VfrCompiler ($(FILE_NAME)Bin) and StrGather\r
463# ($(BASE_NAME)Strings); while in current build rule, those C array objects\r
464# will still be linked with the Driver, so please turn on link flag "/OPT:REF"\r
465# to minimize the code size.\r
466#\r
467HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(BASE_NAME)Strings.hpk\r
468LOCALIZE_TARGETS = $(LOCALIZE_TARGETS) $(DEST_DIR)\$(BASE_NAME).res\r
469LINK_FLAGS_DLL = $(LINK_FLAGS_DLL) $(DEST_DIR)\$(BASE_NAME).res\r
470\r
471$(DEST_DIR)\$(BASE_NAME).rc : $(HII_PACK_FILES)\r
472 $(HIIPACK) -g $(FILE_GUID) $(HII_PACK_FILES) -rc $(DEST_DIR)\$(BASE_NAME).rc -hii $(DEST_DIR)\$(BASE_NAME).hii\r
473\r
474$(DEST_DIR)\$(BASE_NAME).res : $(DEST_DIR)\$(BASE_NAME).rc\r
475 $(RC) /fo $(DEST_DIR)\$(BASE_NAME).res $(DEST_DIR)\$(BASE_NAME).rc\r
3eb9473e 476\r
3e99020d
LG
477!ENDIF\r
478\r
479!IF (("$(EFI_GENERATE_HII_EXPORT)" == "YES") && ("$(EFI_SPECIFICATION_VERSION)" < "0x0002000A"))\r
3eb9473e 480#\r
481# There will be one HII pack containing all the strings. Add that file\r
482# to the list of HII pack files we'll use to create our final HII export file.\r
483#\r
484HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(BASE_NAME)Strings.hpk\r
485LOCALIZE_TARGETS = $(LOCALIZE_TARGETS) $(DEST_DIR)\$(BASE_NAME).hii\r
486!ENDIF\r
487\r
3e99020d
LG
488!IF ("$(EFI_SPECIFICATION_VERSION)" >= "0x0002000A")\r
489#\r
490# Note: currently -ppflag option is only available for UefiStrGather\r
491# Note: /GS- will cause warning for preprocess, so filter it out from STRGATHER_PPFLAG\r
492#\r
493STRGATHER_PPFLAG = $(C_FLAGS: /GS-=)\r
494STRGATHER_FLAGS = $(STRGATHER_FLAGS) -ppflag "$(STRGATHER_PPFLAG)" -oh $(DEST_DIR)\$(BASE_NAME)StrDefs.h\r
495!ENDIF\r
496\r
3eb9473e 497$(DEST_DIR)\$(BASE_NAME).sdb : $(SDB_FILES) $(SOURCE_FILES)\r
498 $(STRGATHER) -scan -vdbr $(STRGATHER_FLAGS) -od $(DEST_DIR)\$(BASE_NAME).sdb \\r
499 -skipext .uni -skipext .h $(SOURCE_FILES)\r
500\r
501$(DEST_DIR)\$(BASE_NAME)Strings.c : $(DEST_DIR)\$(BASE_NAME).sdb\r
502 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \\r
503 -oc $(DEST_DIR)\$(BASE_NAME)Strings.c\r
504\r
505$(DEST_DIR)\$(BASE_NAME)StrDefs.h : $(DEST_DIR)\$(BASE_NAME).sdb\r
506 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \\r
507 -oh $(DEST_DIR)\$(BASE_NAME)StrDefs.h\r
508\r
509$(DEST_DIR)\$(BASE_NAME)Strings.hpk : $(DEST_DIR)\$(BASE_NAME).sdb\r
510 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \\r
511 -hpk $(DEST_DIR)\$(BASE_NAME)Strings.hpk\r
512\r
513OBJECTS = $(OBJECTS) $(DEST_DIR)\$(BASE_NAME)Strings.obj\r
514\r
515$(DEST_DIR)\$(BASE_NAME)Strings.obj : $(DEST_DIR)\$(BASE_NAME)Strings.c $(INF_FILENAME) $(ALL_DEPS)\r
516 $(CC) $(C_FLAGS) $(DEST_DIR)\$(BASE_NAME)Strings.c\r
517\r
3e99020d 518LOCALIZE_TARGETS = $(DEST_DIR)\$(BASE_NAME)StrDefs.h $(LOCALIZE_TARGETS)\r
3eb9473e 519\r
520!ENDIF\r
521\r
522#\r
523# If we have any objects associated with this component, then we're\r
524# going to build a local library from them.\r
525#\r
526!IFNDEF OBJECTS\r
527!ERROR No source files to build were defined in the INF file\r
528!ENDIF\r
529\r
530TARGET_LOCAL_LIB = $(DEST_DIR)\$(BASE_NAME)Local.lib\r
531\r
532#\r
533# LIB all the object files into our (local) target lib file. Put\r
534# a dependency on the component's INF file in case it changes.\r
535#\r
536$(TARGET_LOCAL_LIB) : $(OBJECTS) $(INF_FILENAME) $(ENV_DEPS)\r
537 $(LIB) $(LIB_FLAGS) $(OBJECTS) /OUT:$@\r
538\r
539#\r
540# Defines for standard intermediate files and build targets\r
541#\r
542TARGET_DLL = $(BIN_DIR)\$(BASE_NAME).dll\r
543TARGET_EFI = $(BIN_DIR)\$(BASE_NAME).efi\r
544TARGET_DPX = $(DEST_DIR)\$(BASE_NAME).dpx\r
545TARGET_UI = $(DEST_DIR)\$(BASE_NAME).ui\r
546TARGET_VER = $(DEST_DIR)\$(BASE_NAME).ver\r
547TARGET_MAP = $(BIN_DIR)\$(BASE_NAME).map\r
548TARGET_PDB = $(BIN_DIR)\$(BASE_NAME).pdb\r
549TARGET_SYM = $(BIN_DIR)\$(BASE_NAME).sym\r
550\r
551#\r
552# Target executable section extension depends on the component type.\r
553# Only define "TARGET_DXE_DPX" if it's a combined peim driver.\r
554#\r
555!IF "$(COMPONENT_TYPE)" == "PIC_PEIM"\r
556TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pic\r
557!ELSE\r
558TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pe32\r
559!ENDIF\r
560\r
561#\r
562# Target FFS file extension depends on the component type\r
563# Also define "TARGET_DXE_DPX" if it's a combined PEIM driver.\r
564#\r
565SUBSYSTEM = EFI_BOOT_SERVICE_DRIVER\r
566\r
567!IF "$(COMPONENT_TYPE)" == "APPLICATION"\r
568TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).app\r
569SUBSYSTEM = EFI_APPLICATION\r
570!ELSE IF "$(COMPONENT_TYPE)" == "PEI_CORE"\r
571TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei\r
572!ELSE IF "$(COMPONENT_TYPE)" == "PE32_PEIM"\r
573TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei\r
574!ELSE IF "$(COMPONENT_TYPE)" == "RELOCATABLE_PEIM"\r
575TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei\r
576!ELSE IF "$(COMPONENT_TYPE)" == "PIC_PEIM"\r
577TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei\r
578!ELSE IF "$(COMPONENT_TYPE)" == "COMBINED_PEIM_DRIVER"\r
579TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei\r
580TARGET_DXE_DPX = $(DEST_DIR)\$(BASE_NAME).dpxd\r
581!ELSE\r
582TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).dxe\r
583!ENDIF\r
584\r
585#\r
586# Different methods to build section based on if PIC_PEIM\r
587#\r
588!IF "$(COMPONENT_TYPE)" == "PIC_PEIM"\r
589\r
590$(TARGET_PE32) : $(TARGET_DLL)\r
591 $(PE2BIN) $(TARGET_DLL) $(DEST_DIR)\$(BASE_NAME).TMP\r
592#\r
593# BUGBUG: Build PEIM header, needs to go away with new PEI.\r
594#\r
595 $(TEMPGENSECTION) -P $(SOURCE_DIR)\$(BASE_NAME).INF -I $(DEST_DIR)\$(BASE_NAME).TMP -O $(TARGET_PIC_PEI).tmp -M $(TARGET_MAP) -S EFI_SECTION_TYPE_NO_HEADER\r
596 $(GENSECTION) -I $(TARGET_PIC_PEI).tmp -O $(TARGET_PE32) -S EFI_SECTION_PIC\r
597 del $(DEST_DIR)\$(BASE_NAME).TMP\r
598\r
599!ELSE\r
600\r
601$(TARGET_PE32) : $(TARGET_EFI)\r
602 $(GENSECTION) -I $(TARGET_EFI) -O $(TARGET_PE32) -S EFI_SECTION_PE32\r
603\r
604#\r
95d675b5 605# $(DEP_TARGETS) are not needed for binary build.\r
606#\r
607!IF "$(BINARY)" == "TRUE"\r
608DEP_TARGETS=\r
609CREATEDEPS=\r
610!ENDIF\r
611\r
612#\r
613# Build module to generate *.efi file from source code or binary file. \r
3eb9473e 614#\r
95d675b5 615!IF (("$(BINARY)" == "TRUE") && EXIST($(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi))\r
616LOCALIZE_TARGETS=\r
617$(TARGET_EFI) : $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi\r
618 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi $(TARGET_EFI) /Y\r
619 if exist $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb \\r
620 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb $(TARGET_PDB) /Y\r
621!ELSE\r
3eb9473e 622$(TARGET_EFI) : $(TARGET_DLL) $(INF_FILENAME)\r
623 $(FWIMAGE) -t 0 $(COMPONENT_TYPE) $(TARGET_DLL) $(TARGET_EFI)\r
95d675b5 624!IF ("$(EFI_BINARY_BUILD)" == "YES")\r
625 if not exist $(EFI_PLATFORM_BIN)\$(PROCESSOR) mkdir $(EFI_PLATFORM_BIN)\$(PROCESSOR)\r
626 if exist $(TARGET_EFI) copy $(TARGET_EFI) $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi /Y\r
627 if exist $(TARGET_PDB) copy $(TARGET_PDB) $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb /Y\r
628!ENDIF\r
629!ENDIF\r
3eb9473e 630\r
631!ENDIF\r
632\r
633#\r
634# Link all objects and libs to create the executable\r
635#\r
636$(TARGET_DLL) : $(TARGET_LOCAL_LIB) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)\r
637 $(LINK) $(LINK_FLAGS_DLL) $(LIBS) /ENTRY:$(IMAGE_ENTRY_POINT) \\r
638 $(TARGET_LOCAL_LIB) /OUT:$(TARGET_DLL) /MAP:$(TARGET_MAP) \\r
639 /PDB:$(TARGET_PDB) \r
640 $(SETSTAMP) $(TARGET_DLL) $(BUILD_DIR)\GenStamp.txt\r
641!IF "$(EFI_GENERATE_SYM_FILE)" == "YES"\r
642 if exist $(TARGET_PDB) $(PE2SYM) $(TARGET_PDB) $(TARGET_SYM)\r
643!ENDIF\r
644\r
645!IF "$(EFI_ZERO_DEBUG_DATA)" == "YES"\r
646 $(ZERODEBUGDATA) $(TARGET_DLL)\r
647!ENDIF\r
648\r
649#\r
650# Create the user interface section\r
651#\r
652$(TARGET_UI) : $(INF_FILENAME)\r
653 $(GENSECTION) -O $(TARGET_UI) -S EFI_SECTION_USER_INTERFACE -A "$(BASE_NAME)"\r
654\r
655#\r
656# Create the version section\r
657#\r
658!IF "$(BUILD_NUMBER)" != ""\r
659!IF "$(VERSION_STRING)" != ""\r
660$(TARGET_VER) : $(INF_FILENAME)\r
661 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER) -A "$(VERSION_STRING)"\r
662!ELSE\r
663$(TARGET_VER) : $(INF_FILENAME)\r
664 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER)\r
665!ENDIF\r
666!ELSE\r
3e99020d 667$(TARGET_VER) : $(INF_FILENAME)\r
3eb9473e 668 echo.>$(TARGET_VER)\r
669 type $(TARGET_VER)>$(TARGET_VER)\r
670!ENDIF\r
671\r
672#\r
673# Makefile entries to create the dependency expression section.\r
674# Use the DPX file from the source directory unless an override file\r
675# was specified.\r
676# If no DPX source file was specified, then create an empty file to\r
677# be used.\r
678#\r
679!IF "$(DPX_SOURCE)" != ""\r
680DPX_SOURCE_FILE = $(SOURCE_DIR)\$(DPX_SOURCE)\r
681!ENDIF\r
682\r
683!IF "$(DPX_SOURCE_OVERRIDE)" != ""\r
684DPX_SOURCE_FILE = $(DPX_SOURCE_OVERRIDE)\r
685!ENDIF\r
686\r
687!IF "$(DPX_SOURCE_FILE)" != ""\r
688!IF EXIST ($(DPX_SOURCE_FILE))\r
95d675b5 689\r
3eb9473e 690#\r
95d675b5 691# Add build dependency check\r
3eb9473e 692#\r
693DEP_FILE = $(DEST_DIR)\$(BASE_NAME)dxs.dep\r
694\r
95d675b5 695!IF EXIST($(DEP_FILE))\r
696!INCLUDE $(DEP_FILE)\r
697!ENDIF\r
698\r
699!IF "$(EFI_USE_CL_FOR_DEP)" != "YES"\r
700\r
3eb9473e 701!IF EXIST($(TARGET_DPX))\r
702DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs.dep\r
703!IF !EXIST($(DEP_FILE))\r
704CREATEDEPS = YES\r
705!ENDIF\r
706!ENDIF\r
707\r
3eb9473e 708#\r
709# Update dep file for next round incremental build\r
710#\r
711$(DEP_FILE) : $(TARGET_DPX)\r
712 $(MAKEDEPS) -f $(DPX_SOURCE_FILE) $(DEP_FLAGS)\r
713\r
95d675b5 714!ENDIF\r
715\r
3eb9473e 716$(TARGET_DPX) : $(DPX_SOURCE_FILE) $(INF_FILENAME)\r
95d675b5 717!IF "$(EFI_USE_CL_FOR_DEP)" != "YES"\r
718 $(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) > $*.tmp1\r
719!ELSE\r
720 -$(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) /showIncludes > $*.tmp1 2> $(DEST_DIR)\$(BASE_NAME)dxs.cl\r
721 @$(MAKEDEPS) -f $(DEST_DIR)\$(BASE_NAME)dxs.cl $(DEP_FLAGS2)\r
722!ENDIF\r
3eb9473e 723 $(GENDEPEX) -I $*.tmp1 -O $*.tmp2\r
724 $(GENSECTION) -I $*.tmp2 -O $@ -S $(DEPEX_TYPE)\r
725 del $*.tmp1 > NUL\r
726 del $*.tmp2 > NUL\r
727!ELSE\r
728!ERROR Dependency expression source file "$(DPX_SOURCE_FILE)" does not exist.\r
729!ENDIF\r
730!ELSE\r
3e99020d 731$(TARGET_DPX) : $(INF_FILENAME)\r
3eb9473e 732 echo. > $(TARGET_DPX)\r
733 type $(TARGET_DPX) > $(TARGET_DPX)\r
734!ENDIF\r
735\r
736#\r
737# Makefile entries for DXE DPX for combined PEIM drivers.\r
738# If a DXE_DPX_SOURCE file was specified in the INF file, use it. Otherwise \r
739# create an empty file and use it as a DPX file.\r
740#\r
741!IF "$(COMPONENT_TYPE)" == "COMBINED_PEIM_DRIVER"\r
742!IF "$(DXE_DPX_SOURCE)" != ""\r
743!IF EXIST ($(SOURCE_DIR)\$(DXE_DPX_SOURCE))\r
95d675b5 744\r
745#\r
746# Add build dependency check\r
747#\r
748DEP_FILE = $(DEST_DIR)\$(BASE_NAME)dxs2.dep\r
749\r
750!IF EXIST($(DEP_FILE))\r
751!INCLUDE $(DEP_FILE)\r
752!ENDIF\r
753\r
754!IF "$(EFI_USE_CL_FOR_DEP)" != "YES"\r
755\r
756!IF EXIST($(TARGET_DXE_DPX))\r
757DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs2.dep\r
758!IF !EXIST($(DEP_FILE))\r
759CREATEDEPS = YES\r
760!ENDIF\r
761!ENDIF\r
762\r
763#\r
764# Update dep file for next round incremental build\r
765#\r
766$(DEP_FILE) : $(TARGET_DXE_DPX)\r
767 $(MAKEDEPS) -f $(SOURCE_DIR)\$(DXE_DPX_SOURCE) $(DEP_FLAGS)\r
768\r
769!ENDIF\r
770\r
3eb9473e 771$(TARGET_DXE_DPX) : $(SOURCE_DIR)\$(DXE_DPX_SOURCE) $(INF_FILENAME)\r
95d675b5 772!IF "$(EFI_USE_CL_FOR_DEP)" != "YES"\r
773 $(CC) $(C_FLAGS_DPX) $(SOURCE_DIR)\$(DXE_DPX_SOURCE) > $*.tmp1\r
774!ELSE\r
775 -$(CC) $(C_FLAGS_DPX) $(SOURCE_DIR)\$(DXE_DPX_SOURCE) /showIncludes > $*.tmp1 2> $(DEST_DIR)\$(BASE_NAME)dxs2.cl\r
776 @$(MAKEDEPS) -f $(DEST_DIR)\$(BASE_NAME)dxs2.cl $(DEP_FLAGS2)\r
777!ENDIF\r
3eb9473e 778 $(GENDEPEX) -I $*.tmp1 -O $*.tmp2\r
779 $(GENSECTION) -I $*.tmp2 -O $@ -S EFI_SECTION_DXE_DEPEX\r
780 del $*.tmp1 > NUL\r
781 del $*.tmp2 > NUL\r
782!ELSE\r
783!ERROR Dependency expression source file "$(SOURCE_DIR)\$(DXE_DPX_SOURCE)" does not exist.\r
784!ENDIF\r
785!ELSE\r
3e99020d 786$(TARGET_DXE_DPX) : $(INF_FILENAME)\r
3eb9473e 787 echo. > $(TARGET_DXE_DPX)\r
788 type $(TARGET_DXE_DPX) > $(TARGET_DXE_DPX)\r
789!ENDIF\r
790!ENDIF\r
791\r
792#\r
793# Describe how to build the HII export file from all the input HII pack files.\r
794# Use the FFS file GUID for the package GUID in the export file. Only used\r
795# when multiple VFR share strings.\r
796#\r
797$(DEST_DIR)\$(BASE_NAME).hii : $(HII_PACK_FILES)\r
798 $(HIIPACK) create -g $(FILE_GUID) -p $(HII_PACK_FILES) -o $(DEST_DIR)\$(BASE_NAME).hii\r
799\r
800#\r
801# If the build calls for creating an FFS file with the IFR included as\r
802# a separate binary (not compiled into the driver), then build the binary\r
803# section now. Note that the PACKAGE must be set correctly to actually get\r
804# this IFR section pulled into the FFS file.\r
805#\r
806!IF ("$(HII_IFR_PACK_FILES)" != "")\r
807\r
808$(DEST_DIR)\$(BASE_NAME)IfrBin.sec : $(HII_IFR_PACK_FILES)\r
809 $(HIIPACK) create -novarpacks -p $(HII_IFR_PACK_FILES) -o $(DEST_DIR)\$(BASE_NAME)IfrBin.hii\r
810 $(GENSECTION) -I $(DEST_DIR)\$(BASE_NAME)IfrBin.hii -O $(DEST_DIR)\$(BASE_NAME)IfrBin.sec -S EFI_SECTION_RAW\r
811\r
812BIN_TARGETS = $(BIN_TARGETS) $(DEST_DIR)\$(BASE_NAME)IfrBin.sec\r
813\r
814!ENDIF\r
815\r
816#\r
817# Build a FFS file from the sections and package\r
818#\r
819$(TARGET_FFS_FILE) : $(TARGET_PE32) $(TARGET_DPX) $(TARGET_UI) $(TARGET_VER) $(TARGET_DXE_DPX) $(PACKAGE_FILENAME)\r
bc7c34af
CC
820\r
821$(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V\r
3eb9473e 822\r
823!IF "$(CREATEDEPS)"=="YES"\r
824all : $(DEP_TARGETS)\r
825 $(MAKE) -f $(MAKEFILE_NAME) all\r
826!ELSE\r
827all : $(LOCALIZE_TARGETS) $(BIN_TARGETS) $(TARGET_FFS_FILE) $(DEP_TARGETS)\r
828!ENDIF\r
829\r
830#\r
831# Remove the generated temp and final files for this modules.\r
832#\r
833clean :\r
834!IF ("$(FILE_GUID)" != "")\r
835 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
836!ENDIF\r
837 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
838 @del /q $(DEST_OUTPUT_DIRS) \r
839\r
840[=============================================================================]\r
bc7c34af 841[Build.Ia32.TE_PEIM,Build.x64.TE_PEIM]\r
3eb9473e 842#\r
843# Define the library file we'll build if we have any objects defined.\r
844#\r
845!IFDEF OBJECTS\r
846TARGET_LOCAL_LIB = $(DEST_DIR)\$(BASE_NAME)Local.lib\r
847#\r
848# LIB all the object files into our (local) target lib file. Put\r
849# a dependency on the component's INF file in case it changes.\r
850#\r
851$(TARGET_LOCAL_LIB) : $(OBJECTS) $(INF_FILENAME) $(ENV_DEPS)\r
852 $(LIB) $(LIB_FLAGS) $(OBJECTS) /OUT:$@\r
853\r
854!ELSE\r
855!ERROR No source files to build were defined in the INF file\r
856!ENDIF\r
857\r
858#\r
859# Defines for standard intermediate files and build targets\r
860#\r
861TARGET_DLL = $(BIN_DIR)\$(BASE_NAME).dll\r
862TARGET_EFI = $(BIN_DIR)\$(BASE_NAME).efi\r
863TARGET_DPX = $(DEST_DIR)\$(BASE_NAME).dpx\r
864TARGET_UI = $(DEST_DIR)\$(BASE_NAME).ui\r
865TARGET_VER = $(DEST_DIR)\$(BASE_NAME).ver\r
866TARGET_MAP = $(BIN_DIR)\$(BASE_NAME).map\r
867TARGET_PDB = $(BIN_DIR)\$(BASE_NAME).pdb\r
868TARGET_SYM = $(BIN_DIR)\$(BASE_NAME).sym\r
869TARGET_TE = $(BIN_DIR)\$(BASE_NAME).te\r
870TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pe32\r
871TARGET_TES = $(DEST_DIR)\$(BASE_NAME).tes\r
872TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei\r
873\r
874#\r
875# Create our TE section from our TE file\r
876#\r
877$(TARGET_TES) : $(TARGET_TE)\r
878 $(GENSECTION) -I $(TARGET_TE) -O $(TARGET_TES) -S EFI_SECTION_TE\r
879\r
880#\r
95d675b5 881# $(DEP_TARGETS) are not needed for binary build.\r
882#\r
883!IF "$(BINARY)" == "TRUE"\r
884DEP_TARGETS=\r
885CREATEDEPS=\r
886!ENDIF\r
887\r
3eb9473e 888#\r
95d675b5 889# Build module to generate *.efi file from source code or binary file.\r
890#\r
891!IF (("$(BINARY)" == "TRUE") && EXIST($(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi))\r
892$(TARGET_EFI) : $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi\r
893 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi $(TARGET_EFI) /Y\r
894 if exist $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb \\r
895 copy $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb $(TARGET_PDB) /Y\r
896!ELSE\r
3eb9473e 897$(TARGET_EFI) : $(TARGET_DLL) $(INF_FILENAME)\r
898 $(FWIMAGE) $(COMPONENT_TYPE) $(TARGET_DLL) $(TARGET_EFI)\r
95d675b5 899!IF ("$(EFI_BINARY_BUILD)" == "YES")\r
900 if not exist $(EFI_PLATFORM_BIN)\$(PROCESSOR) mkdir $(EFI_PLATFORM_BIN)\$(PROCESSOR)\r
901 if exist $(TARGET_EFI) copy $(TARGET_EFI) $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).efi /Y\r
902 if exist $(TARGET_PDB) copy $(TARGET_PDB) $(EFI_PLATFORM_BIN)\$(PROCESSOR)\$(BASE_NAME).pdb /Y\r
903!ENDIF\r
904!ENDIF\r
3eb9473e 905\r
906#\r
907# Run GenTEImage on the built .efi file to create our TE file.\r
908#\r
909$(TARGET_TE) : $(TARGET_EFI) \r
910 $(GENTEIMAGE) -o $(TARGET_TE) $(TARGET_EFI)\r
911\r
912#\r
913# Link all objects and libs to create the executable\r
914#\r
915$(TARGET_DLL) : $(TARGET_LOCAL_LIB) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)\r
916 $(LINK) $(LINK_FLAGS_DLL) $(LIBS) /ENTRY:$(IMAGE_ENTRY_POINT) \\r
917 $(TARGET_LOCAL_LIB) /OUT:$(TARGET_DLL) /MAP:$(TARGET_MAP) \\r
918 /PDB:$(TARGET_PDB)\r
919 $(SETSTAMP) $(TARGET_DLL) $(BUILD_DIR)\GenStamp.txt\r
920!IF "$(EFI_GENERATE_SYM_FILE)" == "YES"\r
921 if exist $(TARGET_PDB) $(PE2SYM) $(TARGET_PDB) $(TARGET_SYM)\r
922!ENDIF\r
923\r
924!IF "$(EFI_ZERO_DEBUG_DATA)" == "YES"\r
925 $(ZERODEBUGDATA) $(TARGET_DLL)\r
926!ENDIF\r
927\r
928#\r
929# Create the user interface section\r
930#\r
931$(TARGET_UI) : $(INF_FILENAME)\r
932 $(GENSECTION) -O $(TARGET_UI) -S EFI_SECTION_USER_INTERFACE -A "$(BASE_NAME)"\r
933\r
934#\r
935# Create the version section\r
936#\r
937!IF "$(BUILD_NUMBER)" != ""\r
938!IF "$(VERSION_STRING)" != ""\r
939$(TARGET_VER) : $(INF_FILENAME)\r
940 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER) -A "$(VERSION_STRING)"\r
941!ELSE\r
942$(TARGET_VER) : $(INF_FILENAME)\r
943 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER)\r
944!ENDIF\r
945!ELSE\r
3e99020d 946$(TARGET_VER) : $(INF_FILENAME)\r
3eb9473e 947 echo.>$(TARGET_VER)\r
948 type $(TARGET_VER)>$(TARGET_VER)\r
949!ENDIF\r
950\r
951#\r
952# Makefile entries to create the dependency expression section.\r
953# Use the DPX file from the source directory unless an override file\r
954# was specified.\r
955# If no DPX source file was specified, then create an empty file to\r
956# be used.\r
957#\r
958!IF "$(DPX_SOURCE)" != ""\r
959DPX_SOURCE_FILE = $(SOURCE_DIR)\$(DPX_SOURCE)\r
960!ENDIF\r
961\r
962!IF "$(DPX_SOURCE_OVERRIDE)" != ""\r
963DPX_SOURCE_FILE = $(DPX_SOURCE_OVERRIDE)\r
964!ENDIF\r
965\r
966!IF "$(DPX_SOURCE_FILE)" != ""\r
967!IF EXIST ($(DPX_SOURCE_FILE))\r
95d675b5 968\r
3eb9473e 969#\r
95d675b5 970# Add build dependency check\r
3eb9473e 971#\r
972DEP_FILE = $(DEST_DIR)\$(BASE_NAME)dxs.dep\r
973\r
95d675b5 974!IF EXIST($(DEP_FILE))\r
975!INCLUDE $(DEP_FILE)\r
976!ENDIF\r
977\r
978!IF "$(EFI_USE_CL_FOR_DEP)" != "YES"\r
979\r
3eb9473e 980!IF EXIST($(TARGET_DPX))\r
981DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs.dep\r
982!IF !EXIST($(DEP_FILE))\r
983CREATEDEPS = YES\r
984!ENDIF\r
985!ENDIF\r
986\r
3eb9473e 987#\r
988# Update dep file for next round incremental build\r
989#\r
990$(DEP_FILE) : $(TARGET_DPX)\r
991 $(MAKEDEPS) -f $(DPX_SOURCE_FILE) $(DEP_FLAGS)\r
992\r
95d675b5 993!ENDIF\r
994\r
3eb9473e 995$(TARGET_DPX) : $(DPX_SOURCE_FILE) $(INF_FILENAME)\r
95d675b5 996!IF "$(EFI_USE_CL_FOR_DEP)" != "YES"\r
997 $(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) > $*.tmp1\r
998!ELSE\r
999 -$(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) /showIncludes > $*.tmp1 2> $(DEST_DIR)\$(BASE_NAME)dxs.cl\r
1000 @$(MAKEDEPS) -f $(DEST_DIR)\$(BASE_NAME)dxs.cl $(DEP_FLAGS2)\r
1001!ENDIF\r
3eb9473e 1002 $(GENDEPEX) -I $*.tmp1 -O $*.tmp2\r
1003 $(GENSECTION) -I $*.tmp2 -O $@ -S $(DEPEX_TYPE)\r
1004 del $*.tmp1 > NUL\r
1005 del $*.tmp2 > NUL\r
1006!ELSE\r
1007!ERROR Dependency expression source file "$(DPX_SOURCE_FILE)" does not exist.\r
1008!ENDIF\r
1009!ELSE\r
3e99020d 1010$(TARGET_DPX) : $(INF_FILENAME)\r
3eb9473e 1011 echo. > $(TARGET_DPX)\r
1012 type $(TARGET_DPX) > $(TARGET_DPX)\r
1013!ENDIF\r
1014\r
1015#\r
1016# Build an FFS file from the sections and package\r
1017#\r
1018$(TARGET_FFS_FILE) : $(TARGET_TES) $(TARGET_DPX) $(TARGET_UI) $(TARGET_VER) $(PACKAGE_FILENAME)\r
1019 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V\r
1020\r
1021!IF "$(CREATEDEPS)"=="YES"\r
1022all : $(DEP_TARGETS)\r
1023 $(MAKE) -f $(MAKEFILE_NAME) all\r
1024!ELSE\r
1025all : $(TARGET_FFS_FILE) $(DEP_TARGETS)\r
1026!ENDIF\r
1027\r
1028#\r
1029# Remove the generated temp and final files for this modules.\r
1030#\r
1031clean :\r
1032!IF ("$(FILE_GUID)" != "")\r
1033 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
1034!ENDIF\r
1035 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
1036 @del /q $(DEST_OUTPUT_DIRS) \r
1037\r
1038[=============================================================================]\r
1039#\r
1040# These are the commands to build EBC EFI targets\r
1041#\r
1042[=============================================================================]\r
1043[Build.Ebc.BS_DRIVER|RT_DRIVER|APPLICATION]\r
1044\r
1045#\r
1046# Add the EBC library to our list of libs\r
1047#\r
1048LIBS = $(LIBS) $(EBC_TOOLS_PATH)\lib\EbcLib.lib \r
1049\r
1050!IF "$(LOCALIZE)" == "YES"\r
1051\r
3e99020d
LG
1052!IF (("$(EFI_GENERATE_HII_RESOURCE)" == "YES") && ("$(EFI_SPECIFICATION_VERSION)" >= "0x0002000A"))\r
1053#\r
1054# This will generate HII resource section in PE/COFF image.\r
1055#\r
1056# Note: when HII package list is built into resource section, Driver no longer\r
1057# refer to C array generated by VfrCompiler ($(FILE_NAME)Bin) and StrGather\r
1058# ($(BASE_NAME)Strings); while in current build rule, those C array objects\r
1059# will still be linked with the Driver, so please turn on link flag "/OPT:REF"\r
1060# to minimize the code size.\r
1061#\r
1062HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(BASE_NAME)Strings.hpk\r
1063LOCALIZE_TARGETS = $(LOCALIZE_TARGETS) $(DEST_DIR)\$(BASE_NAME).res\r
1064OBJECTS = $(OBJECTS) $(DEST_DIR)\$(BASE_NAME).res\r
1065\r
1066$(DEST_DIR)\$(BASE_NAME).rc : $(HII_PACK_FILES)\r
1067 $(HIIPACK) -g $(FILE_GUID) $(HII_PACK_FILES) -rc $(DEST_DIR)\$(BASE_NAME).rc -hii $(DEST_DIR)\$(BASE_NAME).hii\r
3eb9473e 1068\r
3e99020d
LG
1069$(DEST_DIR)\$(BASE_NAME).res : $(DEST_DIR)\$(BASE_NAME).rc\r
1070 $(RC) /fo $(DEST_DIR)\$(BASE_NAME).res $(DEST_DIR)\$(BASE_NAME).rc\r
1071\r
1072!ENDIF\r
1073\r
1074!IF (("$(EFI_GENERATE_HII_EXPORT)" == "YES") && ("$(EFI_SPECIFICATION_VERSION)" < "0x0002000A"))\r
3eb9473e 1075#\r
1076# There will be one HII pack containing all the strings. Add that file\r
1077# to the list of HII pack files we'll use to create our final HII export file.\r
1078#\r
1079HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(BASE_NAME)Strings.hpk\r
1080\r
1081LOCALIZE_TARGETS = $(LOCALIZE_TARGETS) $(DEST_DIR)\$(BASE_NAME).hii\r
1082!ENDIF\r
1083\r
3e99020d
LG
1084!IF ("$(EFI_SPECIFICATION_VERSION)" >= "0x0002000A")\r
1085#\r
1086# Note: currently -ppflag option is only available for UefiStrGather\r
1087# Note: /GS- will cause warning for preprocess, so filter it out from STRGATHER_PPFLAG\r
1088#\r
1089STRGATHER_PPFLAG = $(EBC_C_FLAGS: /GS-=)\r
1090STRGATHER_FLAGS = $(STRGATHER_FLAGS) -ppflag "$(STRGATHER_PPFLAG)" -oh $(DEST_DIR)\$(BASE_NAME)StrDefs.h\r
1091!ENDIF\r
1092\r
3eb9473e 1093$(DEST_DIR)\$(BASE_NAME).sdb : $(SDB_FILES) $(SOURCE_FILES)\r
1094 $(STRGATHER) -scan -vdbr $(STRGATHER_FLAGS) -od $(DEST_DIR)\$(BASE_NAME).sdb \\r
1095 -skipext .uni -skipext .h $(SOURCE_FILES)\r
1096\r
1097$(DEST_DIR)\$(BASE_NAME)Strings.c : $(DEST_DIR)\$(BASE_NAME).sdb\r
1098 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \\r
1099 -oc $(DEST_DIR)\$(BASE_NAME)Strings.c\r
1100\r
1101$(DEST_DIR)\$(BASE_NAME)StrDefs.h : $(DEST_DIR)\$(BASE_NAME).sdb\r
1102 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \\r
1103 -oh $(DEST_DIR)\$(BASE_NAME)StrDefs.h\r
1104\r
1105$(DEST_DIR)\$(BASE_NAME)Strings.hpk : $(DEST_DIR)\$(BASE_NAME).sdb\r
1106 $(STRGATHER) -dump $(LANGUAGE_FLAGS) -bn $(BASE_NAME)Strings -db $(DEST_DIR)\$(BASE_NAME).sdb \\r
1107 -hpk $(DEST_DIR)\$(BASE_NAME)Strings.hpk\r
1108\r
1109OBJECTS = $(OBJECTS) $(DEST_DIR)\$(BASE_NAME)Strings.obj\r
1110\r
1111$(DEST_DIR)\$(BASE_NAME)Strings.obj : $(DEST_DIR)\$(BASE_NAME)Strings.c $(INF_FILENAME) $(ALL_DEPS)\r
1112 $(EBC_CC) $(EBC_C_FLAGS) $(DEST_DIR)\$(BASE_NAME)Strings.c\r
1113\r
3e99020d 1114LOCALIZE_TARGETS = $(DEST_DIR)\$(BASE_NAME)StrDefs.h $(LOCALIZE_TARGETS)\r
3eb9473e 1115\r
1116!ENDIF\r
1117\r
1118#\r
1119# If building an application, then the target is a .app, not .dxe\r
1120#\r
1121!IF "$(COMPONENT_TYPE)" == "APPLICATION"\r
1122TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).app\r
1123SUBSYSTEM = EFI_APPLICATION\r
1124!ELSE\r
1125TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).dxe\r
1126SUBSYSTEM = EFI_BOOT_SERVICE_DRIVER\r
1127!ENDIF\r
1128\r
1129#\r
1130# Defines for standard intermediate files and build targets\r
1131#\r
1132TARGET_EFI = $(BIN_DIR)\$(BASE_NAME).efi\r
1133TARGET_DPX = $(DEST_DIR)\$(BASE_NAME).dpx\r
1134TARGET_UI = $(DEST_DIR)\$(BASE_NAME).ui\r
1135TARGET_VER = $(DEST_DIR)\$(BASE_NAME).ver\r
1136TARGET_MAP = $(BIN_DIR)\$(BASE_NAME).map\r
1137TARGET_PDB = $(BIN_DIR)\$(BASE_NAME).pdb\r
1138TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pe32\r
1139TARGET_DLL = $(BIN_DIR)\$(BASE_NAME).dll\r
1140\r
1141#\r
1142# First link all the objects and libs together to make a .dll file\r
1143#\r
1144$(TARGET_DLL) : $(OBJECTS) $(LIBS) $(INF_FILENAME) $(ENV_DEPS)\r
1145 $(EBC_LINK) $(EBC_LINK_FLAGS) /SUBSYSTEM:$(SUBSYSTEM) /ENTRY:EfiStart \\r
1146 $(OBJECTS) $(LIBS) /OUT:$(TARGET_DLL) /MAP:$(TARGET_MAP)\r
1147 $(SETSTAMP) $(TARGET_DLL) $(BUILD_DIR)\GenStamp.txt\r
1148!IF "$(EFI_ZERO_DEBUG_DATA)" == "YES"\r
1149 $(ZERODEBUGDATA) $(TARGET_DLL)\r
1150!ENDIF\r
1151\r
1152#\r
1153# Now take the .dll file and make a .efi file\r
1154#\r
1155$(TARGET_EFI) : $(TARGET_DLL) $(INF_FILENAME)\r
1156 $(FWIMAGE) -t 0 $(COMPONENT_TYPE) $(TARGET_DLL) $(TARGET_EFI)\r
1157\r
1158#\r
1159# Now take the .efi file and make a .pe32 section\r
1160#\r
1161$(TARGET_PE32) : $(TARGET_EFI) \r
1162 $(GENSECTION) -I $(TARGET_EFI) -O $(TARGET_PE32) -S EFI_SECTION_PE32\r
1163\r
1164#\r
1165# Create the user interface section\r
1166#\r
1167$(TARGET_UI) : $(INF_FILENAME)\r
1168 $(GENSECTION) -O $(TARGET_UI) -S EFI_SECTION_USER_INTERFACE -A "$(BASE_NAME)"\r
1169\r
1170#\r
1171# Create the version section\r
1172#\r
1173!IF "$(BUILD_NUMBER)" != ""\r
1174!IF "$(VERSION_STRING)" != ""\r
1175$(TARGET_VER) : $(INF_FILENAME)\r
1176 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER) -A "$(VERSION_STRING)"\r
1177!ELSE\r
1178$(TARGET_VER) : $(INF_FILENAME)\r
1179 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER)\r
1180!ENDIF\r
1181!ELSE\r
3e99020d 1182$(TARGET_VER) : $(INF_FILENAME)\r
3eb9473e 1183 echo. > $(TARGET_VER)\r
1184 type $(TARGET_VER) > $(TARGET_VER)\r
1185!ENDIF\r
1186\r
1187#\r
1188# Makefile entries to create the dependency expression section.\r
1189# Use the DPX file from the source directory unless an override file\r
1190# was specified.\r
1191# If no DPX source file was specified, then create an empty file to\r
1192# be used.\r
1193#\r
1194!IF "$(DPX_SOURCE)" != ""\r
1195DPX_SOURCE_FILE = $(SOURCE_DIR)\$(DPX_SOURCE)\r
1196!ENDIF\r
1197\r
1198!IF "$(DPX_SOURCE_OVERRIDE)" != ""\r
1199DPX_SOURCE_FILE = $(DPX_SOURCE_OVERRIDE)\r
1200!ENDIF\r
1201\r
1202!IF "$(DPX_SOURCE_FILE)" != ""\r
1203!IF EXIST ($(DPX_SOURCE_FILE))\r
95d675b5 1204\r
3eb9473e 1205#\r
95d675b5 1206# Add build dependency check\r
3eb9473e 1207#\r
1208DEP_FILE = $(DEST_DIR)\$(BASE_NAME)dxs.dep\r
1209\r
95d675b5 1210!IF EXIST($(DEP_FILE))\r
1211!INCLUDE $(DEP_FILE)\r
1212!ENDIF\r
1213\r
1214!IF "$(EFI_USE_CL_FOR_DEP)" != "YES"\r
1215\r
3eb9473e 1216!IF EXIST($(TARGET_DPX))\r
1217DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs.dep\r
1218!IF !EXIST($(DEP_FILE))\r
1219CREATEDEPS = YES\r
1220!ENDIF\r
1221!ENDIF\r
1222\r
3eb9473e 1223#\r
1224# Update dep file for next round incremental build\r
1225#\r
1226$(DEP_FILE) : $(TARGET_DPX)\r
1227 $(MAKEDEPS) -f $(DPX_SOURCE_FILE) $(DEP_FLAGS)\r
1228\r
95d675b5 1229!ENDIF\r
1230\r
3eb9473e 1231$(TARGET_DPX) : $(DPX_SOURCE_FILE) $(INF_FILENAME)\r
95d675b5 1232!IF "$(EFI_USE_CL_FOR_DEP)" != "YES"\r
1233 $(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) > $*.tmp1\r
1234!ELSE\r
1235 -$(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) /showIncludes > $*.tmp1 2> $(DEST_DIR)\$(BASE_NAME)dxs.cl\r
1236 @$(MAKEDEPS) -f $(DEST_DIR)\$(BASE_NAME)dxs.cl $(DEP_FLAGS2)\r
1237!ENDIF\r
3eb9473e 1238 $(GENDEPEX) -I $*.tmp1 -O $*.tmp2\r
1239 $(GENSECTION) -I $*.tmp2 -O $@ -S $(DEPEX_TYPE)\r
1240 del $*.tmp1 > NUL\r
1241 del $*.tmp2 > NUL\r
1242!ELSE\r
1243!ERROR Dependency expression source file "$(DPX_SOURCE_FILE)" does not exist.\r
1244!ENDIF\r
1245!ELSE\r
3e99020d 1246$(TARGET_DPX) : $(INF_FILENAME)\r
3eb9473e 1247 echo. > $(TARGET_DPX)\r
1248 type $(TARGET_DPX) > $(TARGET_DPX)\r
1249!ENDIF\r
1250\r
1251#\r
1252# Describe how to build the HII export file from all the input HII pack files.\r
1253# Use the FFS file GUID for the package GUID in the export file. Only used\r
1254# when multiple VFR share strings.\r
1255#\r
1256$(DEST_DIR)\$(BASE_NAME).hii : $(HII_PACK_FILES)\r
1257 $(HIIPACK) create -g $(FILE_GUID) -p $(HII_PACK_FILES) -o $(DEST_DIR)\$(BASE_NAME).hii\r
1258\r
1259#\r
1260# If the build calls for creating an FFS file with the IFR included as\r
1261# a separate binary (not compiled into the driver), then build the binary\r
1262# section now. Note that the PACKAGE must be set correctly to actually get\r
1263# this IFR section pulled into the FFS file.\r
1264#\r
1265!IF ("$(HII_IFR_PACK_FILES)" != "")\r
1266\r
1267$(DEST_DIR)\$(BASE_NAME)IfrBin.sec : $(HII_IFR_PACK_FILES)\r
1268 $(HIIPACK) create -novarpacks -p $(HII_IFR_PACK_FILES) -o $(DEST_DIR)\$(BASE_NAME)IfrBin.hii\r
1269 $(GENSECTION) -I $(DEST_DIR)\$(BASE_NAME)IfrBin.hii -O $(DEST_DIR)\$(BASE_NAME)IfrBin.sec -S EFI_SECTION_RAW\r
1270\r
1271BIN_TARGETS = $(BIN_TARGETS) $(DEST_DIR)\$(BASE_NAME)IfrBin.sec\r
1272\r
1273!ENDIF\r
1274\r
1275#\r
1276# Build an FFS file from the sections and package\r
1277#\r
1278$(TARGET_FFS_FILE) : $(TARGET_PE32) $(TARGET_DPX) $(TARGET_UI) $(TARGET_VER) $(PACKAGE_FILENAME)\r
1279 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V\r
1280\r
1281!IF "$(CREATEDEPS)"=="YES"\r
1282all : $(DEP_TARGETS)\r
1283 $(MAKE) -f $(MAKEFILE_NAME) all\r
1284!ELSE\r
1285all : $(LOCALIZE_TARGETS) $(BIN_TARGETS) $(TARGET_FFS_FILE) $(DEP_TARGETS)\r
1286!ENDIF\r
1287\r
1288#\r
1289# Remove the generated temp and final files for this modules.\r
1290#\r
1291clean :\r
1292!IF ("$(FILE_GUID)" != "")\r
1293 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
1294!ENDIF\r
1295 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
1296 @del /q $(DEST_OUTPUT_DIRS) \r
1297\r
1298[=============================================================================]\r
1299#\r
1300# These are the commands to build vendor-provided *.EFI files into an FV.\r
1301# To use them, create an INF file with BUILD_TYPE=BS_DRIVER_EFI.\r
1302# This section, as it now exists, only supports boot service drivers.\r
1303#\r
1304[=============================================================================]\r
bc7c34af 1305[Build.Ia32.BS_DRIVER_EFI|RT_DRIVER_EFI|APPLICATION_EFI|PE32_PEIM_EFI,Build.x64.BS_DRIVER_EFI|RT_DRIVER_EFI|APPLICATION_EFI|PE32_PEIM_EFI]\r
3eb9473e 1306#\r
1307# Defines for standard intermediate files and build targets. For the source\r
1308# .efi file, take the one in the source directory if it exists. If there's not\r
1309# one there, look for one in the processor-specfic subdirectory.\r
1310#\r
1311!IF EXIST ("$(SOURCE_DIR)\$(BASE_NAME).efi")\r
1312TARGET_EFI = $(SOURCE_DIR)\$(BASE_NAME).efi\r
1313!ELSEIF EXIST ("$(SOURCE_DIR)\$(PROCESSOR)\$(BASE_NAME).efi")\r
1314TARGET_EFI = $(SOURCE_DIR)\$(PROCESSOR)\$(BASE_NAME).efi\r
1315!ELSE\r
1316!ERROR Pre-existing $(BASE_NAME).efi file not found in $(SOURCE_DIR) nor $(SOURCE_DIR)\$(PROCESSOR)\r
1317!ENDIF\r
1318\r
1319TARGET_DPX = $(DEST_DIR)\$(BASE_NAME).dpx\r
1320TARGET_UI = $(DEST_DIR)\$(BASE_NAME).ui\r
1321TARGET_VER = $(DEST_DIR)\$(BASE_NAME).ver\r
1322TARGET_MAP = $(BIN_DIR)\$(BASE_NAME).map\r
1323TARGET_PDB = $(BIN_DIR)\$(BASE_NAME).pdb\r
1324TARGET_PE32 = $(DEST_DIR)\$(BASE_NAME).pe32\r
1325TARGET_DLL = $(BIN_DIR)\$(BASE_NAME).dll\r
1326\r
1327#\r
1328# If building an application, then the target is a .app, not .dxe\r
1329#\r
1330!IF "$(COMPONENT_TYPE)" == "APPLICATION"\r
1331TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).app\r
3e99020d
LG
1332!ELSE IF "$(COMPONENT_TYPE)" == "PE32_PEIM"\r
1333TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).pei\r
3eb9473e 1334!ELSE\r
1335TARGET_FFS_FILE = $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).dxe\r
1336!ENDIF\r
1337\r
1338#\r
1339# Take the .efi file and make a .pe32 file\r
1340#\r
1341$(TARGET_PE32) : $(TARGET_EFI) \r
1342 $(GENSECTION) -I $(TARGET_EFI) -O $(TARGET_PE32) -S EFI_SECTION_PE32\r
1343\r
1344#\r
1345# Create the user interface section\r
1346#\r
1347$(TARGET_UI) : $(INF_FILENAME)\r
1348 $(GENSECTION) -O $(TARGET_UI) -S EFI_SECTION_USER_INTERFACE -A "$(BASE_NAME)"\r
1349\r
1350#\r
1351# Create the version section\r
1352#\r
1353!IF "$(BUILD_NUMBER)" != ""\r
1354!IF "$(VERSION_STRING)" != ""\r
1355$(TARGET_VER) : $(INF_FILENAME)\r
1356 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER) -A "$(VERSION_STRING)"\r
1357!ELSE\r
1358$(TARGET_VER) : $(INF_FILENAME)\r
1359 $(GENSECTION) -O $(TARGET_VER) -S EFI_SECTION_VERSION -V $(BUILD_NUMBER)\r
1360!ENDIF\r
1361!ELSE\r
3e99020d 1362$(TARGET_VER) : $(INF_FILENAME)\r
3eb9473e 1363 echo. > $(TARGET_VER)\r
1364 type $(TARGET_VER) > $(TARGET_VER)\r
1365!ENDIF\r
1366\r
1367#\r
1368# Makefile entries to create the dependency expression section.\r
1369# Use the DPX file from the source directory unless an override file\r
1370# was specified.\r
1371# If no DPX source file was specified, then create an empty file to\r
1372# be used.\r
1373#\r
1374!IF "$(DPX_SOURCE)" != ""\r
1375DPX_SOURCE_FILE = $(SOURCE_DIR)\$(DPX_SOURCE)\r
1376!ENDIF\r
1377\r
1378!IF "$(DPX_SOURCE_OVERRIDE)" != ""\r
1379DPX_SOURCE_FILE = $(DPX_SOURCE_OVERRIDE)\r
1380!ENDIF\r
1381\r
1382!IF "$(DPX_SOURCE_FILE)" != ""\r
1383!IF EXIST ($(DPX_SOURCE_FILE))\r
95d675b5 1384\r
3eb9473e 1385#\r
95d675b5 1386# Add build dependency check\r
3eb9473e 1387#\r
1388DEP_FILE = $(DEST_DIR)\$(BASE_NAME)dxs.dep\r
1389\r
95d675b5 1390!IF EXIST($(DEP_FILE))\r
1391!INCLUDE $(DEP_FILE)\r
1392!ENDIF\r
1393\r
1394!IF "$(EFI_USE_CL_FOR_DEP)" != "YES"\r
1395\r
3eb9473e 1396!IF EXIST($(TARGET_DPX))\r
1397DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(BASE_NAME)dxs.dep\r
1398!IF !EXIST($(DEP_FILE))\r
1399CREATEDEPS = YES\r
1400!ENDIF\r
1401!ENDIF\r
1402\r
3eb9473e 1403#\r
1404# Update dep file for next round incremental build\r
1405#\r
1406$(DEP_FILE) : $(TARGET_DPX)\r
1407 $(MAKEDEPS) -f $(DPX_SOURCE_FILE) $(DEP_FLAGS)\r
1408\r
95d675b5 1409!ENDIF\r
1410\r
3eb9473e 1411$(TARGET_DPX) : $(DPX_SOURCE_FILE) $(INF_FILENAME)\r
95d675b5 1412!IF "$(EFI_USE_CL_FOR_DEP)" != "YES"\r
1413 $(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) > $*.tmp1\r
1414!ELSE\r
1415 -$(CC) $(C_FLAGS_DPX) $(DPX_SOURCE_FILE) /showIncludes > $*.tmp1 2> $(DEST_DIR)\$(BASE_NAME)dxs.cl\r
1416 @$(MAKEDEPS) -f $(DEST_DIR)\$(BASE_NAME)dxs.cl $(DEP_FLAGS2)\r
1417!ENDIF\r
3eb9473e 1418 $(GENDEPEX) -I $*.tmp1 -O $*.tmp2\r
1419 $(GENSECTION) -I $*.tmp2 -O $@ -S $(DEPEX_TYPE)\r
1420 del $*.tmp1 > NUL\r
1421 del $*.tmp2 > NUL\r
1422!ELSE\r
1423!ERROR Dependency expression source file "$(DPX_SOURCE_FILE)" does not exist.\r
1424!ENDIF\r
1425!ELSE\r
3e99020d 1426$(TARGET_DPX) : $(INF_FILENAME)\r
3eb9473e 1427 echo. > $(TARGET_DPX)\r
1428 type $(TARGET_DPX) > $(TARGET_DPX)\r
1429!ENDIF\r
1430\r
1431#\r
1432# Build a FFS file from the sections and package\r
1433#\r
1434$(TARGET_FFS_FILE) : $(TARGET_PE32) $(TARGET_DPX) $(TARGET_UI) $(TARGET_VER) $(PACKAGE_FILENAME)\r
1435 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V\r
1436\r
1437all : $(TARGET_FFS_FILE)\r
1438\r
1439#\r
1440# Remove the generated temp and final files for this modules.\r
1441#\r
1442clean :\r
1443!IF ("$(FILE_GUID)" != "")\r
1444 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
1445!ENDIF\r
1446 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
1447 @del /q $(DEST_OUTPUT_DIRS) \r
1448\r
1449[=============================================================================]\r
bc7c34af 1450[Compile.Ia32.Bin|Bmp,Compile.x64.Bin|Bmp]\r
3eb9473e 1451#\r
3e99020d 1452# We simply define the binary source file name\r
3eb9473e 1453#\r
3e99020d 1454BINARY_SOURCE_FILE = $(SOURCE_FILE_NAME)\r
3eb9473e 1455\r
1456[=============================================================================]\r
bc7c34af 1457[Build.Ia32.BINARY|Legacy16|Logo,Build.x64.BINARY|Legacy16|Logo]\r
3eb9473e 1458#\r
1459# Use GenFfsFile to convert it to an FFS file\r
1460#\r
3e99020d
LG
1461$(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).ffs : $(BINARY_SOURCE_FILE) $(PACKAGE_FILENAME) $(INF_FILENAME)\r
1462 $(GENSECTION) -I $(BINARY_SOURCE_FILE) -O $(DEST_DIR)\$(BASE_NAME).sec -S EFI_SECTION_RAW\r
3eb9473e 1463 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V\r
1464\r
1465all : $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).ffs\r
1466\r
1467#\r
1468# Remove the generated temp and final files for this modules.\r
1469#\r
1470clean :\r
1471!IF ("$(FILE_GUID)" != "")\r
1472 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
1473!ENDIF\r
1474 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
1475 @del /q $(DEST_OUTPUT_DIRS) \r
1476\r
1477[=============================================================================]\r
bc7c34af 1478[Build.Ia32.RAWFILE|CONFIG,Build.x64.RAWFILE|CONFIG]\r
3eb9473e 1479#\r
1480# Use GenFfsFile to convert it to an raw FFS file\r
1481#\r
3e99020d
LG
1482$(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).raw : $(BINARY_SOURCE_FILE) $(PACKAGE_FILENAME) $(INF_FILENAME)\r
1483 copy $(BINARY_SOURCE_FILE) $(DEST_DIR)\$(BASE_NAME).bin /Y\r
3eb9473e 1484 $(GENFFSFILE) -B $(DEST_DIR) -P1 $(PACKAGE_FILENAME) -V\r
1485\r
1486all : $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).raw\r
1487\r
1488#\r
1489# Remove the generated temp and final files for this modules.\r
1490#\r
1491clean :\r
1492!IF ("$(FILE_GUID)" != "")\r
1493 @if exist $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).* del $(BIN_DIR)\$(FILE_GUID)-$(BASE_NAME).*\r
1494!ENDIF\r
1495 @if exist $(BIN_DIR)\$(BASE_NAME).* del $(BIN_DIR)\$(BASE_NAME).*\r
1496 @del /q $(DEST_OUTPUT_DIRS) \r
1497\r
1498[=============================================================================]\r
1499# \r
1500# These are commands to compile unicode .uni files.\r
1501#\r
1502[=============================================================================]\r
bc7c34af 1503[Compile.Ia32.Uni,Compile.Ebc.Uni,Compile.x64.Uni]\r
3eb9473e 1504#\r
1505# Emit an error message if the file's base name is the same as the\r
1506# component base name. This causes build issues.\r
1507#\r
1508!IF "$(FILE)" == "$(BASE_NAME)"\r
1509!ERROR Component Unicode string file name cannot be the same as the component BASE_NAME.\r
1510!ENDIF\r
1511\r
1512#\r
1513# Always create dep file for uni file as it can be created at the same time when \r
1514# strgather is parsing uni file.\r
1515#\r
1516DEP_FILE = $(DEST_DIR)\$(FILE)Uni.dep\r
1517\r
1518!IF EXIST($(DEP_FILE))\r
1519!INCLUDE $(DEP_FILE)\r
1520!ENDIF\r
1521\r
1522$(DEST_DIR)\$(FILE).sdb : $(SOURCE_FILE_NAME) $(INF_FILENAME)\r
1523 $(STRGATHER) -parse -newdb -db $(DEST_DIR)\$(FILE).sdb -dep $(DEP_FILE) $(INC) $(SOURCE_FILE_NAME)\r
1524\r
1525SDB_FILES = $(SDB_FILES) $(DEST_DIR)\$(FILE).sdb\r
1526STRGATHER_FLAGS = $(STRGATHER_FLAGS) -db $(DEST_DIR)\$(FILE).sdb\r
1527LOCALIZE = YES\r
1528\r
3e99020d 1529[=============================================================================]\r
bc7c34af 1530[Compile.Ia32.hfr,Compile.Ebc.hfr,Compile.x64.hfr]\r
3eb9473e 1531[=============================================================================]\r
bc7c34af 1532[Compile.Ia32.Vfr,Compile.x64.Vfr]\r
3eb9473e 1533\r
95d675b5 1534#\r
1535# Add build dependency check\r
1536#\r
3eb9473e 1537DEP_FILE = $(DEST_DIR)\$(FILE)Vfr.dep\r
1538\r
95d675b5 1539!IF EXIST($(DEP_FILE))\r
1540!INCLUDE $(DEP_FILE)\r
1541!ENDIF\r
1542\r
3eb9473e 1543!IF EXIST($(DEST_DIR)\$(FILE).obj)\r
1544DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Vfr.dep\r
1545!IF !EXIST($(DEP_FILE))\r
1546CREATEDEPS = YES\r
1547!ENDIF\r
1548!ENDIF\r
1549\r
3eb9473e 1550#\r
1551# Update dep file for next round incremental build\r
1552#\r
1553$(DEP_FILE) : $(DEST_DIR)\$(FILE).obj\r
1554 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)\r
1555\r
1556HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(FILE).hpk\r
1557\r
1558#\r
1559# Add a dummy command for building the HII pack file. In reality, it's built \r
1560# below, but the C_FLAGS macro reference the target as $@, so you can't specify\r
1561# the obj and hpk files as dual targets of the same command.\r
1562#\r
1563$(DEST_DIR)\$(FILE).hpk : $(DEST_DIR)\$(FILE).obj\r
1564 \r
1565$(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)\r
1566 $(VFRCOMPILE) $(VFRCOMPILE_FLAGS) $(INC) -ibin -od $(DEST_DIR)\$(SOURCE_RELATIVE_PATH) \\r
1567 -l $(VFR_FLAGS) $(SOURCE_FILE_NAME)\r
1568 $(CC) $(C_FLAGS) $(DEST_DIR)\$(FILE).c\r
1569\r
1570[=============================================================================]\r
1571[Compile.Ebc.Vfr]\r
1572\r
1573DEP_FILE = $(DEST_DIR)\$(FILE)Vfr.dep\r
1574\r
1575!IF EXIST($(DEST_DIR)\$(FILE).obj)\r
1576DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Vfr.dep\r
1577!IF !EXIST($(DEP_FILE))\r
1578CREATEDEPS = YES\r
1579!ENDIF\r
1580!ENDIF\r
1581\r
1582!IF EXIST($(DEP_FILE))\r
1583!INCLUDE $(DEP_FILE)\r
1584!ENDIF\r
1585\r
1586#\r
1587# Update dep file for next round incremental build\r
1588#\r
1589$(DEP_FILE) : $(DEST_DIR)\$(FILE).obj\r
1590 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)\r
1591\r
1592HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(FILE).hpk\r
1593\r
1594#\r
1595# Add a dummy command for building the HII pack file. In reality, it's built \r
1596# below, but the C_FLAGS macro reference the target as $@, so you can't specify\r
1597# the obj and hpk files as dual targets of the same command.\r
1598#\r
1599$(DEST_DIR)\$(FILE).hpk : $(DEST_DIR)\$(FILE).obj\r
1600 \r
1601$(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)\r
1602 $(VFRCOMPILE) $(VFRCOMPILE_FLAGS) $(INC) -ibin -od $(DEST_DIR)\$(SOURCE_RELATIVE_PATH) \\r
1603 -l $(VFR_FLAGS) $(SOURCE_FILE_NAME)\r
1604 $(EBC_CC) $(EBC_C_FLAGS) $(DEST_DIR)\$(FILE).c\r
1605\r
1606[=============================================================================]\r
1607#\r
1608# Commands for building IFR as uncompressed binary into the FFS file. To \r
1609# use it, set COMPILE_SELECT=.vfr=Ifr_Bin for the component in the DSC file.\r
1610#\r
1611[=============================================================================]\r
bc7c34af 1612[Compile.Ia32.Ifr_Bin,Compile.x64.Ifr_Bin]\r
3eb9473e 1613\r
95d675b5 1614#\r
1615# Add build dependency check\r
1616#\r
3eb9473e 1617DEP_FILE = $(DEST_DIR)\$(FILE)Vfr.dep\r
1618\r
95d675b5 1619!IF EXIST($(DEP_FILE))\r
1620!INCLUDE $(DEP_FILE)\r
1621!ENDIF\r
1622\r
3eb9473e 1623!IF EXIST($(DEST_DIR)\$(FILE).obj)\r
1624DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Vfr.dep\r
1625!IF !EXIST($(DEP_FILE))\r
1626CREATEDEPS = YES\r
1627!ENDIF\r
1628!ENDIF\r
1629\r
3eb9473e 1630#\r
1631# Update dep file for next round incremental build\r
1632#\r
1633$(DEP_FILE) : $(DEST_DIR)\$(FILE).obj\r
1634 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)\r
1635\r
1636HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(FILE).hpk\r
1637\r
1638#\r
1639# Add a dummy command for building the HII pack file. In reality, it's built \r
1640# below, but the C_FLAGS macro reference the target as $@, so you can't specify\r
1641# the obj and hpk files as dual targets of the same command.\r
1642#\r
1643$(DEST_DIR)\$(FILE).hpk : $(DEST_DIR)\$(FILE).obj\r
1644 \r
1645$(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)\r
1646 $(VFRCOMPILE) $(VFRCOMPILE_FLAGS) $(INC) -ibin -od $(DEST_DIR)\$(SOURCE_RELATIVE_PATH) \\r
1647 -l $(VFR_FLAGS) $(SOURCE_FILE_NAME)\r
1648 $(CC) $(C_FLAGS) $(DEST_DIR)\$(FILE).c\r
1649\r
1650#\r
1651# Add to the variable that contains the list of VFR binary files we're going\r
1652# to merge together at the end of the build. \r
1653#\r
1654HII_IFR_PACK_FILES = $(HII_IFR_PACK_FILES) $(DEST_DIR)\$(FILE).hpk\r
1655\r
1656[=============================================================================]\r
1657#\r
1658# Commands for building IFR as uncompressed binary into the FFS file. To \r
1659# use it, set COMPILE_SELECT=.vfr=Ifr_Bin for the component in the DSC file.\r
1660#\r
1661[=============================================================================]\r
1662[Compile.Ebc.Ifr_Bin]\r
1663\r
95d675b5 1664#\r
1665# Add build dependency check\r
1666#\r
3eb9473e 1667DEP_FILE = $(DEST_DIR)\$(FILE)Vfr.dep\r
1668\r
95d675b5 1669!IF EXIST($(DEP_FILE))\r
1670!INCLUDE $(DEP_FILE)\r
1671!ENDIF\r
1672\r
3eb9473e 1673!IF EXIST($(DEST_DIR)\$(FILE).obj)\r
1674DEP_TARGETS = $(DEP_TARGETS) $(DEST_DIR)\$(FILE)Vfr.dep\r
1675!IF !EXIST($(DEP_FILE))\r
1676CREATEDEPS = YES\r
1677!ENDIF\r
1678!ENDIF\r
1679\r
3eb9473e 1680#\r
1681# Update dep file for next round incremental build\r
1682#\r
1683$(DEP_FILE) : $(DEST_DIR)\$(FILE).obj\r
1684 $(MAKEDEPS) -f $(SOURCE_FILE_NAME) $(DEP_FLAGS)\r
1685\r
1686HII_PACK_FILES = $(HII_PACK_FILES) $(DEST_DIR)\$(FILE).hpk\r
1687\r
1688#\r
1689# Add a dummy command for building the HII pack file. In reality, it's built \r
1690# below, but the C_FLAGS macro reference the target as $@, so you can't specify\r
1691# the obj and hpk files as dual targets of the same command.\r
1692#\r
1693$(DEST_DIR)\$(FILE).hpk : $(DEST_DIR)\$(FILE).obj\r
1694 \r
1695$(DEST_DIR)\$(FILE).obj : $(SOURCE_FILE_NAME) $(INF_FILENAME) $(ALL_DEPS)\r
1696 $(VFRCOMPILE) $(VFRCOMPILE_FLAGS) $(INC) -ibin -od $(DEST_DIR)\$(SOURCE_RELATIVE_PATH) \\r
1697 -l $(VFR_FLAGS) $(SOURCE_FILE_NAME)\r
1698 $(EBC_CC) $(EBC_C_FLAGS) $(DEST_DIR)\$(FILE).c\r
1699\r
1700#\r
1701# Add to the variable that contains the list of VFR binary files we're going\r
1702# to merge together at the end of the build. \r
1703#\r
1704HII_IFR_PACK_FILES = $(HII_IFR_PACK_FILES) $(DEST_DIR)\$(FILE).hpk\r
1705\r
1706[=============================================================================]\r
bc7c34af 1707[Compile.Ia32.Fv,Compile.x64.Fv]\r
3eb9473e 1708#\r
1709# Run GenSection on the firmware volume image.\r
1710#\r
3e99020d 1711$(DEST_DIR)\$(SOURCE_FV)Fv.sec : $(SOURCE_FILE_NAME) $(INF_FILENAME)\r
3eb9473e 1712 $(GENSECTION) -I $(SOURCE_FILE_NAME) -O $(DEST_DIR)\$(SOURCE_FV)Fv.sec -S EFI_SECTION_FIRMWARE_VOLUME_IMAGE\r
1713\r
1714[=============================================================================]\r