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