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