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