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