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