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