Add one more platform level common property "TARGET_DIR". Take Nt32 for example:...
[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 <EXTRA.INC.1/>
395 </makedeps>
396 </then>
397 </if>
398
399 <OnDependency>
400 <sourcefiles>
401 <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
402 </sourcefiles>
403 <targetfiles>
404 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
405 </targetfiles>
406
407 <sequential>
408 <cc userdefine="on">
409 <command type="PP" cmd="${PP}" workdir="${DEST_DIR_OUTPUT}/@{FILEPATH}" family="${PP_FAMILY}">
410 <EXTRA.INC.1/>
411 <argument value="${PP_FLAGS}"/>
412 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
413 </command>
414 </cc>
415
416 <cc userdefine="on">
417 <command type="ASM" cmd="${ASM}" workdir="${DEST_DIR_OUTPUT}" family="${ASM_FAMILY}"
418 includepathDelimiter="-I" outputDelimiter="-o"
419 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">
420 <EXTRA.INC.1/>
421 <argument value="${ASM_FLAGS}"/>
422 <EXTRA.ARG.1/>
423 <fileset casesensitive="on" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"/>
424 </command>
425 </cc>
426 </sequential>
427 </OnDependency>
428 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->
429 <if>
430 <equals arg1="@{FILEPATH}" arg2="." />
431 <then>
432 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}.obj" />
433 </then>
434 <else>
435 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}.obj" />
436 </else>
437 </if>
438 </sequential>
439 </macrodef>
440
441
442 <macrodef name="Build_IPF_PP_Code">
443 <attribute name="FILEPATH"/>
444 <attribute name="FILENAME"/>
445 <attribute name="FILEEXT" default="i"/>
446
447 <element name="EXTRA.INC" optional="yes"/>
448 <element name="EXTRA.ARG" optional="yes"/>
449
450 <sequential>
451 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
452
453 <cc userdefine="on">
454 <command type="ASM" includepathDelimiter="-I">
455 <includepath path="${WORKSPACE_DIR}"/>
456 <includepath path="${MODULE_DIR}"/>
457 <includepath path="${MODULE_DIR}/${ARCH}"/>
458 <EXTRA.INC/>
459
460 <argument value="${ASM_FLAGS}"/>
461 <EXTRA.ARG/>
462 <OutputFile File="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
463
464 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
465 </command>
466 </cc>
467 </sequential>
468 </macrodef>
469
470
471 <!--
472 Library private HashMap map = new HashMap();
473 -->
474 <macrodef name="Build_Library">
475 <attribute name="FILENAME" />
476 <attribute name="FILEEXT" default="obj"/>
477
478 <sequential>
479 <var name="FILE_BASENAME" value="@{FILENAME}" />
480 <var name="FILE_PATH" value="." />
481 <mkdir dir="${BIN_DIR}"/>
482
483 <OnDependency>
484 <sourcefiles>
485 <fileset dir="${DEST_DIR_OUTPUT}" includes="${OBJECTS}" />
486 </sourcefiles>
487 <targetfiles>
488 <file name="${BIN_DIR}/@{FILENAME}.lib"/>
489 </targetfiles>
490
491 <sequential>
492 <cc userdefine="on">
493 <command type="SLINK" cmd="${SLINK}" family="${SLINK_FAMILY}"
494 outputFile="${BIN_DIR}/@{FILENAME}.lib">
495 <argument value="${SLINK_FLAGS}"/>
496
497 <fileset dir="${DEST_DIR_OUTPUT}" includes="${OBJECTS}"/>
498 </command>
499 </cc>
500 </sequential>
501 </OnDependency>
502 </sequential>
503 </macrodef>
504
505 <!--
506 Unicode -> .sdb
507 -->
508 <macrodef name="Build_UNI">
509 <attribute name="FILEPATH"/>
510 <attribute name="FILENAME"/>
511 <attribute name="FILEEXT" default="uni"/>
512
513 <element name="EXTRA.INC" optional="yes"/>
514 <element name="EXTRA.ARG" optional="yes"/>
515
516 <sequential>
517 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
518
519 <OnDependency>
520 <sourcefiles>
521 <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
522 </sourcefiles>
523 <targetfiles>
524 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>
525 </targetfiles>
526
527 <sequential>
528 <strgather commandtype="parse" newdatabase="true">
529 <database name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>
530 <EXTRA.INC/>
531 <EXTRA.ARG/>
532 <inputfile name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
533 </strgather>
534 </sequential>
535 </OnDependency>
536
537 <var name="SDB_FILES" value="${SDB_FILES}, ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>
538 </sequential>
539 </macrodef>
540
541 <!--
542 .sdb(s) -> .c, .h -> .obj
543 -->
544 <macrodef name="Build_Unicode_Database">
545 <attribute name="FILEPATH"/>
546 <attribute name="FILENAME"/>
547 <attribute name="FILEEXT" default="sdb"/>
548
549 <element name="EXTRA.INC" optional="yes"/>
550 <element name="EXTRA.ARG" optional="yes"/>
551
552 <sequential>
553 <var name="FILE_BASENAME" value="@{FILENAME}" />
554 <var name="FILE_PATH" value="@{FILEPATH}" />
555 <OnDependency>
556 <sourcefiles>
557 <file list="${SDB_FILES}"/>
558 <file list="${SOURCE_FILES}"/>
559 </sourcefiles>
560 <targetfiles>
561 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>
562 </targetfiles>
563
564 <sequential>
565 <strgather commandtype="scan" outputdatabase="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb" verbose="read">
566 <skipext name=".uni"/>
567 <skipext name=".h"/>
568 <database list="${SDB_FILES}"/>
569 <inputfile name="${SOURCE_FILES}"/>
570 </strgather>
571 </sequential>
572 </OnDependency>
573
574 <OnDependency>
575 <sourcefiles>
576 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>
577 </sourcefiles>
578 <targetfiles>
579 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}StrDefs.h"/>
580 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.hpk"/>
581 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c"/>
582 </targetfiles>
583
584 <sequential>
585 <strgather basename="@{FILENAME}Strings" commandtype="dump"
586 outputdefines="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}StrDefs.h"
587 outputhpk="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.hpk"
588 outputstring="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c">
589 <database name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>
590 </strgather>
591 </sequential>
592 </OnDependency>
593
594 <OnDependency>
595 <sourcefiles>
596 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c"/>
597 </sourcefiles>
598 <targetfiles>
599 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Strings.obj"/>
600 </targetfiles>
601
602 <sequential>
603 <!-- Use pre-compiled header if available -->
604 <if>
605 <and>
606 <equals arg1="${CC_FAMILY}" arg2="MSFT" casesensitive="false"/>
607 <available file="${DEST_DIR_DEBUG}/AutoGen.pch"/>
608 </and>
609 <then>
610 <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"/>
611 </then>
612 <else>
613 <var name="LOCAL_CC_FLAGS" value="${CC_FLAGS}"/>
614 </else>
615 </if>
616
617 <cc userdefine="on">
618 <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" family="${CC_FAMILY}"
619 includepathDelimiter="-I"
620 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Strings.obj">
621 <argument value="${LOCAL_CC_FLAGS}"/>
622 <EXTRA.INC />
623 <fileset casesensitive="on" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c"/>
624 </command>
625 </cc>
626 </sequential>
627 </OnDependency>
628
629 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->
630 <if>
631 <equals arg1="@{FILEPATH}" arg2="." />
632 <then>
633 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}Strings.obj" />
634 </then>
635 <else>
636 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}Strings.obj" />
637 </else>
638 </if>
639 </sequential>
640 </macrodef>
641
642 <!--
643 Vfr
644 -->
645 <macrodef name="Build_VFR">
646 <attribute name="FILEPATH"/>
647 <attribute name="FILENAME"/>
648 <attribute name="FILEEXT" default="vfr"/>
649
650 <element name="EXTRA.INC" optional="yes"/>
651 <element name="EXTRA.ARG" optional="yes"/>
652
653 <sequential>
654 <mkdir dir="${DEST_DIR_DEBUG}/@{FILEPATH}"/>
655
656 <if>
657 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
658 <then>
659 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">
660 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
661 <EXTRA.INC/>
662 </makedeps>
663 </then>
664 </if>
665
666 <OnDependency>
667 <sourcefiles>
668 <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
669 </sourcefiles>
670 <targetfiles>
671 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
672 </targetfiles>
673
674 <sequential>
675 <vfrcompile createIfrBinFile="on" createListFile="on" outPutDir="${DEST_DIR_DEBUG}/@{FILEPATH}" vfrFile="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}">
676 <EXTRA.INC/>
677 </vfrcompile>
678
679 <!-- Use pre-compiled header if available -->
680 <if>
681 <and>
682 <equals arg1="${CC_FAMILY}" arg2="MSFT" casesensitive="false"/>
683 <available file="${DEST_DIR_DEBUG}/AutoGen.pch"/>
684 </and>
685 <then>
686 <var name="LOCAL_CC_FLAGS" value="${CC_FLAGS} /Yu${DEST_DIR_DEBUG}/AutoGen.h /Fp${DEST_DIR_DEBUG}/AutoGen.pch"/>
687 </then>
688 <else>
689 <var name="LOCAL_CC_FLAGS" value="${CC_FLAGS}"/>
690 </else>
691 </if>
692
693 <cc userdefine="on">
694 <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}"
695 includepathDelimiter="-I" family="${CC_FAMILY}"
696 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" >
697 <argument value="${LOCAL_CC_FLAGS}"/>
698 <EXTRA.INC/>
699 <EXTRA.ARG/>
700 <fileset casesensitive="on" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.c"/>
701 </command>
702 </cc>
703 </sequential>
704 </OnDependency>
705 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->
706 <if>
707 <equals arg1="@{FILEPATH}" arg2="." />
708 <then>
709 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}.obj" />
710 </then>
711 <else>
712 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}.obj" />
713 </else>
714 </if>
715 </sequential>
716 </macrodef>
717
718 <!--
719 DUMMY
720 -->
721 <macrodef name="Build_DUMMY">
722 <attribute name="FILEPATH"/>
723 <attribute name="FILENAME"/>
724 <attribute name="FILEEXT"/>
725
726 <element name="EXTRA.INC" optional="yes"/>
727 <element name="EXTRA.ARG" optional="yes"/>
728
729 <sequential>
730 <echo message="Ignoring ${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
731 </sequential>
732 </macrodef>
733
734 <!--############################################################################
735 Build Sections
736 #############################################################################-->
737 <!--
738 DLL
739 -->
740 <macrodef name="GenDll">
741 <attribute name="FILEPATH"/>
742 <attribute name="FILENAME"/>
743 <attribute name="FILEEXT"/>
744
745 <element name="LIB.ARG" optional="yes"/>
746 <element name="LINK.ARG" optional="yes"/>
747
748 <sequential>
749 <var name="FILE_BASENAME" value="@{FILENAME}" />
750 <var name="FILE_PATH" value="@{FILEPATH}" />
751 <OnDependency>
752 <sourcefiles>
753 <file list="${LIBS}"/>
754 <fileset dir="${DEST_DIR_OUTPUT}" includes="${OBJECTS}" />
755 </sourcefiles>
756 <targetfiles>
757 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll"/>
758 </targetfiles>
759
760 <sequential>
761 <cc userdefine="on">
762 <command type="SLINK" cmd="${SLINK}" family="${SLINK_FAMILY}"
763 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib">
764 <argument value="${SLINK_FLAGS}"/>
765
766 <fileset dir="${DEST_DIR_OUTPUT}" includes="${OBJECTS}"/>
767 </command>
768 </cc>
769 <cc userdefine="on">
770 <command type="DLINK" cmd="${DLINK}" family="${DLINK_FAMILY}"
771 outputFile="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll" >
772 <argument value="${DLINK_FLAGS}"/>
773 <libset libs="${LIBS}"/>
774 <libset libs="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib"/>
775 <libset libs="${DLINK_SPATH}" />
776 <LINK.ARG/>
777 </command>
778 </cc>
779 </sequential>
780 </OnDependency>
781 </sequential>
782 </macrodef>
783
784 <!--
785 EFI
786 -->
787 <macrodef name="GenEfi">
788 <attribute name="FILEPATH"/>
789 <attribute name="FILENAME"/>
790 <attribute name="FILEEXT" default="dll"/>
791
792 <sequential>
793 <OnDependency>
794 <sourcefiles>
795 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
796 </sourcefiles>
797 <targetfiles>
798 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>
799 </targetfiles>
800
801 <sequential>
802 <fwimage componentType="${MODULE_TYPE}" outImage="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"
803 peImage="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" time="0"/>
804 </sequential>
805 </OnDependency>
806 </sequential>
807 </macrodef>
808
809 <!--
810 EFI_SECTION_FREEFORM_SUBTYPE_GUID
811 EFI_SECTION_VERSION
812 EFI_SECTION_USER_INTERFACE
813 EFI_SECTION_DXE_DEPEX
814 EFI_SECTION_PEI_DEPEX
815 EFI_SECTION_PE32
816 EFI_SECTION_PIC
817 EFI_SECTION_TE
818 EFI_SECTION_RAW
819 EFI_SECTION_COMPRESSION
820 EFI_SECTION_GUID_DEFINED
821 EFI_SECTION_COMPATIBILITY16
822 EFI_SECTION_FIRMWARE_VOLUME_IMAGE
823 -->
824 <!--
825 EFI_SECTION_PE32
826 -->
827
828 <macrodef name="EFI_SECTION_TE">
829 <attribute name="FILEPATH"/>
830 <attribute name="FILENAME"/>
831 <attribute name="FILEEXT" default="" />
832
833 <element name="PRE.PROCESS" optional="yes"/>
834 <element name="POST.PROCESS" optional="yes"/>
835
836 <sequential>
837 <PRE.PROCESS/>
838 <if>
839 <not>
840 <equals arg1="${LIBS}" arg2=""/>
841 </not>
842
843 <then>
844 <GenDll FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="">
845 <LIB.ARG></LIB.ARG>
846 <LINK.ARG></LINK.ARG>
847 </GenDll>
848
849 <GenEfi FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="dll"/>
850 </then>
851 </if>
852
853 <OnDependency>
854 <sourcefiles>
855 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>
856 </sourcefiles>
857 <targetfiles>
858 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.tes"/>
859 </targetfiles>
860
861 <sequential>
862 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${BIN_DIR}/@{FILENAME}.efi" />
863 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${DEST_DIR_DEBUG}/@{FILENAME}.efi" />
864 <genteimage Dump="false" Verbose="false" OutputDir="" OutputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.te" InputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>
865 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.te" tofile="${BIN_DIR}/@{FILENAME}.te" />
866 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.te"
867 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.tes"
868 sectiontype="EFI_SECTION_TE"/>
869 <POST.PROCESS/>
870 </sequential>
871 </OnDependency>
872 </sequential>
873 </macrodef>
874
875 <macrodef name="EFI_SECTION_PE32">
876 <attribute name="FILEPATH"/>
877 <attribute name="FILENAME"/>
878 <attribute name="FILEEXT" default="" />
879
880 <element name="PRE.PROCESS" optional="yes"/>
881 <element name="POST.PROCESS" optional="yes"/>
882
883 <sequential>
884 <PRE.PROCESS/>
885 <if>
886 <not>
887 <!-- TBD ${OBJECTS} -->
888 <equals arg1="${LIBS}" arg2=""/>
889 </not>
890
891 <then>
892 <GenDll FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="">
893 <LIB.ARG></LIB.ARG>
894 <LINK.ARG></LINK.ARG>
895 </GenDll>
896
897 <GenEfi FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="dll"/>
898 </then>
899 </if>
900
901 <OnDependency>
902 <sourcefiles>
903 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>
904 </sourcefiles>
905 <targetfiles>
906 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32"/>
907 </targetfiles>
908
909 <sequential>
910 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${BIN_DIR}/@{FILENAME}.efi" />
911
912 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"
913 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32"
914 sectiontype="EFI_SECTION_PE32"/>
915
916 <POST.PROCESS/>
917 </sequential>
918 </OnDependency>
919 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${DEST_DIR_DEBUG}/@{FILENAME}.efi" />
920 </sequential>
921 </macrodef>
922
923 <!--
924 EFI_SECTION_VERSION
925 -->
926 <macrodef name="EFI_SECTION_VERSION">
927 <attribute name="FILEPATH"/>
928 <attribute name="FILENAME"/>
929 <attribute name="FILEEXT" default="" />
930 <attribute name="VERSION" default="0000"/>
931
932 <element name="PRE.PROCESS" optional="yes"/>
933 <element name="POST.PROCESS" optional="yes"/>
934
935 <sequential>
936 <if>
937 <not>
938 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver"/>
939 </not>
940
941 <then>
942 <PRE.PROCESS/>
943 <gensection outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver"
944 versionnum="@{VERSION}"
945 sectiontype="EFI_SECTION_VERSION"/>
946 <POST.PROCESS/>
947 </then>
948 </if>
949 </sequential>
950 </macrodef>
951
952 <!--
953 EFI_SECTION_USER_INTERFACE
954 -->
955 <macrodef name="EFI_SECTION_USER_INTERFACE">
956 <attribute name="FILEPATH"/>
957 <attribute name="FILENAME"/>
958 <attribute name="FILEEXT" default="" />
959 <attribute name="UI" default="${BASE_NAME}"/>
960
961 <element name="PRE.PROCESS" optional="yes"/>
962 <element name="POST.PROCESS" optional="yes"/>
963
964 <sequential>
965 <if>
966 <not>
967 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui"/>
968 </not>
969
970 <then>
971 <PRE.PROCESS/>
972 <gensection interfacestring="@{UI}"
973 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui"
974 sectiontype="EFI_SECTION_USER_INTERFACE"/>
975 <POST.PROCESS/>
976 </then>
977 </if>
978 </sequential>
979 </macrodef>
980
981 <!--
982 EFI_SECTION_DXE_DEPEX
983 -->
984 <macrodef name="EFI_SECTION_DXE_DEPEX">
985 <attribute name="FILEPATH"/>
986 <attribute name="FILENAME"/>
987 <attribute name="FILEEXT" default="dxs"/>
988
989 <element name="PRE.PROCESS" optional="yes"/>
990 <element name="POST.PROCESS" optional="yes"/>
991
992 <sequential>
993 <PRE.PROCESS/>
994
995 <if>
996 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>
997 <then>
998 <OnDependency>
999 <sourcefiles>
1000 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>
1001 </sourcefiles>
1002 <targetfiles>
1003 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>
1004 </targetfiles>
1005 <sequential>
1006 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"
1007 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"
1008 sectiontype="EFI_SECTION_DXE_DEPEX"/>
1009 </sequential>
1010 </OnDependency>
1011 </then>
1012 <else>
1013 <if>
1014 <not>
1015 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>
1016 </not>
1017 <then>
1018 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>
1019 </then>
1020 </if>
1021 </else>
1022 </if>
1023
1024 <POST.PROCESS/>
1025 </sequential>
1026 </macrodef>
1027
1028 <!--
1029 EFI_SECTION_PEI_DEPEX
1030 -->
1031 <macrodef name="EFI_SECTION_PEI_DEPEX">
1032 <attribute name="FILEPATH"/>
1033 <attribute name="FILENAME"/>
1034 <attribute name="FILEEXT" default="dxs"/>
1035
1036 <element name="PRE.PROCESS" optional="yes"/>
1037 <element name="POST.PROCESS" optional="yes"/>
1038 <sequential>
1039 <PRE.PROCESS/>
1040 <if>
1041 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>
1042 <then>
1043 <OnDependency>
1044 <sourcefiles>
1045 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>
1046 </sourcefiles>
1047 <targetfiles>
1048 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>
1049 </targetfiles>
1050
1051 <sequential>
1052 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"
1053 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"
1054 sectiontype="EFI_SECTION_PEI_DEPEX"/>
1055 </sequential>
1056 </OnDependency>
1057
1058 </then>
1059 <else>
1060 <if>
1061 <not>
1062 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>
1063 </not>
1064 <then>
1065 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>
1066 </then>
1067 </if>
1068 </else>
1069 </if>
1070 <POST.PROCESS/>
1071 </sequential>
1072 </macrodef>
1073
1074
1075 <!--
1076 EFI_SECTION_RAW
1077 -->
1078 <macrodef name="EFI_SECTION_RAW">
1079 <attribute name="FILEPATH"/>
1080 <attribute name="FILENAME"/>
1081 <attribute name="FILEEXT" default="bin"/>
1082
1083 <element name="PRE.PROCESS" optional="yes"/>
1084 <element name="POST.PROCESS" optional="yes"/>
1085
1086 <sequential>
1087 <OnDependency>
1088 <sourcefiles>
1089 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}"/>
1090 </sourcefiles>
1091 <targetfiles>
1092 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>
1093 </targetfiles>
1094
1095 <sequential>
1096 <PRE.PROCESS/>
1097 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}"
1098 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"
1099 sectiontype="EFI_SECTION_RAW"/>
1100 <POST.PROCESS/>
1101 </sequential>
1102 </OnDependency>
1103 </sequential>
1104 </macrodef>
1105
1106 <!--
1107 EFI_SECTION_FIRMWARE_VOLUME_IMAGE
1108 -->
1109 <macrodef name="EFI_SECTION_FIRMWARE_VOLUME_IMAGE">
1110 <attribute name="FILEPATH"/>
1111 <attribute name="FILENAME"/>
1112 <attribute name="FILEEXT" default="fv"/>
1113
1114 <element name="PRE.PROCESS" optional="yes"/>
1115 <element name="POST.PROCESS" optional="yes"/>
1116
1117 <sequential>
1118 <OnDependency>
1119 <sourcefiles>
1120 <file name="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
1121 </sourcefiles>
1122 <targetfiles>
1123 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec"/>
1124 </targetfiles>
1125
1126 <sequential>
1127 <PRE.PROCESS/>
1128
1129 <copy file="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"
1130 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"
1131 overwrite="true"/>
1132 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"
1133 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec"
1134 sectiontype="EFI_SECTION_FIRMWARE_VOLUME_IMAGE"/>
1135
1136 <POST.PROCESS/>
1137 </sequential>
1138 </OnDependency>
1139 </sequential>
1140 </macrodef>
1141
1142 <!--
1143 Binary
1144 -->
1145 <macrodef name="Build_Binary">
1146 <attribute name="FILEPATH"/>
1147 <attribute name="FILENAME"/>
1148 <attribute name="FILEEXT" default="bin"/>
1149
1150 <element name="EXTRA.INC" optional="yes"/>
1151 <element name="EXTRA.ARG" optional="yes"/>
1152
1153 <sequential>
1154 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"
1155 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.bin"/>
1156 </sequential>
1157 </macrodef>
1158 <!--
1159 Microcode
1160 -->
1161 <macrodef name="Build_MICROCODE">
1162 <attribute name="FILEPATH"/>
1163 <attribute name="FILENAME"/>
1164 <attribute name="FILEEXT" default="TXT"/>
1165
1166 <element name="EXTRA.INC" optional="yes"/>
1167 <element name="EXTRA.ARG" optional="yes"/>
1168
1169 <sequential>
1170 <mkdir dir="${TARGET_DIR}/Microcode"/>
1171 <flashmap MCIFile="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" MCOFILE="${TARGET_DIR}/Microcode/@{FILENAME}.bin"/>
1172 </sequential>
1173 </macrodef>
1174
1175 <!--
1176 Graphics (bmp, ...)
1177 -->
1178 <macrodef name="Build_Graphics">
1179 <attribute name="FILEPATH"/>
1180 <attribute name="FILENAME"/>
1181 <attribute name="FILEEXT" default="bmp"/>
1182
1183 <element name="EXTRA.INC" optional="yes"/>
1184 <element name="EXTRA.ARG" optional="yes"/>
1185
1186 <sequential>
1187 <mkdir dir="${MODULE_DIR}/@{FILEPATH}" />
1188 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"
1189 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.bin"/>
1190 </sequential>
1191 </macrodef>
1192 <macrodef name="Build_EFI">
1193 <attribute name="FILEPATH"/>
1194 <attribute name="FILENAME"/>
1195 <attribute name="FILEEXT" default="efi"/>
1196
1197 <element name="EXTRA.INC" optional="yes"/>
1198 <element name="EXTRA.ARG" optional="yes"/>
1199
1200 <sequential>
1201 <mkdir dir="${MODULE_DIR}/@{FILEPATH}" />
1202 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"
1203 tofile="${DEST_DIR_OUTPUT}/${BASE_NAME}.efi"/>
1204 </sequential>
1205 </macrodef>
1206 </project>