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