Changed the way of using precompiled header in the build process. Now the use of...
[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_OUTPUT}/AutoGen.h.gch" overwrite="true"/>
61 </then>
62 <else>
63 <var name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/AutoGen.h.obj"/>
64 </else>
65 </if>
66 </sequential>
67 </OnDependency>
68 </then>
69 </if>
70 </sequential>
71 </macrodef>
72
73
74 <!--
75 macro definitions for building files with different types
76 -->
77 <!--
78 C Code
79 -->
80 <macrodef name="Build_CCode">
81 <attribute name="FILEPATH"/>
82 <attribute name="FILENAME"/>
83 <attribute name="FILEEXT" default="c"/>
84
85 <element name="EXTRA.INC" optional="yes"/>
86 <element name="EXTRA.ARG" optional="yes"/>
87
88 <sequential>
89 <var name="FILE_BASENAME" value="@{FILENAME}" />
90 <var name="FILE_PATH" value="@{FILEPATH}" />
91 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
92
93 <if>
94 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
95 <then>
96 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">
97 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
98 <input file="${DEST_DIR_DEBUG}/AutoGen.h"/>
99 <EXTRA.INC/>
100 </makedeps>
101 </then>
102 </if>
103
104 <OnDependency>
105 <sourcefiles>
106 <file ListFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
107 </sourcefiles>
108 <targetfiles>
109 <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
110 </targetfiles>
111
112 <sequential>
113 <cc userdefine="on">
114 <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" family="${CC_FAMILY}"
115 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" dpath="${CC_DPATH}">
116 <EXTRA.INC/>
117 <argument value="${CC_FLAGS}"/>
118 <EXTRA.ARG/>
119 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
120 </command>
121 </cc>
122 </sequential>
123 </OnDependency>
124 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->
125 <if>
126 <equals arg1="@{FILEPATH}" arg2="." />
127 <then>
128 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}.obj" />
129 </then>
130 <else>
131 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}.obj" />
132 </else>
133 </if>
134 </sequential>
135 </macrodef>
136
137
138 <macrodef name="Build_AUTOGEN">
139 <attribute name="FILEPATH"/>
140 <attribute name="FILENAME"/>
141 <attribute name="FILEEXT" default="c"/>
142
143 <element name="EXTRA.INC" optional="yes"/>
144 <element name="EXTRA.ARG" optional="yes"/>
145
146 <sequential>
147 <var name="FILE_BASENAME" value="@{FILENAME}" />
148 <var name="FILE_PATH" value="@{FILEPATH}" />
149 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
150
151 <if>
152 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
153 <then>
154 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">
155 <input file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
156 <input file="${DEST_DIR_DEBUG}/AutoGen.h"/>
157 <EXTRA.INC/>
158 </makedeps>
159 </then>
160 </if>
161
162 <OnDependency>
163 <sourcefiles>
164 <file ListFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
165 </sourcefiles>
166 <targetfiles>
167 <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
168 </targetfiles>
169
170 <sequential>
171 <cc userdefine="on">
172 <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" family="${CC_FAMILY}"
173 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" dpath="${CC_DPATH}">
174 <EXTRA.INC/>
175 <argument value="${CC_FLAGS}"/>
176 <EXTRA.ARG/>
177 <fileset casesensitive="on" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
178 </command>
179 </cc>
180 </sequential>
181 </OnDependency>
182 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->
183 <if>
184 <equals arg1="@{FILEPATH}" arg2="." />
185 <then>
186 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}.obj" />
187 </then>
188 <else>
189 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}.obj" />
190 </else>
191 </if>
192 </sequential>
193 </macrodef>
194
195 <macrodef name="Build_DPX">
196 <attribute name="FILEPATH"/>
197 <attribute name="FILENAME"/>
198 <attribute name="FILEEXT" default="dxs"/>
199
200 <element name="EXTRA.INC" optional="yes"/>
201 <element name="EXTRA.ARG" optional="yes"/>
202
203
204 <sequential>
205 <var name="FILE_BASENAME" value="@{FILENAME}" />
206 <var name="FILE_PATH" value="@{FILEPATH}" />
207 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
208
209 <OnDependency>
210 <sourcefiles>
211 <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
212 </sourcefiles>
213 <targetfiles>
214 <file name="${DEST_DIR_OUTPUT}/${BASE_NAME}.depex"/>
215 </targetfiles>
216
217 <sequential>
218 <cc userdefine="on">
219 <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}/@{FILEPATH}" family="${CC_FAMILY}"
220 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i" dpath="${CC_DPATH}">
221 <EXTRA.INC/>
222 <argument value="${PP_FLAGS}"/>
223 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
224 </command>
225 </cc>
226
227 <gendepex inputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i" outputFile="${DEST_DIR_OUTPUT}/${BASE_NAME}.depex"/>
228 </sequential>
229 </OnDependency>
230 </sequential>
231 </macrodef>
232
233 <macrodef name="Build_ASM">
234 <attribute name="FILEPATH"/>
235 <attribute name="FILENAME"/>
236 <attribute name="FILEEXT" default="asm"/>
237
238 <element name="EXTRA.INC" optional="yes"/>
239 <element name="EXTRA.ARG" optional="yes"/>
240
241 <!-- Dispath ASM file, there are three type.
242 asm - Build_Assembly
243 S - Build_Gcc_Assembly
244 s - Build_Ipf_Assembly -->
245 <sequential>
246 <if>
247 <equals arg1="@{FILEEXT}" arg2="asm" />
248 <then>
249 <Build_Assembly FILEPATH="@{FILEPATH}" FILENAME="@{FILENAME}" FILEEXT="@{FILEEXT}">
250 <EXTRA.INC.1><EXTRA.INC /></EXTRA.INC.1>
251 <EXTRA.ARG.1><EXTRA.ARG /></EXTRA.ARG.1>
252 </Build_Assembly>
253 </then>
254 <elseif>
255 <equals arg1="@{FILEEXT}" arg2="S" />
256 <then>
257 <Build_Gcc_Assembly FILEPATH="@{FILEPATH}" FILENAME="@{FILENAME}" FILEEXT="@{FILEEXT}">
258 <EXTRA.INC.1><EXTRA.INC /></EXTRA.INC.1>
259 <EXTRA.ARG.1><EXTRA.ARG /></EXTRA.ARG.1>
260 </Build_Gcc_Assembly>
261 </then>
262 </elseif>
263 <elseif>
264 <equals arg1="@{FILEEXT}" arg2="s" />
265 <then>
266 <Build_IPF_Assembly_Code FILEPATH="@{FILEPATH}" FILENAME="@{FILENAME}" FILEEXT="@{FILEEXT}">
267 <EXTRA.INC.1><EXTRA.INC /></EXTRA.INC.1>
268 <EXTRA.ARG.1><EXTRA.ARG /></EXTRA.ARG.1>
269 </Build_IPF_Assembly_Code>
270 </then>
271 </elseif>
272 </if>
273 </sequential>
274 </macrodef>
275
276 <!--
277 IA32/x64 Assembly
278 -->
279 <macrodef name="Build_Assembly">
280 <attribute name="FILEPATH"/>
281 <attribute name="FILENAME"/>
282 <attribute name="FILEEXT" default="asm"/>
283
284 <element name="EXTRA.INC.1" optional="yes"/>
285 <element name="EXTRA.ARG.1" optional="yes"/>
286
287 <sequential>
288 <var name="FILE_BASENAME" value="@{FILENAME}" />
289 <var name="FILE_PATH" value="@{FILEPATH}" />
290 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
291
292 <OnDependency>
293 <sourcefiles>
294 <file Name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
295 </sourcefiles>
296 <targetfiles>
297 <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
298 </targetfiles>
299
300 <sequential>
301 <cc userdefine="on">
302 <command type="PP" cmd="${PP}" workdir="${DEST_DIR_OUTPUT}/@{FILEPATH}" family="${PP_FAMILY}" dpath="${PP_DPATH}">
303 <EXTRA.INC.1/>
304 <argument value="${PP_FLAGS}"/>
305 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
306 </command>
307 </cc>
308
309 <replaceregexp file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"
310 match="^(#line +1 +.*@{FILEPATH}/@{FILENAME}\.@{FILEEXT}&quot;).+\1"
311 replace=";"
312 flags="gs"/>
313 <replaceregexp file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"
314 match="^(#line .*)$"
315 replace="; \1"
316 byline="true"/>
317 <replaceregexp file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"
318 match="([^_a-zA-Z])0x([0-9a-fA-F]+)"
319 replace="\10\2h"
320 flags="g"
321 byline="true"/>
322
323 <cc userdefine="on">
324 <command type="ASM" cmd="${ASM}" workdir="${DEST_DIR_OUTPUT}" family="${ASM_FAMILY}"
325 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" dpath="${ASM_DPATH}">
326 <EXTRA.INC.1/>
327
328 <argument value="${ASM_FLAGS}"/>
329 <EXTRA.ARG.1/>
330
331 <fileset casesensitive="on" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"/>
332 </command>
333 </cc>
334 </sequential>
335 </OnDependency>
336 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->
337 <if>
338 <equals arg1="@{FILEPATH}" arg2="." />
339 <then>
340 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}.obj" />
341 </then>
342 <else>
343 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}.obj" />
344 </else>
345 </if>
346 </sequential>
347 </macrodef>
348
349 <!--
350 Build GCC assembly code
351 -->
352 <macrodef name="Build_Gcc_Assembly">
353 <attribute name="FILEPATH"/>
354 <attribute name="FILENAME"/>
355 <attribute name="FILEEXT" default="asm"/>
356
357 <element name="EXTRA.INC.1" optional="yes"/>
358 <element name="EXTRA.ARG.1" optional="yes"/>
359
360 <sequential>
361 <var name="FILE_BASENAME" value="@{FILENAME}" />
362 <var name="FILE_PATH" value="@{FILEPATH}" />
363 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
364
365 <OnDependency>
366 <sourcefiles>
367 <file Name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
368 </sourcefiles>
369 <targetfiles>
370 <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
371 </targetfiles>
372
373 <sequential>
374 <cc userdefine="on">
375 <command type="ASM" cmd="${ASM}" workdir="${DEST_DIR_OUTPUT}" family="${ASM_FAMILY}"
376 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" dpath="${ASM_DPATH}">
377 <EXTRA.INC.1/>
378
379 <argument value="${ASM_FLAGS}"/>
380 <EXTRA.ARG.1/>
381
382 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
383 </command>
384 </cc>
385 </sequential>
386 </OnDependency>
387 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->
388 <if>
389 <equals arg1="@{FILEPATH}" arg2="." />
390 <then>
391 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}.obj" />
392 </then>
393 <else>
394 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}.obj" />
395 </else>
396 </if>
397 </sequential>
398 </macrodef>
399
400 <!--
401 IPF Assembly
402 -->
403 <macrodef name="Build_IPF_Assembly_Code">
404 <attribute name="FILEPATH"/>
405 <attribute name="FILENAME"/>
406 <attribute name="FILEEXT" default="s"/>
407
408 <element name="EXTRA.INC.1" optional="yes"/>
409 <element name="EXTRA.ARG.1" optional="yes"/>
410
411 <sequential>
412 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
413
414 <if>
415 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
416 <then>
417 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">
418 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
419 <input file="${DEST_DIR_DEBUG}/AutoGen.h"/>
420 <EXTRA.INC.1/>
421 </makedeps>
422 </then>
423 </if>
424
425 <OnDependency>
426 <sourcefiles>
427 <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
428 </sourcefiles>
429 <targetfiles>
430 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
431 </targetfiles>
432
433 <sequential>
434 <cc userdefine="on">
435 <command type="PP" cmd="${PP}" workdir="${DEST_DIR_OUTPUT}/@{FILEPATH}" family="${PP_FAMILY}" dpath="${PP_DPATH}">
436 <EXTRA.INC.1/>
437 <argument value="${PP_FLAGS}"/>
438 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
439 </command>
440 </cc>
441
442 <cc userdefine="on">
443 <command type="ASM" cmd="${ASM}" workdir="${DEST_DIR_OUTPUT}" family="${ASM_FAMILY}"
444 includepathDelimiter="-I" outputDelimiter="-o" dpath="${ASM_DPATH}"
445 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">
446 <EXTRA.INC.1/>
447 <argument value="${ASM_FLAGS}"/>
448 <EXTRA.ARG.1/>
449 <fileset casesensitive="on" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"/>
450 </command>
451 </cc>
452 </sequential>
453 </OnDependency>
454 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->
455 <if>
456 <equals arg1="@{FILEPATH}" arg2="." />
457 <then>
458 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}.obj" />
459 </then>
460 <else>
461 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}.obj" />
462 </else>
463 </if>
464 </sequential>
465 </macrodef>
466
467
468 <macrodef name="Build_IPF_PP_Code">
469 <attribute name="FILEPATH"/>
470 <attribute name="FILENAME"/>
471 <attribute name="FILEEXT" default="i"/>
472
473 <element name="EXTRA.INC" optional="yes"/>
474 <element name="EXTRA.ARG" optional="yes"/>
475
476 <sequential>
477 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
478
479 <cc userdefine="on">
480 <command type="ASM" includepathDelimiter="-I" dpath="${ASM_DPATH}">
481 <includepath path="${WORKSPACE_DIR}"/>
482 <includepath path="${MODULE_DIR}"/>
483 <includepath path="${MODULE_DIR}/${ARCH}"/>
484 <EXTRA.INC/>
485
486 <argument value="${ASM_FLAGS}"/>
487 <EXTRA.ARG/>
488 <OutputFile File="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
489
490 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
491 </command>
492 </cc>
493 </sequential>
494 </macrodef>
495
496
497 <!--
498 Library private HashMap map = new HashMap();
499 -->
500 <macrodef name="Build_Library">
501 <attribute name="FILENAME" />
502 <attribute name="FILEEXT" default="obj"/>
503
504 <sequential>
505 <var name="FILE_BASENAME" value="@{FILENAME}" />
506 <var name="FILE_PATH" value="." />
507 <if>
508 <available type="file" file="${DEST_DIR_OUTPUT}/AutoGen.h.obj"/>
509 <then>
510 <var name="SLINK_FLAGS" value="${SLINK_FLAGS} ${DEST_DIR_OUTPUT}/AutoGen.h.obj"/>
511 </then>
512 </if>
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 <if>
757 <available type="file" file="${DEST_DIR_OUTPUT}/AutoGen.h.obj"/>
758 <then>
759 <var name="SLINK_FLAGS" value="${SLINK_FLAGS} ${DEST_DIR_OUTPUT}/AutoGen.h.obj"/>
760 </then>
761 </if>
762 <OnDependency>
763 <sourcefiles>
764 <file list="${LIBS}"/>
765 <fileset dir="${DEST_DIR_OUTPUT}" includes="${OBJECTS}" />
766 </sourcefiles>
767 <targetfiles>
768 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll"/>
769 </targetfiles>
770
771 <sequential>
772 <cc userdefine="on">
773 <command type="SLINK" cmd="${SLINK}" family="${SLINK_FAMILY}" dpath="${SLINK_DPATH}"
774 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib">
775 <argument value="${SLINK_FLAGS}"/>
776
777 <fileset dir="${DEST_DIR_OUTPUT}" includes="${OBJECTS}"/>
778 </command>
779 </cc>
780 <cc userdefine="on">
781 <command type="DLINK" cmd="${DLINK}" family="${DLINK_FAMILY}"
782 outputFile="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll" dpath="${DLINK_DPATH}" >
783 <argument value="${DLINK_FLAGS}"/>
784 <libset libs="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib ${LIBS} ${DLINK_SPATH}"/>
785 <LINK.ARG/>
786 </command>
787 </cc>
788 </sequential>
789 </OnDependency>
790 </sequential>
791 </macrodef>
792
793 <!--
794 EFI
795 -->
796 <macrodef name="GenEfi">
797 <attribute name="FILEPATH"/>
798 <attribute name="FILENAME"/>
799 <attribute name="FILEEXT" default="dll"/>
800
801 <sequential>
802 <OnDependency>
803 <sourcefiles>
804 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
805 </sourcefiles>
806 <targetfiles>
807 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>
808 </targetfiles>
809
810 <sequential>
811 <fwimage componentType="${MODULE_TYPE}" outImage="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"
812 peImage="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" time="0"/>
813 </sequential>
814 </OnDependency>
815 </sequential>
816 </macrodef>
817
818 <!--
819 EFI_SECTION_FREEFORM_SUBTYPE_GUID
820 EFI_SECTION_VERSION
821 EFI_SECTION_USER_INTERFACE
822 EFI_SECTION_DXE_DEPEX
823 EFI_SECTION_PEI_DEPEX
824 EFI_SECTION_PE32
825 EFI_SECTION_PIC
826 EFI_SECTION_TE
827 EFI_SECTION_RAW
828 EFI_SECTION_COMPRESSION
829 EFI_SECTION_GUID_DEFINED
830 EFI_SECTION_COMPATIBILITY16
831 EFI_SECTION_FIRMWARE_VOLUME_IMAGE
832 -->
833 <!--
834 EFI_SECTION_PE32
835 -->
836
837 <macrodef name="EFI_SECTION_TE">
838 <attribute name="FILEPATH"/>
839 <attribute name="FILENAME"/>
840 <attribute name="FILEEXT" default="" />
841
842 <element name="PRE.PROCESS" optional="yes"/>
843 <element name="POST.PROCESS" optional="yes"/>
844
845 <sequential>
846 <PRE.PROCESS/>
847 <if>
848 <not>
849 <equals arg1="${LIBS}" arg2=""/>
850 </not>
851
852 <then>
853 <GenDll FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="">
854 <LIB.ARG></LIB.ARG>
855 <LINK.ARG></LINK.ARG>
856 </GenDll>
857
858 <GenEfi FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="dll"/>
859 </then>
860 </if>
861
862 <OnDependency>
863 <sourcefiles>
864 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>
865 </sourcefiles>
866 <targetfiles>
867 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.tes"/>
868 </targetfiles>
869
870 <sequential>
871 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${BIN_DIR}/@{FILENAME}.efi" />
872 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${DEST_DIR_DEBUG}/@{FILENAME}.efi" />
873 <genteimage Dump="false" Verbose="false" OutputDir="" OutputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.te" InputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>
874 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.te"
875 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.tes"
876 sectiontype="EFI_SECTION_TE"/>
877 <POST.PROCESS/>
878 </sequential>
879 </OnDependency>
880 </sequential>
881 </macrodef>
882
883 <macrodef name="EFI_SECTION_PE32">
884 <attribute name="FILEPATH"/>
885 <attribute name="FILENAME"/>
886 <attribute name="FILEEXT" default="" />
887
888 <element name="PRE.PROCESS" optional="yes"/>
889 <element name="POST.PROCESS" optional="yes"/>
890
891 <sequential>
892 <PRE.PROCESS/>
893 <if>
894 <not>
895 <!-- TBD ${OBJECTS} -->
896 <equals arg1="${LIBS}" arg2=""/>
897 </not>
898
899 <then>
900 <GenDll FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="">
901 <LIB.ARG></LIB.ARG>
902 <LINK.ARG></LINK.ARG>
903 </GenDll>
904
905 <GenEfi FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="dll"/>
906 </then>
907 </if>
908
909 <OnDependency>
910 <sourcefiles>
911 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>
912 </sourcefiles>
913 <targetfiles>
914 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32"/>
915 </targetfiles>
916
917 <sequential>
918 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${BIN_DIR}/@{FILENAME}.efi" />
919 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${DEST_DIR_DEBUG}/@{FILENAME}.efi" />
920 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"
921 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32"
922 sectiontype="EFI_SECTION_PE32"/>
923
924 <POST.PROCESS/>
925 </sequential>
926 </OnDependency>
927 </sequential>
928 </macrodef>
929
930 <!--
931 EFI_SECTION_VERSION
932 -->
933 <macrodef name="EFI_SECTION_VERSION">
934 <attribute name="FILEPATH"/>
935 <attribute name="FILENAME"/>
936 <attribute name="FILEEXT" default="" />
937 <attribute name="VERSION" default="0000"/>
938
939 <element name="PRE.PROCESS" optional="yes"/>
940 <element name="POST.PROCESS" optional="yes"/>
941
942 <sequential>
943 <if>
944 <not>
945 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver"/>
946 </not>
947
948 <then>
949 <PRE.PROCESS/>
950 <gensection outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver"
951 versionnum="@{VERSION}"
952 sectiontype="EFI_SECTION_VERSION"/>
953 <POST.PROCESS/>
954 </then>
955 </if>
956 </sequential>
957 </macrodef>
958
959 <!--
960 EFI_SECTION_USER_INTERFACE
961 -->
962 <macrodef name="EFI_SECTION_USER_INTERFACE">
963 <attribute name="FILEPATH"/>
964 <attribute name="FILENAME"/>
965 <attribute name="FILEEXT" default="" />
966 <attribute name="UI" default="${BASE_NAME}"/>
967
968 <element name="PRE.PROCESS" optional="yes"/>
969 <element name="POST.PROCESS" optional="yes"/>
970
971 <sequential>
972 <if>
973 <not>
974 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui"/>
975 </not>
976
977 <then>
978 <PRE.PROCESS/>
979 <gensection interfacestring="@{UI}"
980 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui"
981 sectiontype="EFI_SECTION_USER_INTERFACE"/>
982 <POST.PROCESS/>
983 </then>
984 </if>
985 </sequential>
986 </macrodef>
987
988 <!--
989 EFI_SECTION_DXE_DEPEX
990 -->
991 <macrodef name="EFI_SECTION_DXE_DEPEX">
992 <attribute name="FILEPATH"/>
993 <attribute name="FILENAME"/>
994 <attribute name="FILEEXT" default="dxs"/>
995
996 <element name="PRE.PROCESS" optional="yes"/>
997 <element name="POST.PROCESS" optional="yes"/>
998
999 <sequential>
1000 <PRE.PROCESS/>
1001
1002 <if>
1003 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>
1004 <then>
1005 <OnDependency>
1006 <sourcefiles>
1007 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>
1008 </sourcefiles>
1009 <targetfiles>
1010 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>
1011 </targetfiles>
1012 <sequential>
1013 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"
1014 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"
1015 sectiontype="EFI_SECTION_DXE_DEPEX"/>
1016 </sequential>
1017 </OnDependency>
1018 </then>
1019 <else>
1020 <if>
1021 <not>
1022 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>
1023 </not>
1024 <then>
1025 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>
1026 </then>
1027 </if>
1028 </else>
1029 </if>
1030
1031 <POST.PROCESS/>
1032 </sequential>
1033 </macrodef>
1034
1035 <!--
1036 EFI_SECTION_PEI_DEPEX
1037 -->
1038 <macrodef name="EFI_SECTION_PEI_DEPEX">
1039 <attribute name="FILEPATH"/>
1040 <attribute name="FILENAME"/>
1041 <attribute name="FILEEXT" default="dxs"/>
1042
1043 <element name="PRE.PROCESS" optional="yes"/>
1044 <element name="POST.PROCESS" optional="yes"/>
1045 <sequential>
1046 <PRE.PROCESS/>
1047 <if>
1048 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>
1049 <then>
1050 <OnDependency>
1051 <sourcefiles>
1052 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>
1053 </sourcefiles>
1054 <targetfiles>
1055 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>
1056 </targetfiles>
1057
1058 <sequential>
1059 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"
1060 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"
1061 sectiontype="EFI_SECTION_PEI_DEPEX"/>
1062 </sequential>
1063 </OnDependency>
1064
1065 </then>
1066 <else>
1067 <if>
1068 <not>
1069 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>
1070 </not>
1071 <then>
1072 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>
1073 </then>
1074 </if>
1075 </else>
1076 </if>
1077 <POST.PROCESS/>
1078 </sequential>
1079 </macrodef>
1080
1081
1082 <!--
1083 EFI_SECTION_RAW
1084 -->
1085 <macrodef name="EFI_SECTION_RAW">
1086 <attribute name="FILEPATH"/>
1087 <attribute name="FILENAME"/>
1088 <attribute name="FILEEXT" default="bin"/>
1089
1090 <element name="PRE.PROCESS" optional="yes"/>
1091 <element name="POST.PROCESS" optional="yes"/>
1092
1093 <sequential>
1094 <OnDependency>
1095 <sourcefiles>
1096 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}"/>
1097 </sourcefiles>
1098 <targetfiles>
1099 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>
1100 </targetfiles>
1101
1102 <sequential>
1103 <PRE.PROCESS/>
1104 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}"
1105 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"
1106 sectiontype="EFI_SECTION_RAW"/>
1107 <POST.PROCESS/>
1108 </sequential>
1109 </OnDependency>
1110 </sequential>
1111 </macrodef>
1112
1113 <!--
1114 EFI_SECTION_FIRMWARE_VOLUME_IMAGE
1115 -->
1116 <macrodef name="EFI_SECTION_FIRMWARE_VOLUME_IMAGE">
1117 <attribute name="FILEPATH"/>
1118 <attribute name="FILENAME"/>
1119 <attribute name="FILEEXT" default="fv"/>
1120
1121 <element name="PRE.PROCESS" optional="yes"/>
1122 <element name="POST.PROCESS" optional="yes"/>
1123
1124 <sequential>
1125 <OnDependency>
1126 <sourcefiles>
1127 <file name="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
1128 </sourcefiles>
1129 <targetfiles>
1130 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec"/>
1131 </targetfiles>
1132
1133 <sequential>
1134 <PRE.PROCESS/>
1135
1136 <copy file="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"
1137 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"
1138 overwrite="true"/>
1139 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"
1140 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec"
1141 sectiontype="EFI_SECTION_FIRMWARE_VOLUME_IMAGE"/>
1142
1143 <POST.PROCESS/>
1144 </sequential>
1145 </OnDependency>
1146 </sequential>
1147 </macrodef>
1148
1149 <!--
1150 Binary
1151 -->
1152 <macrodef name="Build_Binary">
1153 <attribute name="FILEPATH"/>
1154 <attribute name="FILENAME"/>
1155 <attribute name="FILEEXT" default="bin"/>
1156
1157 <element name="EXTRA.INC" optional="yes"/>
1158 <element name="EXTRA.ARG" optional="yes"/>
1159
1160 <sequential>
1161 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"
1162 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.bin"/>
1163 </sequential>
1164 </macrodef>
1165 <!--
1166 Microcode
1167 -->
1168 <macrodef name="Build_MICROCODE">
1169 <attribute name="FILEPATH"/>
1170 <attribute name="FILENAME"/>
1171 <attribute name="FILEEXT" default="TXT"/>
1172
1173 <element name="EXTRA.INC" optional="yes"/>
1174 <element name="EXTRA.ARG" optional="yes"/>
1175
1176 <sequential>
1177 <mkdir dir="${TARGET_DIR}/Microcode"/>
1178 <flashmap MCIFile="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" MCOFILE="${TARGET_DIR}/Microcode/@{FILENAME}.bin"/>
1179 </sequential>
1180 </macrodef>
1181
1182 <!--
1183 Graphics (bmp, ...)
1184 -->
1185 <macrodef name="Build_Graphics">
1186 <attribute name="FILEPATH"/>
1187 <attribute name="FILENAME"/>
1188 <attribute name="FILEEXT" default="bmp"/>
1189
1190 <element name="EXTRA.INC" optional="yes"/>
1191 <element name="EXTRA.ARG" optional="yes"/>
1192
1193 <sequential>
1194 <mkdir dir="${MODULE_DIR}/@{FILEPATH}" />
1195 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"
1196 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.bin"/>
1197 </sequential>
1198 </macrodef>
1199 <macrodef name="Build_EFI">
1200 <attribute name="FILEPATH"/>
1201 <attribute name="FILENAME"/>
1202 <attribute name="FILEEXT" default="efi"/>
1203
1204 <element name="EXTRA.INC" optional="yes"/>
1205 <element name="EXTRA.ARG" optional="yes"/>
1206
1207 <sequential>
1208 <mkdir dir="${MODULE_DIR}/@{FILEPATH}" />
1209 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"
1210 tofile="${DEST_DIR_OUTPUT}/${BASE_NAME}.efi"/>
1211 </sequential>
1212 </macrodef>
1213 </project>