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