Fix a bug for regular expression using wrong module's file name which contains '\'.
[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 <pathconvert property="ModuleDirUnixName" targetos="unix">
287 <path path="${MODULE_DIR}"/>
288 <mapper>
289 <chainedmapper>
290 <filtermapper>
291 <replacestring from="\" to="/"/>
292 </filtermapper>
293 </chainedmapper>
294 </mapper>
295 </pathconvert>
296 <cc userdefine="on">
297 <command type="CC" workdir="${DEST_DIR_DEBUG}/@{FILEPATH}">
298 <includepath path="${WORKSPACE_DIR}"/>
299 <includepath path="${MODULE_DIR}"/>
300 <includepath path="${MODULE_DIR}/${ARCH}"/>
301 <EXTRA.INC/>
302 <argument value="${PP_FLAGS}"/>
303 <argument value="/FI${DEST_DIR_DEBUG}/AutoGen.h"/>
304 <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
305 </command>
306 </cc>
307 <replaceregexp file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"
308 match="^(#line +1 +.*@{FILEPATH}/@{FILENAME}\.@{FILEEXT}&quot;).+\1"
309 replace="; Source: ${ModuleDirUnixName}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"
310 flags="gs"/>
311 <replaceregexp file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"
312 match="^(#line .*)$"
313 replace="; \1"
314 byline="true"/>
315 <replaceregexp file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"
316 match="([^_a-zA-Z])0x([0-9a-fA-F]+)"
317 replace="\10\2h"
318 flags="g"
319 byline="true"/>
320 <move file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"
321 tofile="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
322 <cc userdefine="on">
323 <command type="ASM">
324 <includepath path="${WORKSPACE_DIR}"/>
325 <includepath path="${MODULE_DIR}"/>
326 <includepath path="${MODULE_DIR}/${ARCH}"/>
327 <EXTRA.INC/>
328
329 <argument value="${ASM_FLAGS}"/>
330 <EXTRA.ARG/>
331 <argument value="/Fl${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.lst"/>
332 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
333
334 <fileset casesensitive="off" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
335 </command>
336 </cc>
337 </sequential>
338 </OnDependency>
339 <!--
340 for library generation later
341 -->
342 <bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
343 </sequential>
344 </macrodef>
345
346 <!--
347 Library private HashMap map = new HashMap();
348 -->
349 <macrodef name="Build_Library">
350 <attribute name="FILENAME" />
351 <attribute name="FILEEXT" default="obj"/>
352
353 <element name="EXTRA.INC" optional="yes"/>
354 <element name="EXTRA.ARG" optional="yes"/>
355
356 <sequential>
357 <mkdir dir="${BIN_DIR}"/>
358
359 <OnDependency>
360 <sourcefiles>
361 <file list="${OBJECTS}"/>
362 </sourcefiles>
363 <targetfiles>
364 <file name="${BIN_DIR}/@{FILENAME}.lib"/>
365 </targetfiles>
366
367 <sequential>
368 <!-- <echo>re-generate library</echo> -->
369 <cc userdefine="on">
370 <command type="LIB">
371 <argument value="${LIB_FLAGS}"/>
372 <!--<argument value="${OBJECTS}"/>-->
373 <FileList dir="" files="${OBJECTS}"/>
374 <!-- <argument value="/out:${BIN_DIR}/@{FILENAME}.lib"/> -->
375 <OutputFile value="${BIN_DIR}/@{FILENAME}.lib"/>
376 </command>
377 </cc>
378 </sequential>
379 </OnDependency>
380 </sequential>
381 </macrodef>
382
383 <!--
384 GCC Assembly
385 -->
386 <macrodef name="Build_GCC_Assembly_Code">
387 <attribute name="FILEPATH"/>
388 <attribute name="FILENAME"/>
389 <attribute name="FILEEXT" default="S"/>
390
391 <element name="EXTRA.INC" optional="yes"/>
392 <element name="EXTRA.ARG" optional="yes"/>
393
394 <sequential>
395 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
396
397 <if>
398 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
399 <then>
400 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">
401 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
402 <includepath path="${WORKSPACE_DIR}"/>
403 <includepath path="${MODULE_DIR}"/>
404 <includepath path="${MODULE_DIR}/${ARCH}"/>
405 <EXTRA.INC/>
406 </makedeps>
407 </then>
408 </if>
409
410 <OnDependency>
411 <sourcefiles>
412 <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
413 </sourcefiles>
414 <targetfiles>
415 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
416 </targetfiles>
417
418 <sequential>
419
420 <cc userdefine="on">
421 <command type="ASM" includepathDelimiter="-I">
422 <EXTRA.INC/>
423
424 <argument value="${ASM_FLAGS}"/>
425 <EXTRA.ARG/>
426 <!-- <argument value="-o ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> -->
427 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
428
429 <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
430 </command>
431 </cc>
432 </sequential>
433 </OnDependency>
434 <!--
435 for library generation later
436 -->
437 <bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
438 </sequential>
439 </macrodef>
440
441 <!--
442 IPF Assembly
443 -->
444 <macrodef name="Build_IPF_Assembly_Code">
445 <attribute name="FILEPATH"/>
446 <attribute name="FILENAME"/>
447 <attribute name="FILEEXT" default="s"/>
448
449 <element name="EXTRA.INC" optional="yes"/>
450 <element name="EXTRA.ARG" optional="yes"/>
451
452 <sequential>
453 <mkdir dir="${DEST_DIR_DEBUG}/@{FILEPATH}"/>
454 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
455
456 <if>
457 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
458 <then>
459 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">
460 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
461 <includepath path="${WORKSPACE_DIR}"/>
462 <includepath path="${MODULE_DIR}"/>
463 <includepath path="${MODULE_DIR}/${ARCH}"/>
464 <EXTRA.INC/>
465 </makedeps>
466 </then>
467 </if>
468
469 <OnDependency>
470 <sourcefiles>
471 <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
472 </sourcefiles>
473 <targetfiles>
474 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
475 </targetfiles>
476
477 <sequential>
478 <cc userdefine="on">
479 <command type="CC" workdir="${DEST_DIR_DEBUG}/@{FILEPATH}">
480 <includepath path="${WORKSPACE_DIR}"/>
481 <includepath path="${MODULE_DIR}"/>
482 <includepath path="${MODULE_DIR}/${ARCH}"/>
483 <EXTRA.INC/>
484 <argument value="${PP_FLAGS}"/>
485 <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
486 </command>
487 </cc>
488 <move file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"
489 tofile="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.pro"/>
490 <cc userdefine="on">
491 <command type="ASM" includepathDelimiter="-I">
492 <includepath path="${WORKSPACE_DIR}"/>
493 <includepath path="${MODULE_DIR}"/>
494 <includepath path="${MODULE_DIR}/${ARCH}"/>
495 <EXTRA.INC/>
496
497 <argument value="${ASM_FLAGS}"/>
498 <EXTRA.ARG/>
499 <!-- <argument value="-o ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> -->
500 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
501
502 <fileset casesensitive="off" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.pro"/>
503 </command>
504 </cc>
505 </sequential>
506 </OnDependency>
507 <!--
508 for library generation later
509 -->
510 <bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
511 </sequential>
512 </macrodef>
513
514
515 <macrodef name="Build_IPF_PP_Code">
516 <attribute name="FILEPATH"/>
517 <attribute name="FILENAME"/>
518 <attribute name="FILEEXT" default="i"/>
519
520 <element name="EXTRA.INC" optional="yes"/>
521 <element name="EXTRA.ARG" optional="yes"/>
522
523 <sequential>
524 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
525
526 <cc userdefine="on">
527 <command type="ASM" includepathDelimiter="-I">
528 <includepath path="${WORKSPACE_DIR}"/>
529 <includepath path="${MODULE_DIR}"/>
530 <includepath path="${MODULE_DIR}/${ARCH}"/>
531 <EXTRA.INC/>
532
533 <argument value="${ASM_FLAGS}"/>
534 <EXTRA.ARG/>
535 <!-- <argument value="-o ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> -->
536 <OutputFile File="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
537
538 <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
539 </command>
540 </cc>
541
542 <!--
543 for library generation later
544 -->
545 <bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
546 </sequential>
547 </macrodef>
548
549 <!--
550 [Build.Ia32.Makefile,Build.Ipf.Makefile,Build.Ebc.Makefile]
551 [Build.Ia32.Custom_Makefile,Build.Ipf.Custom_Makefile,Build.Ebc.Custom_Makefile]
552 -->
553 <macrodef name="Build_Custom_Build">
554 <attribute name="FILEPATH"/>
555 <attribute name="FILENAME"/>
556 <attribute name="FILEEXT" default="c"/>
557
558 <element name="EXTRA.INC" optional="yes"/>
559 <element name="EXTRA.ARG" optional="yes"/>
560
561 <sequential>
562
563 </sequential>
564 </macrodef>
565
566 <!--
567 Unicode -> .sdb
568 -->
569 <macrodef name="Build_Unicode">
570 <attribute name="FILEPATH"/>
571 <attribute name="FILENAME"/>
572 <attribute name="FILEEXT" default="uni"/>
573
574 <element name="EXTRA.INC" optional="yes"/>
575 <element name="EXTRA.ARG" optional="yes"/>
576
577 <sequential>
578 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
579
580 <OnDependency>
581 <sourcefiles>
582 <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
583 </sourcefiles>
584 <targetfiles>
585 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>
586 </targetfiles>
587
588 <sequential>
589 <strgather commandtype="parse" newdatabase="true">
590 <database name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>
591 <includepath path="${WORKSPACE_DIR}"/>
592 <includepath path="${MODULE_DIR}"/>
593 <includepath path="${MODULE_DIR}/${ARCH}"/>
594 <EXTRA.INC/>
595 <EXTRA.ARG/>
596 <inputfile name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
597 </strgather>
598 </sequential>
599 </OnDependency>
600
601 <bl name="SDB_FILES" value="${SDB_FILES}, ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>
602 </sequential>
603 </macrodef>
604
605 <!--
606 .sdb(s) -> .c, .h -> .obj
607 -->
608 <macrodef name="Build_Unicode_Database">
609 <attribute name="FILEPATH"/>
610 <attribute name="FILENAME"/>
611 <attribute name="FILEEXT" default="sdb"/>
612
613 <element name="EXTRA.INC" optional="yes"/>
614 <element name="EXTRA.ARG" optional="yes"/>
615
616 <sequential>
617 <OnDependency>
618 <sourcefiles>
619 <file list="${SDB_FILES}"/>
620 <file list="${SOURCE_FILES}"/>
621 </sourcefiles>
622 <targetfiles>
623 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>
624 </targetfiles>
625
626 <sequential>
627 <strgather commandtype="scan" outputdatabase="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb" verbose="read">
628 <skipext name=".uni"/>
629 <skipext name=".h"/>
630 <database list="${SDB_FILES}"/>
631 <inputfile name="${SOURCE_FILES}"/>
632 </strgather>
633 </sequential>
634 </OnDependency>
635
636 <OnDependency>
637 <sourcefiles>
638 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>
639 </sourcefiles>
640 <targetfiles>
641 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}StrDefs.h"/>
642 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.hpk"/>
643 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c"/>
644 </targetfiles>
645
646 <sequential>
647 <strgather basename="@{FILENAME}Strings" commandtype="dump"
648 outputdefines="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}StrDefs.h"
649 outputhpk="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.hpk"
650 outputstring="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c">
651 <database name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>
652 </strgather>
653 </sequential>
654 </OnDependency>
655
656 <OnDependency>
657 <sourcefiles>
658 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c"/>
659 </sourcefiles>
660 <targetfiles>
661 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Strings.obj"/>
662 </targetfiles>
663
664 <sequential>
665 <cc userdefine="on">
666 <command type="CC" workdir="${DEST_DIR_OUTPUT}" includepathDelimiter="-I">
667 <includepath path="${WORKSPACE_DIR}"/>
668 <includepath path="${MODULE_DIR}"/>
669 <includepath path="${MODULE_DIR}/${ARCH}"/>
670
671 <argument value="${CC_FLAGS}"/>
672 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Strings.obj"/>
673
674 <fileset casesensitive="off" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c"/>
675 </command>
676 </cc>
677 </sequential>
678 </OnDependency>
679
680 <bl name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Strings.obj"/>
681 </sequential>
682 </macrodef>
683
684 <!--
685 Vfr
686 -->
687 <macrodef name="Build_Vfr">
688 <attribute name="FILEPATH"/>
689 <attribute name="FILENAME"/>
690 <attribute name="FILEEXT" default="vfr"/>
691
692 <element name="EXTRA.INC" optional="yes"/>
693 <element name="EXTRA.ARG" optional="yes"/>
694
695 <sequential>
696 <mkdir dir="${DEST_DIR_DEBUG}/@{FILEPATH}"/>
697
698 <if>
699 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
700 <then>
701 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">
702 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
703 <!-- <input file="${DEST_DIR_DEBUG}/AutoGen.h"/> -->
704 <includepath path="${WORKSPACE_DIR}"/>
705 <includepath path="${MODULE_DIR}"/>
706 <includepath path="${MODULE_DIR}/${ARCH}"/>
707 <EXTRA.INC/>
708 </makedeps>
709 </then>
710 </if>
711
712 <OnDependency>
713 <sourcefiles>
714 <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
715 </sourcefiles>
716 <targetfiles>
717 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
718 </targetfiles>
719
720 <sequential>
721 <vfrcompile createIfrBinFile="on" createListFile="on" outPutDir="${DEST_DIR_DEBUG}/@{FILEPATH}" vfrFile="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}">
722 <includepath path="${WORKSPACE_DIR}"/>
723 <includepath path="${MODULE_DIR}"/>
724 <includepath path="${MODULE_DIR}/${ARCH}"/>
725 <EXTRA.INC/>
726 </vfrcompile>
727
728 <cc userdefine="on">
729 <command type="CC" workdir="${DEST_DIR_OUTPUT}" includepathDelimiter="-I">
730 <includepath path="${WORKSPACE_DIR}"/>
731 <includepath path="${MODULE_DIR}"/>
732 <includepath path="${MODULE_DIR}/${ARCH}"/>
733 <argument value="${CC_FLAGS}"/>
734 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
735 <EXTRA.ARG/>
736
737 <fileset casesensitive="off" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.c"/>
738 </command>
739 </cc>
740
741 <delete file="@{FILENAME}.i"/>
742 </sequential>
743 </OnDependency>
744 <bl name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
745 </sequential>
746 </macrodef>
747
748 <!--############################################################################
749 Build Sections
750 #############################################################################-->
751 <!--
752 DLL
753 -->
754 <macrodef name="GenDll">
755 <attribute name="FILEPATH"/>
756 <attribute name="FILENAME"/>
757 <attribute name="FILEEXT"/>
758
759 <element name="LIB.ARG" optional="yes"/>
760 <element name="LINK.ARG" optional="yes"/>
761
762 <sequential>
763 <OnDependency>
764 <sourcefiles>
765 <file list="${OBJECTS}"/>
766 <file list="${LIBS}"/>
767 </sourcefiles>
768 <targetfiles>
769 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll"/>
770 </targetfiles>
771
772 <sequential>
773 <cc userdefine="on">
774 <command type="LIB">
775 <argument value="${LIB_FLAGS}"/>
776 <FileList dir="" files="${OBJECTS}"/>
777 <LIB.ARG/>
778 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib"/>
779 </command>
780 </cc>
781 <cc userdefine="on">
782 <command type="LINK">
783 <argument value="${LINK_FLAGS}"/>
784 <libset libs="${LIBS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib"/>
785 <LINK.ARG/>
786 <EntryPoint value="_ModuleEntryPoint"/>
787 <map value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.map"/>
788 <pdb value="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.pdb"/>
789 <OutputFile value="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll"/>
790 <!-- <FileList dir="" files="${OBJECTS}"/> -->
791 </command>
792 </cc>
793 </sequential>
794 </OnDependency>
795 </sequential>
796 </macrodef>
797
798 <!--
799 EFI
800 -->
801 <macrodef name="GenEfi">
802 <attribute name="FILEPATH"/>
803 <attribute name="FILENAME"/>
804 <attribute name="FILEEXT" default="dll"/>
805
806 <sequential>
807 <OnDependency>
808 <sourcefiles>
809 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
810 </sourcefiles>
811 <targetfiles>
812 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>
813 </targetfiles>
814
815 <sequential>
816 <if>
817 <equals arg1="${COMPONENT_TYPE}" arg2="SEC"/>
818 <then>
819 <var name="COMPONENT_TYPE" value="SECURITY_CORE"/>
820 </then>
821 </if>
822 <fwimage componenttype="${COMPONENT_TYPE}" outImage="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"
823 peImage="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" time="0"/>
824 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${DEST_DIR_DEBUG}/@{FILENAME}.efi" />
825 </sequential>
826 </OnDependency>
827 </sequential>
828 </macrodef>
829
830 <!--
831 EFI_SECTION_FREEFORM_SUBTYPE_GUID
832 EFI_SECTION_VERSION
833 EFI_SECTION_USER_INTERFACE
834 EFI_SECTION_DXE_DEPEX
835 EFI_SECTION_PEI_DEPEX
836 EFI_SECTION_PE32
837 EFI_SECTION_PIC
838 EFI_SECTION_TE
839 EFI_SECTION_RAW
840 EFI_SECTION_COMPRESSION
841 EFI_SECTION_GUID_DEFINED
842 EFI_SECTION_COMPATIBILITY16
843 EFI_SECTION_FIRMWARE_VOLUME_IMAGE
844 -->
845 <!--
846 EFI_SECTION_PE32
847 -->
848 <macrodef name="EFI_SECTION_PE32">
849 <attribute name="FILEPATH"/>
850 <attribute name="FILENAME"/>
851 <attribute name="FILEEXT" default="" />
852
853 <element name="PRE.PROCESS" optional="yes"/>
854 <element name="POST.PROCESS" optional="yes"/>
855
856 <sequential>
857 <PRE.PROCESS/>
858
859 <if>
860 <not>
861 <equals arg1="${OBJECTS}" arg2=""/>
862 </not>
863
864 <then>
865 <GenDll FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="">
866 <LIB.ARG></LIB.ARG>
867 <LINK.ARG></LINK.ARG>
868 </GenDll>
869
870 <GenEfi FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="dll"/>
871 </then>
872 </if>
873
874 <OnDependency>
875 <sourcefiles>
876 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>
877 </sourcefiles>
878 <targetfiles>
879 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32"/>
880 </targetfiles>
881
882 <sequential>
883 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${BIN_DIR}/@{FILENAME}.efi" />
884 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"
885 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32"
886 sectiontype="EFI_SECTION_PE32"/>
887
888 <POST.PROCESS/>
889 </sequential>
890 </OnDependency>
891 </sequential>
892 </macrodef>
893
894 <!--
895 EFI_SECTION_VERSION
896 -->
897 <macrodef name="EFI_SECTION_VERSION">
898 <attribute name="FILEPATH"/>
899 <attribute name="FILENAME"/>
900 <attribute name="FILEEXT" default="" />
901 <attribute name="VERSION" default="0000"/>
902
903 <element name="PRE.PROCESS" optional="yes"/>
904 <element name="POST.PROCESS" optional="yes"/>
905
906 <sequential>
907 <if>
908 <not>
909 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver"/>
910 </not>
911
912 <then>
913 <PRE.PROCESS/>
914 <gensection outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver"
915 versionnum="@{VERSION}"
916 sectiontype="EFI_SECTION_VERSION"/>
917 <POST.PROCESS/>
918 </then>
919 </if>
920 </sequential>
921 </macrodef>
922
923 <!--
924 EFI_SECTION_USER_INTERFACE
925 -->
926 <macrodef name="EFI_SECTION_USER_INTERFACE">
927 <attribute name="FILEPATH"/>
928 <attribute name="FILENAME"/>
929 <attribute name="FILEEXT" default="" />
930 <attribute name="UI" default="${BASE_NAME}"/>
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}.ui"/>
939 </not>
940
941 <then>
942 <PRE.PROCESS/>
943 <gensection interfacestring="@{UI}"
944 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui"
945 sectiontype="EFI_SECTION_USER_INTERFACE"/>
946 <POST.PROCESS/>
947 </then>
948 </if>
949 </sequential>
950 </macrodef>
951
952 <!--
953 EFI_SECTION_FREEFORM_SUBTYPE_GUID
954 <macrodef name="EFI_SECTION_FREEFORM_SUBTYPE_GUID">
955 <attribute name="FILEPATH"/>
956 <attribute name="FILENAME"/>
957 <attribute name="FILEEXT" default=""/>
958
959 <element name="EXTRA.INC" optional="yes"/>
960 <element name="EXTRA.ARG" optional="yes"/>
961
962 <sequential>
963 <gensection inputfile=""
964 outputfile=""
965 sectiontype="EFI_SECTION_FREEFORM_SUBTYPE_GUID"/>
966 </sequential>
967 </macrodef>
968 -->
969
970 <!--
971 EFI_SECTION_DXE_DEPEX
972 -->
973 <macrodef name="EFI_SECTION_DXE_DEPEX">
974 <attribute name="FILEPATH"/>
975 <attribute name="FILENAME"/>
976 <attribute name="FILEEXT" default="dxs"/>
977
978 <element name="PRE.PROCESS" optional="yes"/>
979 <element name="POST.PROCESS" optional="yes"/>
980
981 <sequential>
982 <PRE.PROCESS/>
983
984 <if>
985 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"/>
986 <then>
987 <OnDependency>
988 <sourcefiles>
989 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"/>
990 </sourcefiles>
991 <targetfiles>
992 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>
993 </targetfiles>
994 <sequential>
995 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"
996 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"
997 sectiontype="EFI_SECTION_DXE_DEPEX"/>
998 </sequential>
999 </OnDependency>
1000 </then>
1001 <else>
1002 <if>
1003 <not>
1004 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>
1005 </not>
1006 <then>
1007 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>
1008 </then>
1009 </if>
1010 </else>
1011 </if>
1012
1013 <POST.PROCESS/>
1014 </sequential>
1015 </macrodef>
1016
1017 <!--
1018 EFI_SECTION_PEI_DEPEX
1019 -->
1020 <macrodef name="EFI_SECTION_PEI_DEPEX">
1021 <attribute name="FILEPATH"/>
1022 <attribute name="FILENAME"/>
1023 <attribute name="FILEEXT" default="dxs"/>
1024
1025 <element name="PRE.PROCESS" optional="yes"/>
1026 <element name="POST.PROCESS" optional="yes"/>
1027 <sequential>
1028 <PRE.PROCESS/>
1029 <if>
1030 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"/>
1031 <then>
1032 <OnDependency>
1033 <sourcefiles>
1034 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"/>
1035 </sourcefiles>
1036 <targetfiles>
1037 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>
1038 </targetfiles>
1039
1040 <sequential>
1041 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"
1042 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"
1043 sectiontype="EFI_SECTION_PEI_DEPEX"/>
1044 </sequential>
1045 </OnDependency>
1046
1047 </then>
1048 <else>
1049 <if>
1050 <not>
1051 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>
1052 </not>
1053 <then>
1054 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>
1055 </then>
1056 </if>
1057 </else>
1058 </if>
1059 <POST.PROCESS/>
1060 </sequential>
1061 </macrodef>
1062
1063 <!--
1064 EFI_SECTION_PIC
1065 <macrodef name="EFI_SECTION_PIC">
1066 <attribute name="FILEPATH"/>
1067 <attribute name="FILENAME"/>
1068 <attribute name="FILEEXT" default=""/>
1069
1070 <element name="EXTRA.INC" optional="yes"/>
1071 <element name="EXTRA.ARG" optional="yes"/>
1072
1073 <sequential>
1074 <gensection inputfile="${BIN_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"
1075 outputfile="${BIN_DIR}/@{FILENAME}.pe32"
1076 sectiontype="EFI_SECTION_PIC"/>
1077 </sequential>
1078 </macrodef>
1079 -->
1080
1081 <!--
1082 EFI_SECTION_TE
1083 <macrodef name="EFI_SECTION_TE">
1084 <attribute name="FILEPATH"/>
1085 <attribute name="FILENAME"/>
1086 <attribute name="FILEEXT" default=""/>
1087
1088 <element name="EXTRA.INC" optional="yes"/>
1089 <element name="EXTRA.ARG" optional="yes"/>
1090
1091 <sequential>
1092 <gensection inputfile="${BIN_DIR}/@{FILENAME}.@{FILEEXT}"
1093 outputfile="${BIN_DIR}/@{FILENAME}.pe32"
1094 sectiontype="EFI_SECTION_PE32"/>
1095 </sequential>
1096 </macrodef>
1097 -->
1098
1099 <!--
1100 EFI_SECTION_RAW
1101 -->
1102 <macrodef name="EFI_SECTION_RAW">
1103 <attribute name="FILEPATH"/>
1104 <attribute name="FILENAME"/>
1105 <attribute name="FILEEXT" default="bin"/>
1106
1107 <element name="PRE.PROCESS" optional="yes"/>
1108 <element name="POST.PROCESS" optional="yes"/>
1109
1110 <sequential>
1111 <OnDependency>
1112 <sourcefiles>
1113 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}"/>
1114 </sourcefiles>
1115 <targetfiles>
1116 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>
1117 </targetfiles>
1118
1119 <sequential>
1120 <PRE.PROCESS/>
1121 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}"
1122 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"
1123 sectiontype="EFI_SECTION_RAW"/>
1124 <POST.PROCESS/>
1125 </sequential>
1126 </OnDependency>
1127 </sequential>
1128 </macrodef>
1129
1130 <!--
1131 EFI_SECTION_COMPRESSION
1132 <macrodef name="EFI_SECTION_COMPRESSION">
1133 <attribute name="FILEPATH"/>
1134 <attribute name="FILENAME"/>
1135 <attribute name="FILEEXT" default=""/>
1136
1137 <element name="EXTRA.INC" optional="yes"/>
1138 <element name="EXTRA.ARG" optional="yes"/>
1139
1140 <sequential>
1141 <gensection inputfile="${BIN_DIR}/@{FILENAME}.@{FILEEXT}"
1142 outputfile="${BIN_DIR}/@{FILENAME}.pe32"
1143 sectiontype="EFI_SECTION_PE32"/>
1144 </sequential>
1145 </macrodef>
1146 -->
1147
1148 <!--
1149 EFI_SECTION_GUID_DEFINED
1150 <macrodef name="EFI_SECTION_GUID_DEFINED">
1151 <attribute name="FILEPATH"/>
1152 <attribute name="FILENAME"/>
1153 <attribute name="FILEEXT" default=""/>
1154
1155 <element name="EXTRA.INC" optional="yes"/>
1156 <element name="EXTRA.ARG" optional="yes"/>
1157
1158 <sequential>
1159 <gensection inputfile="${BIN_DIR}/@{FILENAME}.@{FILEEXT}"
1160 outputfile="${BIN_DIR}/@{FILENAME}.pe32"
1161 sectiontype="EFI_SECTION_PE32"/>
1162 </sequential>
1163 </macrodef>
1164 -->
1165
1166 <!--
1167 EFI_SECTION_COMPATIBILITY16
1168 <macrodef name="EFI_SECTION_COMPATIBILITY16">
1169 <attribute name="FILEPATH"/>
1170 <attribute name="FILENAME"/>
1171 <attribute name="FILEEXT" default=""/>
1172
1173 <element name="EXTRA.INC" optional="yes"/>
1174 <element name="EXTRA.ARG" optional="yes"/>
1175
1176 <sequential>
1177 <gensection inputfile="${BIN_DIR}/@{FILENAME}.@{FILEEXT}"
1178 outputfile="${BIN_DIR}/@{FILENAME}.pe32"
1179 sectiontype="EFI_SECTION_PE32"/>
1180 </sequential>
1181 </macrodef>
1182
1183 -->
1184 <!--
1185 EFI_SECTION_FIRMWARE_VOLUME_IMAGE
1186 -->
1187 <macrodef name="EFI_SECTION_FIRMWARE_VOLUME_IMAGE">
1188 <attribute name="FILEPATH"/>
1189 <attribute name="FILENAME"/>
1190 <attribute name="FILEEXT" default="fv"/>
1191
1192 <element name="PRE.PROCESS" optional="yes"/>
1193 <element name="POST.PROCESS" optional="yes"/>
1194
1195 <sequential>
1196 <OnDependency>
1197 <sourcefiles>
1198 <file name="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
1199 </sourcefiles>
1200 <targetfiles>
1201 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec"/>
1202 </targetfiles>
1203
1204 <sequential>
1205 <PRE.PROCESS/>
1206
1207 <copy file="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"
1208 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"
1209 overwrite="true"/>
1210 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"
1211 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec"
1212 sectiontype="EFI_SECTION_FIRMWARE_VOLUME_IMAGE"/>
1213
1214 <POST.PROCESS/>
1215 </sequential>
1216 </OnDependency>
1217 </sequential>
1218 </macrodef>
1219
1220 <!--
1221 Binary
1222 -->
1223 <macrodef name="Build_Binary">
1224 <attribute name="FILEPATH"/>
1225 <attribute name="FILENAME"/>
1226 <attribute name="FILEEXT" default="bin"/>
1227
1228 <element name="EXTRA.INC" optional="yes"/>
1229 <element name="EXTRA.ARG" optional="yes"/>
1230
1231 <sequential>
1232 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"
1233 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.bin"/>
1234 </sequential>
1235 </macrodef>
1236
1237 <!--
1238 Graphics (bmp, ...)
1239 -->
1240 <macrodef name="Build_Graphics">
1241 <attribute name="FILEPATH"/>
1242 <attribute name="FILENAME"/>
1243 <attribute name="FILEEXT" default="bmp"/>
1244
1245 <element name="EXTRA.INC" optional="yes"/>
1246 <element name="EXTRA.ARG" optional="yes"/>
1247
1248 <sequential>
1249 <mkdir dir="${MODULE_DIR}/@{FILEPATH}" />
1250 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"
1251 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.bin"/>
1252 </sequential>
1253 </macrodef>
1254 <macrodef name="Build_EFI">
1255 <attribute name="FILEPATH"/>
1256 <attribute name="FILENAME"/>
1257 <attribute name="FILEEXT" default="efi"/>
1258
1259 <element name="EXTRA.INC" optional="yes"/>
1260 <element name="EXTRA.ARG" optional="yes"/>
1261
1262 <sequential>
1263 <mkdir dir="${MODULE_DIR}/@{FILEPATH}" />
1264 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"
1265 tofile="${DEST_DIR_OUTPUT}/${BASE_NAME}.efi"/>
1266 </sequential>
1267 </macrodef>
1268 </project>