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