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