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