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