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