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