Fix a bug for token number set in FPD can not exceed 2^31. The fixing is using Long...
[mirror_edk2.git] / Tools / Conf / BuildMacro.xml
CommitLineData
878ddf1f 1<?xml version="1.0" encoding="UTF-8"?>\r
2<!--\r
3Copyright (c) 2006, Intel Corporation\r
4All rights reserved. This program and the accompanying materials\r
5are licensed and made available under the terms and conditions of the BSD License\r
6which accompanies this distribution. The full text of the license may be found at\r
7http://opensource.org/licenses/bsd-license.php\r
8\r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11-->\r
12<project name="common">\r
13 <!--\r
14 macro definitions for building files with different types\r
15 -->\r
16 <!--\r
17 C Code\r
18 -->\r
19 <macrodef name="Build_C_Code">\r
20 <attribute name="FILEPATH"/>\r
21 <attribute name="FILENAME"/>\r
22 <attribute name="FILEEXT" default="c"/>\r
23\r
24 <element name="EXTRA.INC" optional="yes"/>\r
25 <element name="EXTRA.ARG" optional="yes"/>\r
26\r
27 <sequential>\r
22e0585c 28 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
878ddf1f 29\r
30 <if>\r
22e0585c 31 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 32 <then>\r
22e0585c 33 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">\r
34 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
35 <input file="${DEST_DIR_DEBUG}/AutoGen.h"/>\r
878ddf1f 36 <includepath path="${WORKSPACE_DIR}"/>\r
37 <includepath path="${MODULE_DIR}"/>\r
22e0585c 38 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 39 <EXTRA.INC/>\r
40 </makedeps>\r
41 </then>\r
42 </if>\r
43\r
44 <OnDependency>\r
45 <sourcefiles>\r
22e0585c 46 <file ListFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
878ddf1f 47 </sourcefiles>\r
48 <targetfiles>\r
22e0585c 49 <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 50 </targetfiles>\r
51\r
52 <sequential>\r
53 <cc userdefine="on">\r
54 <command type="CC" workdir="${DEST_DIR_OUTPUT}">\r
55 <includepath path="${WORKSPACE_DIR}"/>\r
56 <includepath path="${MODULE_DIR}"/>\r
22e0585c 57 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 58 <EXTRA.INC/>\r
59\r
60 <argument value="${CC_FLAGS}"/>\r
61 <EXTRA.ARG/>\r
22e0585c 62 <!-- <argument value="/FI${DEST_DIR_DEBUG}/AutoGen.h" /> -->\r
63 <includeFile value="${DEST_DIR_DEBUG}/AutoGen.h"/>\r
64 <!-- <argument value="/Fo${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> -->\r
65 <outputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 66\r
22e0585c 67 <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 68 </command>\r
69 </cc>\r
70 </sequential>\r
71 </OnDependency>\r
72\r
73 <!--\r
74 for library generation later\r
75 -->\r
0fd9e137 76 <bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 77 </sequential>\r
78 </macrodef>\r
79\r
80\r
81 <macrodef name="Build_AUTOGEN">\r
82 <attribute name="FILEPATH"/>\r
83 <attribute name="FILENAME"/>\r
84 <attribute name="FILEEXT" default="c"/>\r
85\r
86 <element name="EXTRA.INC" optional="yes"/>\r
87 <element name="EXTRA.ARG" optional="yes"/>\r
88\r
89 <sequential>\r
22e0585c 90 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
878ddf1f 91\r
92 <if>\r
22e0585c 93 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 94 <then>\r
22e0585c 95 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">\r
96 <input file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
97 <input file="${DEST_DIR_DEBUG}/AutoGen.h"/>\r
878ddf1f 98 <includepath path="${WORKSPACE_DIR}"/>\r
99 <includepath path="${MODULE_DIR}"/>\r
22e0585c 100 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 101 <EXTRA.INC/>\r
102 </makedeps>\r
103 </then>\r
104 </if>\r
105\r
106 <OnDependency>\r
107 <sourcefiles>\r
22e0585c 108 <file ListFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
878ddf1f 109 </sourcefiles>\r
110 <targetfiles>\r
22e0585c 111 <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 112 </targetfiles>\r
113\r
114 <sequential>\r
115 <cc userdefine="on">\r
116 <command type="CC" workdir="${DEST_DIR_OUTPUT}">\r
117 <includepath path="${WORKSPACE_DIR}"/>\r
118 <includepath path="${MODULE_DIR}"/>\r
22e0585c 119 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 120 <EXTRA.INC/>\r
0fd9e137 121\r
878ddf1f 122 <argument value="${CC_FLAGS}"/>\r
123 <EXTRA.ARG/>\r
22e0585c 124 <!-- <argument value="/FI${DEST_DIR_DEBUG}/AutoGen.h" /> -->\r
125 <includeFile value="${DEST_DIR_DEBUG}/AutoGen.h"/>\r
126 <!-- <argument value="/Fo${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> -->\r
127 <outputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
0fd9e137 128\r
22e0585c 129 <fileset casesensitive="off" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 130 </command>\r
131 </cc>\r
132 </sequential>\r
133 </OnDependency>\r
134 <!--\r
135 for library generation later\r
136 -->\r
0fd9e137 137 <bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 138 </sequential>\r
139 </macrodef>\r
140\r
141 <macrodef name="Build_Dependency_File">\r
142 <attribute name="FILEPATH"/>\r
143 <attribute name="FILENAME"/>\r
144 <attribute name="FILEEXT" default="dxs"/>\r
145\r
146 <element name="EXTRA.INC" optional="yes"/>\r
147 <element name="EXTRA.ARG" optional="yes"/>\r
148\r
149 <sequential>\r
22e0585c 150 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
878ddf1f 151\r
152 <OnDependency>\r
153 <sourcefiles>\r
22e0585c 154 <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 155 </sourcefiles>\r
156 <targetfiles>\r
22e0585c 157 <file name="${DEST_DIR_OUTPUT}/${BASE_NAME}.@{FILEEXT}.depex"/>\r
878ddf1f 158 </targetfiles>\r
159\r
160 <sequential>\r
0fd9e137 161 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
22e0585c 162 tofile="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.c"/>\r
878ddf1f 163\r
164 <cc userdefine="on">\r
165 <command type="CC" workdir=".">\r
0fd9e137 166 <includepath path="${DEST_DIR_DEBUG}" />\r
878ddf1f 167 <includepath path="${WORKSPACE_DIR}"/>\r
168 <includepath path="${MODULE_DIR}"/>\r
22e0585c 169 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 170 <EXTRA.INC/>\r
171 <argument value="${PP_FLAGS}"/>\r
22e0585c 172 <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.c"/>\r
878ddf1f 173 <outputFile value="@{FILENAME}.@{FILEEXT}.i"/>\r
174 </command>\r
175 </cc>\r
0fd9e137 176\r
22e0585c 177 <gendepex inputFile="@{FILENAME}.@{FILEEXT}.i" outputFile="${DEST_DIR_OUTPUT}/${BASE_NAME}.@{FILEEXT}.depex"/>\r
878ddf1f 178 <delete file="@{FILENAME}.@{FILEEXT}.i" />\r
0fd9e137 179 <delete file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.c" />\r
878ddf1f 180 </sequential>\r
181 </OnDependency>\r
182 </sequential>\r
183 </macrodef>\r
0fd9e137 184\r
878ddf1f 185<!-- Usage Example\r
186 <Build_C_Code\r
187 FILEPATH="."\r
188 FILENAME="${SOURCE_NAME}"\r
189 FILEEXT="c">\r
190 <EXTRA.INC>\r
22e0585c 191 <includepath path="${PACKAGE_DIR}/Include"/>\r
192 <includepath path="${PACKAGE_DIR}/Include/${ARCH}"/>\r
878ddf1f 193 </EXTRA.INC>\r
194\r
195 <EXTRA.ARG>\r
196 <argument value="/D EFI_DEBUG /D EFI_WHATEVER_FLAG"/>\r
197 </EXTRA.ARG>\r
198 </Build_C_Code>\r
199 -->\r
200\r
201 <!--\r
202 IA32/x64 Assembly\r
203 -->\r
204 <macrodef name="Build_Assembly">\r
205 <attribute name="FILEPATH"/>\r
206 <attribute name="FILENAME"/>\r
207 <attribute name="FILEEXT" default="asm"/>\r
208\r
209 <element name="EXTRA.INC" optional="yes"/>\r
210 <element name="EXTRA.ARG" optional="yes"/>\r
211\r
212 <sequential>\r
22e0585c 213 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
878ddf1f 214\r
215 <OnDependency>\r
216 <sourcefiles>\r
22e0585c 217 <file Name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 218 </sourcefiles>\r
219 <targetfiles>\r
22e0585c 220 <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 221 </targetfiles>\r
222\r
223 <sequential>\r
224 <cc userdefine="on">\r
225 <command type="ASM">\r
226 <includepath path="${WORKSPACE_DIR}"/>\r
227 <includepath path="${MODULE_DIR}"/>\r
22e0585c 228 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 229 <EXTRA.INC/>\r
0fd9e137 230\r
878ddf1f 231 <argument value="${ASM_FLAGS}"/>\r
232 <EXTRA.ARG/>\r
22e0585c 233 <argument value="/Fl${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.lst"/>\r
234 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
0fd9e137 235\r
22e0585c 236 <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 237 </command>\r
238 </cc>\r
239 </sequential>\r
240 </OnDependency>\r
241 <!--\r
242 for library generation later\r
243 -->\r
22e0585c 244 <bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 245 </sequential>\r
246 </macrodef>\r
247\r
0fd9e137 248 <!--\r
249 Build x86 assembly with C preprocessing on AutoGen.h\r
250 -->\r
251 <macrodef name="Build_x86_asm_autogen">\r
252 <attribute name="FILEPATH"/>\r
253 <attribute name="FILENAME"/>\r
254 <attribute name="FILEEXT" default="asm"/>\r
255\r
256 <element name="EXTRA.INC" optional="yes"/>\r
257 <element name="EXTRA.ARG" optional="yes"/>\r
258\r
259 <sequential>\r
260 <mkdir dir="${DEST_DIR_DEBUG}/@{FILEPATH}"/>\r
261 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
262\r
263 <if>\r
264 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
265 <then>\r
266 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">\r
267 <input file="${DEST_DIR_DEBUG}/AutoGen.h"/>\r
268 <includepath path="${WORKSPACE_DIR}"/>\r
269 <includepath path="${MODULE_DIR}"/>\r
270 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
271 <EXTRA.INC/>\r
272 </makedeps>\r
273 </then>\r
274 </if>\r
275\r
276 <OnDependency>\r
277 <sourcefiles>\r
278 <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
279 <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
280 </sourcefiles>\r
281 <targetfiles>\r
282 <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
283 </targetfiles>\r
284\r
285 <sequential>\r
286 <cc userdefine="on">\r
287 <command type="CC" workdir="${DEST_DIR_DEBUG}/@{FILEPATH}">\r
288 <includepath path="${WORKSPACE_DIR}"/>\r
289 <includepath path="${MODULE_DIR}"/>\r
290 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
291 <EXTRA.INC/>\r
292 <argument value="${PP_FLAGS}"/>\r
293 <argument value="/FI${DEST_DIR_DEBUG}/AutoGen.h"/>\r
294 <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
295 </command>\r
296 </cc>\r
297 <replaceregexp file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"\r
fe3262a3 298 match="^(#line +1 +.*@{FILEPATH}/@{FILENAME}\.@{FILEEXT}&quot;).+\1"\r
0fd9e137 299 replace="; Source: ${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
300 flags="gs"/>\r
fe3262a3 301 <replaceregexp file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"\r
302 match="^(#line .*)$"\r
303 replace="; \1"\r
304 byline="true"/>\r
0fd9e137 305 <replaceregexp file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"\r
306 match="([^_a-zA-Z])0x([0-9a-fA-F]+)"\r
307 replace="\10\2h"\r
308 flags="g"\r
309 byline="true"/>\r
310 <move file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"\r
311 tofile="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
312 <cc userdefine="on">\r
313 <command type="ASM">\r
314 <includepath path="${WORKSPACE_DIR}"/>\r
315 <includepath path="${MODULE_DIR}"/>\r
316 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
317 <EXTRA.INC/>\r
318\r
319 <argument value="${ASM_FLAGS}"/>\r
320 <EXTRA.ARG/>\r
321 <argument value="/Fl${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.lst"/>\r
322 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
323\r
324 <fileset casesensitive="off" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
325 </command>\r
326 </cc>\r
327 </sequential>\r
328 </OnDependency>\r
329 <!--\r
330 for library generation later\r
331 -->\r
332 <bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
333 </sequential>\r
334 </macrodef>\r
335\r
878ddf1f 336 <!--\r
337 Library private HashMap map = new HashMap();\r
338 -->\r
339 <macrodef name="Build_Library">\r
340 <attribute name="FILENAME" />\r
341 <attribute name="FILEEXT" default="obj"/>\r
342\r
343 <element name="EXTRA.INC" optional="yes"/>\r
344 <element name="EXTRA.ARG" optional="yes"/>\r
345\r
346 <sequential>\r
347 <mkdir dir="${BIN_DIR}"/>\r
348\r
349 <OnDependency>\r
350 <sourcefiles>\r
351 <file list="${OBJECTS}"/>\r
352 </sourcefiles>\r
353 <targetfiles>\r
22e0585c 354 <file name="${BIN_DIR}/@{FILENAME}.lib"/>\r
878ddf1f 355 </targetfiles>\r
356\r
357 <sequential>\r
358 <!-- <echo>re-generate library</echo> -->\r
359 <cc userdefine="on">\r
360 <command type="LIB">\r
361 <argument value="${LIB_FLAGS}"/>\r
362 <!--<argument value="${OBJECTS}"/>-->\r
363 <FileList dir="" files="${OBJECTS}"/>\r
22e0585c 364 <!-- <argument value="/out:${BIN_DIR}/@{FILENAME}.lib"/> -->\r
365 <OutputFile value="${BIN_DIR}/@{FILENAME}.lib"/>\r
878ddf1f 366 </command>\r
367 </cc>\r
368 </sequential>\r
369 </OnDependency>\r
370 </sequential>\r
371 </macrodef>\r
372\r
75d0c5b1 373 <!--\r
374 GCC Assembly\r
375 -->\r
376 <macrodef name="Build_GCC_Assembly_Code">\r
377 <attribute name="FILEPATH"/>\r
378 <attribute name="FILENAME"/>\r
97520113 379 <attribute name="FILEEXT" default="S"/>\r
75d0c5b1 380\r
381 <element name="EXTRA.INC" optional="yes"/>\r
382 <element name="EXTRA.ARG" optional="yes"/>\r
383\r
384 <sequential>\r
385 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
386\r
387 <if>\r
388 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
389 <then>\r
390 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">\r
391 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
392 <includepath path="${WORKSPACE_DIR}"/>\r
393 <includepath path="${MODULE_DIR}"/>\r
394 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
395 <EXTRA.INC/>\r
396 </makedeps>\r
397 </then>\r
398 </if>\r
399\r
400 <OnDependency>\r
401 <sourcefiles>\r
402 <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
403 </sourcefiles>\r
404 <targetfiles>\r
405 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
406 </targetfiles>\r
407\r
408 <sequential>\r
0fd9e137 409\r
75d0c5b1 410 <cc userdefine="on">\r
411 <command type="ASM" includepathDelimiter="-I">\r
412 <EXTRA.INC/>\r
0fd9e137 413\r
75d0c5b1 414 <argument value="${ASM_FLAGS}"/>\r
415 <EXTRA.ARG/>\r
416 <!-- <argument value="-o ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> -->\r
417 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
0fd9e137 418\r
75d0c5b1 419 <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
420 </command>\r
421 </cc>\r
422 </sequential>\r
423 </OnDependency>\r
424 <!--\r
425 for library generation later\r
426 -->\r
427 <bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
428 </sequential>\r
429 </macrodef>\r
430\r
878ddf1f 431 <!--\r
432 IPF Assembly\r
433 -->\r
434 <macrodef name="Build_IPF_Assembly_Code">\r
435 <attribute name="FILEPATH"/>\r
436 <attribute name="FILENAME"/>\r
437 <attribute name="FILEEXT" default="s"/>\r
438\r
439 <element name="EXTRA.INC" optional="yes"/>\r
440 <element name="EXTRA.ARG" optional="yes"/>\r
441\r
442 <sequential>\r
0fd9e137 443 <mkdir dir="${DEST_DIR_DEBUG}/@{FILEPATH}"/>\r
22e0585c 444 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
878ddf1f 445\r
446 <if>\r
22e0585c 447 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 448 <then>\r
22e0585c 449 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">\r
450 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 451 <includepath path="${WORKSPACE_DIR}"/>\r
452 <includepath path="${MODULE_DIR}"/>\r
22e0585c 453 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 454 <EXTRA.INC/>\r
455 </makedeps>\r
456 </then>\r
457 </if>\r
458\r
459 <OnDependency>\r
460 <sourcefiles>\r
22e0585c 461 <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
878ddf1f 462 </sourcefiles>\r
463 <targetfiles>\r
22e0585c 464 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 465 </targetfiles>\r
466\r
467 <sequential>\r
878ddf1f 468 <cc userdefine="on">\r
0fd9e137 469 <command type="CC" workdir="${DEST_DIR_DEBUG}/@{FILEPATH}">\r
878ddf1f 470 <includepath path="${WORKSPACE_DIR}"/>\r
471 <includepath path="${MODULE_DIR}"/>\r
22e0585c 472 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 473 <EXTRA.INC/>\r
474 <argument value="${PP_FLAGS}"/>\r
0fd9e137 475 <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 476 </command>\r
477 </cc>\r
0fd9e137 478 <move file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"\r
22e0585c 479 tofile="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.pro"/>\r
878ddf1f 480 <cc userdefine="on">\r
481 <command type="ASM" includepathDelimiter="-I">\r
482 <includepath path="${WORKSPACE_DIR}"/>\r
483 <includepath path="${MODULE_DIR}"/>\r
22e0585c 484 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 485 <EXTRA.INC/>\r
0fd9e137 486\r
878ddf1f 487 <argument value="${ASM_FLAGS}"/>\r
488 <EXTRA.ARG/>\r
22e0585c 489 <!-- <argument value="-o ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> -->\r
490 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
0fd9e137 491\r
22e0585c 492 <fileset casesensitive="off" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.pro"/>\r
878ddf1f 493 </command>\r
494 </cc>\r
495 </sequential>\r
496 </OnDependency>\r
497 <!--\r
498 for library generation later\r
499 -->\r
22e0585c 500 <bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 501 </sequential>\r
502 </macrodef>\r
503\r
504\r
505 <macrodef name="Build_IPF_PP_Code">\r
506 <attribute name="FILEPATH"/>\r
507 <attribute name="FILENAME"/>\r
508 <attribute name="FILEEXT" default="i"/>\r
509\r
510 <element name="EXTRA.INC" optional="yes"/>\r
511 <element name="EXTRA.ARG" optional="yes"/>\r
512\r
513 <sequential>\r
22e0585c 514 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
0fd9e137 515\r
878ddf1f 516 <cc userdefine="on">\r
517 <command type="ASM" includepathDelimiter="-I">\r
518 <includepath path="${WORKSPACE_DIR}"/>\r
519 <includepath path="${MODULE_DIR}"/>\r
22e0585c 520 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 521 <EXTRA.INC/>\r
0fd9e137 522\r
878ddf1f 523 <argument value="${ASM_FLAGS}"/>\r
524 <EXTRA.ARG/>\r
22e0585c 525 <!-- <argument value="-o ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> -->\r
526 <OutputFile File="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
0fd9e137 527\r
22e0585c 528 <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 529 </command>\r
530 </cc>\r
0fd9e137 531\r
878ddf1f 532 <!--\r
533 for library generation later\r
534 -->\r
22e0585c 535 <bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 536 </sequential>\r
537 </macrodef>\r
0fd9e137 538\r
878ddf1f 539 <!--\r
540 [Build.Ia32.Makefile,Build.Ipf.Makefile,Build.Ebc.Makefile]\r
541 [Build.Ia32.Custom_Makefile,Build.Ipf.Custom_Makefile,Build.Ebc.Custom_Makefile]\r
542 -->\r
543 <macrodef name="Build_Custom_Build">\r
544 <attribute name="FILEPATH"/>\r
545 <attribute name="FILENAME"/>\r
546 <attribute name="FILEEXT" default="c"/>\r
547\r
548 <element name="EXTRA.INC" optional="yes"/>\r
549 <element name="EXTRA.ARG" optional="yes"/>\r
550\r
551 <sequential>\r
552\r
553 </sequential>\r
554 </macrodef>\r
555\r
556 <!--\r
557 Unicode -> .sdb\r
558 -->\r
559 <macrodef name="Build_Unicode">\r
560 <attribute name="FILEPATH"/>\r
561 <attribute name="FILENAME"/>\r
562 <attribute name="FILEEXT" default="uni"/>\r
563\r
564 <element name="EXTRA.INC" optional="yes"/>\r
565 <element name="EXTRA.ARG" optional="yes"/>\r
566\r
567 <sequential>\r
22e0585c 568 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
878ddf1f 569\r
570 <OnDependency>\r
571 <sourcefiles>\r
22e0585c 572 <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 573 </sourcefiles>\r
574 <targetfiles>\r
22e0585c 575 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 576 </targetfiles>\r
577\r
578 <sequential>\r
579 <strgather commandtype="parse" newdatabase="true">\r
22e0585c 580 <database name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 581 <includepath path="${WORKSPACE_DIR}"/>\r
582 <includepath path="${MODULE_DIR}"/>\r
22e0585c 583 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 584 <EXTRA.INC/>\r
585 <EXTRA.ARG/>\r
22e0585c 586 <inputfile name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 587 </strgather>\r
588 </sequential>\r
589 </OnDependency>\r
590\r
22e0585c 591 <bl name="SDB_FILES" value="${SDB_FILES}, ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 592 </sequential>\r
593 </macrodef>\r
594\r
595 <!--\r
596 .sdb(s) -> .c, .h -> .obj\r
597 -->\r
598 <macrodef name="Build_Unicode_Database">\r
599 <attribute name="FILEPATH"/>\r
600 <attribute name="FILENAME"/>\r
601 <attribute name="FILEEXT" default="sdb"/>\r
602\r
603 <element name="EXTRA.INC" optional="yes"/>\r
604 <element name="EXTRA.ARG" optional="yes"/>\r
605\r
606 <sequential>\r
607 <OnDependency>\r
608 <sourcefiles>\r
609 <file list="${SDB_FILES}"/>\r
610 <file list="${SOURCE_FILES}"/>\r
611 </sourcefiles>\r
612 <targetfiles>\r
22e0585c 613 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 614 </targetfiles>\r
0fd9e137 615\r
878ddf1f 616 <sequential>\r
22e0585c 617 <strgather commandtype="scan" outputdatabase="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb" verbose="read">\r
878ddf1f 618 <skipext name=".uni"/>\r
619 <skipext name=".h"/>\r
620 <database list="${SDB_FILES}"/>\r
621 <inputfile name="${SOURCE_FILES}"/>\r
622 </strgather>\r
623 </sequential>\r
624 </OnDependency>\r
625\r
626 <OnDependency>\r
627 <sourcefiles>\r
22e0585c 628 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 629 </sourcefiles>\r
630 <targetfiles>\r
22e0585c 631 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}StrDefs.h"/>\r
632 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.hpk"/>\r
633 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c"/>\r
878ddf1f 634 </targetfiles>\r
0fd9e137 635\r
878ddf1f 636 <sequential>\r
637 <strgather basename="@{FILENAME}Strings" commandtype="dump"\r
22e0585c 638 outputdefines="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}StrDefs.h"\r
639 outputhpk="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.hpk"\r
640 outputstring="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c">\r
641 <database name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 642 </strgather>\r
643 </sequential>\r
644 </OnDependency>\r
645\r
646 <OnDependency>\r
647 <sourcefiles>\r
22e0585c 648 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c"/>\r
878ddf1f 649 </sourcefiles>\r
650 <targetfiles>\r
22e0585c 651 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Strings.obj"/>\r
878ddf1f 652 </targetfiles>\r
0fd9e137 653\r
878ddf1f 654 <sequential>\r
655 <cc userdefine="on">\r
656 <command type="CC" workdir="${DEST_DIR_OUTPUT}" includepathDelimiter="-I">\r
657 <includepath path="${WORKSPACE_DIR}"/>\r
658 <includepath path="${MODULE_DIR}"/>\r
22e0585c 659 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 660\r
661 <argument value="${CC_FLAGS}"/>\r
22e0585c 662 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Strings.obj"/>\r
878ddf1f 663\r
22e0585c 664 <fileset casesensitive="off" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c"/>\r
878ddf1f 665 </command>\r
666 </cc>\r
667 </sequential>\r
668 </OnDependency>\r
669\r
22e0585c 670 <bl name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Strings.obj"/>\r
878ddf1f 671 </sequential>\r
672 </macrodef>\r
673\r
674 <!--\r
675 Vfr\r
676 -->\r
677 <macrodef name="Build_Vfr">\r
678 <attribute name="FILEPATH"/>\r
679 <attribute name="FILENAME"/>\r
680 <attribute name="FILEEXT" default="vfr"/>\r
681\r
682 <element name="EXTRA.INC" optional="yes"/>\r
683 <element name="EXTRA.ARG" optional="yes"/>\r
684\r
685 <sequential>\r
686 <mkdir dir="${DEST_DIR_DEBUG}/@{FILEPATH}"/>\r
687\r
688 <if>\r
22e0585c 689 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 690 <then>\r
22e0585c 691 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">\r
692 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
693 <!-- <input file="${DEST_DIR_DEBUG}/AutoGen.h"/> -->\r
878ddf1f 694 <includepath path="${WORKSPACE_DIR}"/>\r
695 <includepath path="${MODULE_DIR}"/>\r
22e0585c 696 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 697 <EXTRA.INC/>\r
698 </makedeps>\r
699 </then>\r
700 </if>\r
701\r
702 <OnDependency>\r
703 <sourcefiles>\r
22e0585c 704 <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
878ddf1f 705 </sourcefiles>\r
706 <targetfiles>\r
22e0585c 707 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 708 </targetfiles>\r
709\r
710 <sequential>\r
22e0585c 711 <vfrcompile createIfrBinFile="on" createListFile="on" outPutDir="${DEST_DIR_DEBUG}/@{FILEPATH}" vfrFile="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}">\r
878ddf1f 712 <includepath path="${WORKSPACE_DIR}"/>\r
713 <includepath path="${MODULE_DIR}"/>\r
22e0585c 714 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 715 <EXTRA.INC/>\r
716 </vfrcompile>\r
0fd9e137 717\r
878ddf1f 718 <cc userdefine="on">\r
719 <command type="CC" workdir="${DEST_DIR_OUTPUT}" includepathDelimiter="-I">\r
720 <includepath path="${WORKSPACE_DIR}"/>\r
721 <includepath path="${MODULE_DIR}"/>\r
22e0585c 722 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 723 <argument value="${CC_FLAGS}"/>\r
22e0585c 724 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 725 <EXTRA.ARG/>\r
0fd9e137 726\r
22e0585c 727 <fileset casesensitive="off" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.c"/>\r
878ddf1f 728 </command>\r
729 </cc>\r
0fd9e137 730\r
878ddf1f 731 <delete file="@{FILENAME}.i"/>\r
732 </sequential>\r
733 </OnDependency>\r
22e0585c 734 <bl name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 735 </sequential>\r
736 </macrodef>\r
737\r
738<!--############################################################################\r
739 Build Sections\r
740#############################################################################-->\r
741 <!--\r
742 DLL\r
743 -->\r
744 <macrodef name="GenDll">\r
745 <attribute name="FILEPATH"/>\r
746 <attribute name="FILENAME"/>\r
747 <attribute name="FILEEXT"/>\r
748\r
749 <element name="LIB.ARG" optional="yes"/>\r
750 <element name="LINK.ARG" optional="yes"/>\r
751\r
752 <sequential>\r
753 <OnDependency>\r
754 <sourcefiles>\r
755 <file list="${OBJECTS}"/>\r
756 <file list="${LIBS}"/>\r
757 </sourcefiles>\r
758 <targetfiles>\r
22e0585c 759 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll"/>\r
878ddf1f 760 </targetfiles>\r
761\r
762 <sequential>\r
8b41e66e 763 <cc userdefine="on">\r
764 <command type="LIB">\r
765 <argument value="${LIB_FLAGS}"/>\r
766 <FileList dir="" files="${OBJECTS}"/>\r
767 <LIB.ARG/>\r
f06ffac4 768 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib"/>\r
8b41e66e 769 </command>\r
770 </cc>\r
878ddf1f 771 <cc userdefine="on">\r
772 <command type="LINK">\r
773 <argument value="${LINK_FLAGS}"/>\r
f06ffac4 774 <libset libs="${LIBS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib"/>\r
878ddf1f 775 <LINK.ARG/>\r
878ddf1f 776 <EntryPoint value="_ModuleEntryPoint"/>\r
22e0585c 777 <map value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.map"/>\r
778 <pdb value="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.pdb"/>\r
779 <OutputFile value="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll"/>\r
8b41e66e 780 <!-- <FileList dir="" files="${OBJECTS}"/> -->\r
878ddf1f 781 </command>\r
782 </cc>\r
783 </sequential>\r
784 </OnDependency>\r
785 </sequential>\r
786 </macrodef>\r
787\r
788 <!--\r
789 EFI\r
790 -->\r
791 <macrodef name="GenEfi">\r
792 <attribute name="FILEPATH"/>\r
793 <attribute name="FILENAME"/>\r
794 <attribute name="FILEEXT" default="dll"/>\r
795\r
796 <sequential>\r
797 <OnDependency>\r
798 <sourcefiles>\r
22e0585c 799 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 800 </sourcefiles>\r
801 <targetfiles>\r
22e0585c 802 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
878ddf1f 803 </targetfiles>\r
804\r
805 <sequential>\r
fe3262a3 806 <if>\r
807 <equals arg1="${COMPONENT_TYPE}" arg2="SEC"/>\r
808 <then>\r
809 <var name="COMPONENT_TYPE" value="SECURITY_CORE"/>\r
810 </then>\r
811 </if>\r
0fd9e137 812 <fwimage componenttype="${COMPONENT_TYPE}" outImage="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"\r
22e0585c 813 peImage="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" time="0"/>\r
f06ffac4 814 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${DEST_DIR_DEBUG}/@{FILENAME}.efi" />\r
878ddf1f 815 </sequential>\r
816 </OnDependency>\r
817 </sequential>\r
818 </macrodef>\r
819\r
820<!--\r
821 EFI_SECTION_FREEFORM_SUBTYPE_GUID\r
822 EFI_SECTION_VERSION\r
823 EFI_SECTION_USER_INTERFACE\r
824 EFI_SECTION_DXE_DEPEX\r
825 EFI_SECTION_PEI_DEPEX\r
826 EFI_SECTION_PE32\r
827 EFI_SECTION_PIC\r
828 EFI_SECTION_TE\r
829 EFI_SECTION_RAW\r
830 EFI_SECTION_COMPRESSION\r
831 EFI_SECTION_GUID_DEFINED\r
832 EFI_SECTION_COMPATIBILITY16\r
833 EFI_SECTION_FIRMWARE_VOLUME_IMAGE\r
834 -->\r
835 <!--\r
836 EFI_SECTION_PE32\r
837 -->\r
838 <macrodef name="EFI_SECTION_PE32">\r
839 <attribute name="FILEPATH"/>\r
840 <attribute name="FILENAME"/>\r
841 <attribute name="FILEEXT" default="" />\r
842\r
843 <element name="PRE.PROCESS" optional="yes"/>\r
844 <element name="POST.PROCESS" optional="yes"/>\r
845\r
846 <sequential>\r
847 <PRE.PROCESS/>\r
848\r
849 <if>\r
850 <not>\r
851 <equals arg1="${OBJECTS}" arg2=""/>\r
852 </not>\r
853\r
854 <then>\r
855 <GenDll FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="">\r
856 <LIB.ARG></LIB.ARG>\r
857 <LINK.ARG></LINK.ARG>\r
858 </GenDll>\r
0fd9e137 859\r
878ddf1f 860 <GenEfi FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="dll"/>\r
861 </then>\r
862 </if>\r
863\r
864 <OnDependency>\r
865 <sourcefiles>\r
22e0585c 866 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
878ddf1f 867 </sourcefiles>\r
868 <targetfiles>\r
22e0585c 869 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32"/>\r
878ddf1f 870 </targetfiles>\r
871\r
872 <sequential>\r
22e0585c 873 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${BIN_DIR}/@{FILENAME}.efi" />\r
0fd9e137 874 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"\r
875 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32"\r
878ddf1f 876 sectiontype="EFI_SECTION_PE32"/>\r
0fd9e137 877\r
878ddf1f 878 <POST.PROCESS/>\r
879 </sequential>\r
880 </OnDependency>\r
881 </sequential>\r
882 </macrodef>\r
883\r
884 <!--\r
885 EFI_SECTION_VERSION\r
886 -->\r
887 <macrodef name="EFI_SECTION_VERSION">\r
888 <attribute name="FILEPATH"/>\r
889 <attribute name="FILENAME"/>\r
890 <attribute name="FILEEXT" default="" />\r
891 <attribute name="VERSION" default="0000"/>\r
892\r
893 <element name="PRE.PROCESS" optional="yes"/>\r
894 <element name="POST.PROCESS" optional="yes"/>\r
895\r
896 <sequential>\r
897 <if>\r
898 <not>\r
22e0585c 899 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver"/>\r
878ddf1f 900 </not>\r
901\r
902 <then>\r
903 <PRE.PROCESS/>\r
0fd9e137 904 <gensection outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver"\r
878ddf1f 905 versionnum="@{VERSION}"\r
906 sectiontype="EFI_SECTION_VERSION"/>\r
907 <POST.PROCESS/>\r
908 </then>\r
909 </if>\r
910 </sequential>\r
911 </macrodef>\r
912\r
913 <!--\r
914 EFI_SECTION_USER_INTERFACE\r
915 -->\r
916 <macrodef name="EFI_SECTION_USER_INTERFACE">\r
917 <attribute name="FILEPATH"/>\r
918 <attribute name="FILENAME"/>\r
919 <attribute name="FILEEXT" default="" />\r
920 <attribute name="UI" default="${BASE_NAME}"/>\r
921\r
922 <element name="PRE.PROCESS" optional="yes"/>\r
923 <element name="POST.PROCESS" optional="yes"/>\r
924\r
925 <sequential>\r
926 <if>\r
927 <not>\r
22e0585c 928 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui"/>\r
878ddf1f 929 </not>\r
930\r
931 <then>\r
932 <PRE.PROCESS/>\r
933 <gensection interfacestring="@{UI}"\r
0fd9e137 934 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui"\r
878ddf1f 935 sectiontype="EFI_SECTION_USER_INTERFACE"/>\r
936 <POST.PROCESS/>\r
937 </then>\r
938 </if>\r
939 </sequential>\r
940 </macrodef>\r
941\r
942 <!--\r
943 EFI_SECTION_FREEFORM_SUBTYPE_GUID\r
944 <macrodef name="EFI_SECTION_FREEFORM_SUBTYPE_GUID">\r
945 <attribute name="FILEPATH"/>\r
946 <attribute name="FILENAME"/>\r
947 <attribute name="FILEEXT" default=""/>\r
0fd9e137 948\r
878ddf1f 949 <element name="EXTRA.INC" optional="yes"/>\r
950 <element name="EXTRA.ARG" optional="yes"/>\r
0fd9e137 951\r
878ddf1f 952 <sequential>\r
0fd9e137 953 <gensection inputfile=""\r
954 outputfile=""\r
878ddf1f 955 sectiontype="EFI_SECTION_FREEFORM_SUBTYPE_GUID"/>\r
956 </sequential>\r
957 </macrodef>\r
958 -->\r
959\r
960 <!--\r
961 EFI_SECTION_DXE_DEPEX\r
962 -->\r
963 <macrodef name="EFI_SECTION_DXE_DEPEX">\r
964 <attribute name="FILEPATH"/>\r
965 <attribute name="FILENAME"/>\r
966 <attribute name="FILEEXT" default="dxs"/>\r
967\r
968 <element name="PRE.PROCESS" optional="yes"/>\r
969 <element name="POST.PROCESS" optional="yes"/>\r
970\r
971 <sequential>\r
972 <PRE.PROCESS/>\r
973\r
974 <if>\r
22e0585c 975 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"/>\r
878ddf1f 976 <then>\r
977 <OnDependency>\r
978 <sourcefiles>\r
22e0585c 979 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"/>\r
878ddf1f 980 </sourcefiles>\r
981 <targetfiles>\r
22e0585c 982 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 983 </targetfiles>\r
984 <sequential>\r
0fd9e137 985 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"\r
986 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"\r
878ddf1f 987 sectiontype="EFI_SECTION_DXE_DEPEX"/>\r
988 </sequential>\r
989 </OnDependency>\r
990 </then>\r
991 <else>\r
992 <if>\r
993 <not>\r
22e0585c 994 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 995 </not>\r
996 <then>\r
22e0585c 997 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 998 </then>\r
999 </if>\r
1000 </else>\r
1001 </if>\r
1002\r
1003 <POST.PROCESS/>\r
1004 </sequential>\r
1005 </macrodef>\r
1006\r
1007 <!--\r
1008 EFI_SECTION_PEI_DEPEX\r
1009 -->\r
1010 <macrodef name="EFI_SECTION_PEI_DEPEX">\r
1011 <attribute name="FILEPATH"/>\r
1012 <attribute name="FILENAME"/>\r
1013 <attribute name="FILEEXT" default="dxs"/>\r
1014\r
1015 <element name="PRE.PROCESS" optional="yes"/>\r
1016 <element name="POST.PROCESS" optional="yes"/>\r
1017 <sequential>\r
1018 <PRE.PROCESS/>\r
1019 <if>\r
22e0585c 1020 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"/>\r
878ddf1f 1021 <then>\r
1022 <OnDependency>\r
1023 <sourcefiles>\r
22e0585c 1024 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"/>\r
878ddf1f 1025 </sourcefiles>\r
1026 <targetfiles>\r
22e0585c 1027 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1028 </targetfiles>\r
1029\r
1030 <sequential>\r
0fd9e137 1031 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"\r
1032 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"\r
878ddf1f 1033 sectiontype="EFI_SECTION_PEI_DEPEX"/>\r
1034 </sequential>\r
1035 </OnDependency>\r
0fd9e137 1036\r
878ddf1f 1037 </then>\r
1038 <else>\r
1039 <if>\r
1040 <not>\r
22e0585c 1041 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1042 </not>\r
1043 <then>\r
22e0585c 1044 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1045 </then>\r
1046 </if>\r
1047 </else>\r
1048 </if>\r
1049 <POST.PROCESS/>\r
1050 </sequential>\r
1051 </macrodef>\r
1052\r
1053 <!--\r
1054 EFI_SECTION_PIC\r
1055 <macrodef name="EFI_SECTION_PIC">\r
1056 <attribute name="FILEPATH"/>\r
1057 <attribute name="FILENAME"/>\r
1058 <attribute name="FILEEXT" default=""/>\r
0fd9e137 1059\r
878ddf1f 1060 <element name="EXTRA.INC" optional="yes"/>\r
1061 <element name="EXTRA.ARG" optional="yes"/>\r
0fd9e137 1062\r
878ddf1f 1063 <sequential>\r
0fd9e137 1064 <gensection inputfile="${BIN_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
1065 outputfile="${BIN_DIR}/@{FILENAME}.pe32"\r
878ddf1f 1066 sectiontype="EFI_SECTION_PIC"/>\r
1067 </sequential>\r
1068 </macrodef>\r
1069 -->\r
1070\r
1071 <!--\r
1072 EFI_SECTION_TE\r
1073 <macrodef name="EFI_SECTION_TE">\r
1074 <attribute name="FILEPATH"/>\r
1075 <attribute name="FILENAME"/>\r
1076 <attribute name="FILEEXT" default=""/>\r
0fd9e137 1077\r
878ddf1f 1078 <element name="EXTRA.INC" optional="yes"/>\r
1079 <element name="EXTRA.ARG" optional="yes"/>\r
0fd9e137 1080\r
878ddf1f 1081 <sequential>\r
0fd9e137 1082 <gensection inputfile="${BIN_DIR}/@{FILENAME}.@{FILEEXT}"\r
1083 outputfile="${BIN_DIR}/@{FILENAME}.pe32"\r
878ddf1f 1084 sectiontype="EFI_SECTION_PE32"/>\r
1085 </sequential>\r
1086 </macrodef>\r
1087 -->\r
1088\r
1089 <!--\r
1090 EFI_SECTION_RAW\r
1091 -->\r
1092 <macrodef name="EFI_SECTION_RAW">\r
1093 <attribute name="FILEPATH"/>\r
1094 <attribute name="FILENAME"/>\r
1095 <attribute name="FILEEXT" default="bin"/>\r
1096\r
1097 <element name="PRE.PROCESS" optional="yes"/>\r
1098 <element name="POST.PROCESS" optional="yes"/>\r
1099\r
1100 <sequential>\r
1101 <OnDependency>\r
1102 <sourcefiles>\r
22e0585c 1103 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 1104 </sourcefiles>\r
1105 <targetfiles>\r
22e0585c 1106 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>\r
878ddf1f 1107 </targetfiles>\r
1108\r
1109 <sequential>\r
1110 <PRE.PROCESS/>\r
0fd9e137 1111 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}"\r
1112 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"\r
878ddf1f 1113 sectiontype="EFI_SECTION_RAW"/>\r
1114 <POST.PROCESS/>\r
1115 </sequential>\r
1116 </OnDependency>\r
1117 </sequential>\r
1118 </macrodef>\r
1119\r
1120 <!--\r
1121 EFI_SECTION_COMPRESSION\r
1122 <macrodef name="EFI_SECTION_COMPRESSION">\r
1123 <attribute name="FILEPATH"/>\r
1124 <attribute name="FILENAME"/>\r
1125 <attribute name="FILEEXT" default=""/>\r
0fd9e137 1126\r
878ddf1f 1127 <element name="EXTRA.INC" optional="yes"/>\r
1128 <element name="EXTRA.ARG" optional="yes"/>\r
0fd9e137 1129\r
878ddf1f 1130 <sequential>\r
0fd9e137 1131 <gensection inputfile="${BIN_DIR}/@{FILENAME}.@{FILEEXT}"\r
1132 outputfile="${BIN_DIR}/@{FILENAME}.pe32"\r
878ddf1f 1133 sectiontype="EFI_SECTION_PE32"/>\r
1134 </sequential>\r
1135 </macrodef>\r
1136 -->\r
1137\r
1138 <!--\r
1139 EFI_SECTION_GUID_DEFINED\r
1140 <macrodef name="EFI_SECTION_GUID_DEFINED">\r
1141 <attribute name="FILEPATH"/>\r
1142 <attribute name="FILENAME"/>\r
1143 <attribute name="FILEEXT" default=""/>\r
0fd9e137 1144\r
878ddf1f 1145 <element name="EXTRA.INC" optional="yes"/>\r
1146 <element name="EXTRA.ARG" optional="yes"/>\r
0fd9e137 1147\r
878ddf1f 1148 <sequential>\r
0fd9e137 1149 <gensection inputfile="${BIN_DIR}/@{FILENAME}.@{FILEEXT}"\r
1150 outputfile="${BIN_DIR}/@{FILENAME}.pe32"\r
878ddf1f 1151 sectiontype="EFI_SECTION_PE32"/>\r
1152 </sequential>\r
1153 </macrodef>\r
1154 -->\r
1155\r
1156 <!--\r
1157 EFI_SECTION_COMPATIBILITY16\r
1158 <macrodef name="EFI_SECTION_COMPATIBILITY16">\r
1159 <attribute name="FILEPATH"/>\r
1160 <attribute name="FILENAME"/>\r
1161 <attribute name="FILEEXT" default=""/>\r
0fd9e137 1162\r
878ddf1f 1163 <element name="EXTRA.INC" optional="yes"/>\r
1164 <element name="EXTRA.ARG" optional="yes"/>\r
0fd9e137 1165\r
878ddf1f 1166 <sequential>\r
0fd9e137 1167 <gensection inputfile="${BIN_DIR}/@{FILENAME}.@{FILEEXT}"\r
1168 outputfile="${BIN_DIR}/@{FILENAME}.pe32"\r
878ddf1f 1169 sectiontype="EFI_SECTION_PE32"/>\r
1170 </sequential>\r
1171 </macrodef>\r
0fd9e137 1172\r
878ddf1f 1173 -->\r
1174 <!--\r
1175 EFI_SECTION_FIRMWARE_VOLUME_IMAGE\r
1176 -->\r
1177 <macrodef name="EFI_SECTION_FIRMWARE_VOLUME_IMAGE">\r
1178 <attribute name="FILEPATH"/>\r
1179 <attribute name="FILENAME"/>\r
1180 <attribute name="FILEEXT" default="fv"/>\r
1181\r
1182 <element name="PRE.PROCESS" optional="yes"/>\r
1183 <element name="POST.PROCESS" optional="yes"/>\r
1184\r
1185 <sequential>\r
1186 <OnDependency>\r
1187 <sourcefiles>\r
22e0585c 1188 <file name="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 1189 </sourcefiles>\r
1190 <targetfiles>\r
22e0585c 1191 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec"/>\r
878ddf1f 1192 </targetfiles>\r
1193\r
1194 <sequential>\r
1195 <PRE.PROCESS/>\r
0fd9e137 1196\r
1197 <copy file="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
1198 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
878ddf1f 1199 overwrite="true"/>\r
0fd9e137 1200 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
1201 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec"\r
878ddf1f 1202 sectiontype="EFI_SECTION_FIRMWARE_VOLUME_IMAGE"/>\r
0fd9e137 1203\r
878ddf1f 1204 <POST.PROCESS/>\r
1205 </sequential>\r
1206 </OnDependency>\r
1207 </sequential>\r
1208 </macrodef>\r
1209\r
1210 <!--\r
1211 Binary\r
1212 -->\r
1213 <macrodef name="Build_Binary">\r
1214 <attribute name="FILEPATH"/>\r
1215 <attribute name="FILENAME"/>\r
1216 <attribute name="FILEEXT" default="bin"/>\r
1217\r
1218 <element name="EXTRA.INC" optional="yes"/>\r
1219 <element name="EXTRA.ARG" optional="yes"/>\r
1220\r
1221 <sequential>\r
0fd9e137 1222 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
22e0585c 1223 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.bin"/>\r
878ddf1f 1224 </sequential>\r
1225 </macrodef>\r
1226\r
1227 <!--\r
1228 Graphics (bmp, ...)\r
1229 -->\r
1230 <macrodef name="Build_Graphics">\r
1231 <attribute name="FILEPATH"/>\r
1232 <attribute name="FILENAME"/>\r
1233 <attribute name="FILEEXT" default="bmp"/>\r
1234\r
1235 <element name="EXTRA.INC" optional="yes"/>\r
1236 <element name="EXTRA.ARG" optional="yes"/>\r
1237\r
1238 <sequential>\r
0fd9e137 1239 <mkdir dir="${MODULE_DIR}/@{FILEPATH}" />\r
1240 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
22e0585c 1241 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.bin"/>\r
878ddf1f 1242 </sequential>\r
1243 </macrodef>\r
1244 <macrodef name="Build_EFI">\r
1245 <attribute name="FILEPATH"/>\r
1246 <attribute name="FILENAME"/>\r
1247 <attribute name="FILEEXT" default="efi"/>\r
1248\r
1249 <element name="EXTRA.INC" optional="yes"/>\r
1250 <element name="EXTRA.ARG" optional="yes"/>\r
1251\r
1252 <sequential>\r
0fd9e137 1253 <mkdir dir="${MODULE_DIR}/@{FILEPATH}" />\r
1254 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
22e0585c 1255 tofile="${DEST_DIR_OUTPUT}/${BASE_NAME}.efi"/>\r
878ddf1f 1256 </sequential>\r
1257 </macrodef>\r
1258</project>\r