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