1. Add Assert in SetJump.S
[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
4dd228c7 399 <fileset casesensitive="off" dir="${DEST_DIR_OUTPUT}" includes="**/*.obj"/>\r
5fc17c92 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
a99a79e4 585 <!--\r
586 DUMMY\r
587 -->\r
588 <macrodef name="Build_DUMMY">\r
589 <attribute name="FILEPATH"/>\r
590 <attribute name="FILENAME"/>\r
591 <attribute name="FILEEXT"/>\r
592\r
593 <element name="EXTRA.INC" optional="yes"/>\r
594 <element name="EXTRA.ARG" optional="yes"/>\r
595\r
596 <sequential>\r
19689a07 597 <echo message="Ignoring ${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
a99a79e4 598 </sequential>\r
599 </macrodef>\r
600\r
878ddf1f 601<!--############################################################################\r
602 Build Sections\r
603#############################################################################-->\r
604 <!--\r
605 DLL\r
606 -->\r
607 <macrodef name="GenDll">\r
608 <attribute name="FILEPATH"/>\r
609 <attribute name="FILENAME"/>\r
610 <attribute name="FILEEXT"/>\r
611\r
612 <element name="LIB.ARG" optional="yes"/>\r
613 <element name="LINK.ARG" optional="yes"/>\r
614\r
615 <sequential>\r
5fc17c92 616 <var name="FILE_BASENAME" value="@{FILENAME}" />\r
617 <var name="FILE_PATH" value="@{FILEPATH}" />\r
878ddf1f 618 <OnDependency>\r
619 <sourcefiles>\r
878ddf1f 620 <file list="${LIBS}"/>\r
4dd228c7 621 <fileset casesensitive="off" dir="${DEST_DIR_OUTPUT}" includes="**/*.obj"/>\r
878ddf1f 622 </sourcefiles>\r
623 <targetfiles>\r
22e0585c 624 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll"/>\r
878ddf1f 625 </targetfiles>\r
626\r
627 <sequential>\r
8b41e66e 628 <cc userdefine="on">\r
5fc17c92 629 <command type="SLINK" cmd="${SLINK}" family="${SLINK_FAMILY}"\r
630 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib">\r
631 <argument value="${SLINK_FLAGS}"/>\r
632\r
633 <fileset casesensitive="off" dir="${DEST_DIR_OUTPUT}" includes="**/*.obj"/>\r
8b41e66e 634 </command>\r
635 </cc>\r
878ddf1f 636 <cc userdefine="on">\r
5fc17c92 637 <command type="DLINK" cmd="${DLINK}" family="${DLINK_FAMILY}"\r
638 outputFile="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll" >\r
639 <argument value="${DLINK_FLAGS}"/>\r
640 <libset libs="${LIBS}"/>\r
641 <libset libs="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib"/>\r
642 <libset libs="${DLINK_SPATH}" />\r
878ddf1f 643 <LINK.ARG/>\r
878ddf1f 644 </command>\r
645 </cc>\r
646 </sequential>\r
647 </OnDependency>\r
648 </sequential>\r
649 </macrodef>\r
650\r
651 <!--\r
652 EFI\r
653 -->\r
654 <macrodef name="GenEfi">\r
655 <attribute name="FILEPATH"/>\r
656 <attribute name="FILENAME"/>\r
657 <attribute name="FILEEXT" default="dll"/>\r
658\r
659 <sequential>\r
660 <OnDependency>\r
661 <sourcefiles>\r
22e0585c 662 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 663 </sourcefiles>\r
664 <targetfiles>\r
22e0585c 665 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
878ddf1f 666 </targetfiles>\r
667\r
668 <sequential>\r
5fc17c92 669 <fwimage componentType="${MODULE_TYPE}" outImage="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" \r
22e0585c 670 peImage="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" time="0"/>\r
878ddf1f 671 </sequential>\r
672 </OnDependency>\r
673 </sequential>\r
674 </macrodef>\r
675\r
676<!--\r
677 EFI_SECTION_FREEFORM_SUBTYPE_GUID\r
678 EFI_SECTION_VERSION\r
679 EFI_SECTION_USER_INTERFACE\r
680 EFI_SECTION_DXE_DEPEX\r
681 EFI_SECTION_PEI_DEPEX\r
682 EFI_SECTION_PE32\r
683 EFI_SECTION_PIC\r
684 EFI_SECTION_TE\r
685 EFI_SECTION_RAW\r
686 EFI_SECTION_COMPRESSION\r
687 EFI_SECTION_GUID_DEFINED\r
688 EFI_SECTION_COMPATIBILITY16\r
689 EFI_SECTION_FIRMWARE_VOLUME_IMAGE\r
690 -->\r
691 <!--\r
692 EFI_SECTION_PE32\r
693 -->\r
46dde08c
LG
694\r
695 <macrodef name="EFI_SECTION_TE">\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 <if>\r
706 <not>\r
707 <equals arg1="${LIBS}" arg2=""/>\r
708 </not>\r
709\r
710 <then>\r
711 <GenDll FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="">\r
712 <LIB.ARG></LIB.ARG>\r
713 <LINK.ARG></LINK.ARG>\r
714 </GenDll>\r
715\r
716 <GenEfi FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="dll"/>\r
717 </then>\r
718 </if>\r
719\r
720 <OnDependency>\r
721 <sourcefiles>\r
722 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
723 </sourcefiles>\r
724 <targetfiles>\r
725 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.tes"/>\r
726 </targetfiles>\r
727\r
728 <sequential>\r
729 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${BIN_DIR}/@{FILENAME}.efi" />\r
730 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${DEST_DIR_DEBUG}/@{FILENAME}.efi" /> \r
731 <genteimage Dump="false" Verbose="false" OutputDir="" OutputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.te" InputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
46dde08c
LG
732 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.te" tofile="${BIN_DIR}/@{FILENAME}.te" />\r
733 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.te" \r
734 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.tes" \r
735 sectiontype="EFI_SECTION_TE"/>\r
736 <POST.PROCESS/>\r
737 </sequential>\r
738 </OnDependency>\r
739 </sequential>\r
740 </macrodef>\r
741\r
878ddf1f 742 <macrodef name="EFI_SECTION_PE32">\r
743 <attribute name="FILEPATH"/>\r
744 <attribute name="FILENAME"/>\r
745 <attribute name="FILEEXT" default="" />\r
746\r
747 <element name="PRE.PROCESS" optional="yes"/>\r
748 <element name="POST.PROCESS" optional="yes"/>\r
749\r
750 <sequential>\r
751 <PRE.PROCESS/>\r
878ddf1f 752 <if>\r
753 <not>\r
5fc17c92 754 <!-- TBD ${OBJECTS} -->\r
755 <equals arg1="${LIBS}" arg2=""/>\r
878ddf1f 756 </not>\r
757\r
758 <then>\r
759 <GenDll FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="">\r
760 <LIB.ARG></LIB.ARG>\r
761 <LINK.ARG></LINK.ARG>\r
762 </GenDll>\r
0fd9e137 763\r
878ddf1f 764 <GenEfi FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="dll"/>\r
765 </then>\r
766 </if>\r
5fc17c92 767 \r
878ddf1f 768 <OnDependency>\r
769 <sourcefiles>\r
22e0585c 770 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
878ddf1f 771 </sourcefiles>\r
772 <targetfiles>\r
22e0585c 773 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32"/>\r
878ddf1f 774 </targetfiles>\r
775\r
776 <sequential>\r
22e0585c 777 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${BIN_DIR}/@{FILENAME}.efi" />\r
5fc17c92 778 \r
779 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" \r
780 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32" \r
878ddf1f 781 sectiontype="EFI_SECTION_PE32"/>\r
5fc17c92 782 \r
878ddf1f 783 <POST.PROCESS/>\r
784 </sequential>\r
785 </OnDependency>\r
5fc17c92 786 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${DEST_DIR_DEBUG}/@{FILENAME}.efi" />\r
878ddf1f 787 </sequential>\r
788 </macrodef>\r
789\r
790 <!--\r
791 EFI_SECTION_VERSION\r
792 -->\r
793 <macrodef name="EFI_SECTION_VERSION">\r
794 <attribute name="FILEPATH"/>\r
795 <attribute name="FILENAME"/>\r
796 <attribute name="FILEEXT" default="" />\r
797 <attribute name="VERSION" default="0000"/>\r
798\r
799 <element name="PRE.PROCESS" optional="yes"/>\r
800 <element name="POST.PROCESS" optional="yes"/>\r
801\r
802 <sequential>\r
803 <if>\r
804 <not>\r
22e0585c 805 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver"/>\r
878ddf1f 806 </not>\r
807\r
808 <then>\r
809 <PRE.PROCESS/>\r
5fc17c92 810 <gensection outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver" \r
878ddf1f 811 versionnum="@{VERSION}"\r
812 sectiontype="EFI_SECTION_VERSION"/>\r
813 <POST.PROCESS/>\r
814 </then>\r
815 </if>\r
816 </sequential>\r
817 </macrodef>\r
818\r
819 <!--\r
820 EFI_SECTION_USER_INTERFACE\r
821 -->\r
822 <macrodef name="EFI_SECTION_USER_INTERFACE">\r
823 <attribute name="FILEPATH"/>\r
824 <attribute name="FILENAME"/>\r
825 <attribute name="FILEEXT" default="" />\r
826 <attribute name="UI" default="${BASE_NAME}"/>\r
827\r
828 <element name="PRE.PROCESS" optional="yes"/>\r
829 <element name="POST.PROCESS" optional="yes"/>\r
830\r
831 <sequential>\r
832 <if>\r
833 <not>\r
22e0585c 834 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui"/>\r
878ddf1f 835 </not>\r
836\r
837 <then>\r
838 <PRE.PROCESS/>\r
839 <gensection interfacestring="@{UI}"\r
5fc17c92 840 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui" \r
878ddf1f 841 sectiontype="EFI_SECTION_USER_INTERFACE"/>\r
842 <POST.PROCESS/>\r
843 </then>\r
844 </if>\r
845 </sequential>\r
846 </macrodef>\r
847\r
878ddf1f 848 <!--\r
849 EFI_SECTION_DXE_DEPEX\r
850 -->\r
851 <macrodef name="EFI_SECTION_DXE_DEPEX">\r
852 <attribute name="FILEPATH"/>\r
853 <attribute name="FILENAME"/>\r
854 <attribute name="FILEEXT" default="dxs"/>\r
855\r
856 <element name="PRE.PROCESS" optional="yes"/>\r
857 <element name="POST.PROCESS" optional="yes"/>\r
858\r
859 <sequential>\r
860 <PRE.PROCESS/>\r
861\r
862 <if>\r
5fc17c92 863 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 864 <then>\r
865 <OnDependency>\r
866 <sourcefiles>\r
5fc17c92 867 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 868 </sourcefiles>\r
869 <targetfiles>\r
22e0585c 870 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 871 </targetfiles>\r
872 <sequential>\r
5fc17c92 873 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.depex" \r
874 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx" \r
878ddf1f 875 sectiontype="EFI_SECTION_DXE_DEPEX"/>\r
876 </sequential>\r
877 </OnDependency>\r
878 </then>\r
879 <else>\r
880 <if>\r
881 <not>\r
22e0585c 882 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 883 </not>\r
884 <then>\r
22e0585c 885 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 886 </then>\r
887 </if>\r
888 </else>\r
889 </if>\r
890\r
891 <POST.PROCESS/>\r
892 </sequential>\r
893 </macrodef>\r
894\r
895 <!--\r
896 EFI_SECTION_PEI_DEPEX\r
897 -->\r
898 <macrodef name="EFI_SECTION_PEI_DEPEX">\r
899 <attribute name="FILEPATH"/>\r
900 <attribute name="FILENAME"/>\r
901 <attribute name="FILEEXT" default="dxs"/>\r
902\r
903 <element name="PRE.PROCESS" optional="yes"/>\r
904 <element name="POST.PROCESS" optional="yes"/>\r
905 <sequential>\r
906 <PRE.PROCESS/>\r
907 <if>\r
5fc17c92 908 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 909 <then>\r
910 <OnDependency>\r
911 <sourcefiles>\r
5fc17c92 912 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 913 </sourcefiles>\r
914 <targetfiles>\r
22e0585c 915 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 916 </targetfiles>\r
917\r
918 <sequential>\r
5fc17c92 919 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.depex" \r
920 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx" \r
878ddf1f 921 sectiontype="EFI_SECTION_PEI_DEPEX"/>\r
922 </sequential>\r
923 </OnDependency>\r
5fc17c92 924 \r
878ddf1f 925 </then>\r
926 <else>\r
927 <if>\r
928 <not>\r
22e0585c 929 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 930 </not>\r
931 <then>\r
22e0585c 932 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 933 </then>\r
934 </if>\r
935 </else>\r
936 </if>\r
937 <POST.PROCESS/>\r
938 </sequential>\r
939 </macrodef>\r
940\r
878ddf1f 941\r
942 <!--\r
943 EFI_SECTION_RAW\r
944 -->\r
945 <macrodef name="EFI_SECTION_RAW">\r
946 <attribute name="FILEPATH"/>\r
947 <attribute name="FILENAME"/>\r
948 <attribute name="FILEEXT" default="bin"/>\r
949\r
950 <element name="PRE.PROCESS" optional="yes"/>\r
951 <element name="POST.PROCESS" optional="yes"/>\r
952\r
953 <sequential>\r
954 <OnDependency>\r
955 <sourcefiles>\r
22e0585c 956 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 957 </sourcefiles>\r
958 <targetfiles>\r
22e0585c 959 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>\r
878ddf1f 960 </targetfiles>\r
961\r
962 <sequential>\r
963 <PRE.PROCESS/>\r
5fc17c92 964 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}" \r
965 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.sec" \r
878ddf1f 966 sectiontype="EFI_SECTION_RAW"/>\r
967 <POST.PROCESS/>\r
968 </sequential>\r
969 </OnDependency>\r
970 </sequential>\r
971 </macrodef>\r
972\r
878ddf1f 973 <!--\r
974 EFI_SECTION_FIRMWARE_VOLUME_IMAGE\r
975 -->\r
976 <macrodef name="EFI_SECTION_FIRMWARE_VOLUME_IMAGE">\r
977 <attribute name="FILEPATH"/>\r
978 <attribute name="FILENAME"/>\r
979 <attribute name="FILEEXT" default="fv"/>\r
980\r
981 <element name="PRE.PROCESS" optional="yes"/>\r
982 <element name="POST.PROCESS" optional="yes"/>\r
983\r
984 <sequential>\r
985 <OnDependency>\r
986 <sourcefiles>\r
22e0585c 987 <file name="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 988 </sourcefiles>\r
989 <targetfiles>\r
22e0585c 990 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec"/>\r
878ddf1f 991 </targetfiles>\r
992\r
993 <sequential>\r
994 <PRE.PROCESS/>\r
5fc17c92 995 \r
996 <copy file="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
997 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
878ddf1f 998 overwrite="true"/>\r
5fc17c92 999 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
1000 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec" \r
878ddf1f 1001 sectiontype="EFI_SECTION_FIRMWARE_VOLUME_IMAGE"/>\r
5fc17c92 1002 \r
878ddf1f 1003 <POST.PROCESS/>\r
1004 </sequential>\r
1005 </OnDependency>\r
1006 </sequential>\r
1007 </macrodef>\r
1008\r
1009 <!--\r
1010 Binary\r
1011 -->\r
1012 <macrodef name="Build_Binary">\r
1013 <attribute name="FILEPATH"/>\r
1014 <attribute name="FILENAME"/>\r
1015 <attribute name="FILEEXT" default="bin"/>\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 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
22e0585c 1022 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.bin"/>\r
878ddf1f 1023 </sequential>\r
1024 </macrodef>\r
1025\r
1026 <!--\r
1027 Graphics (bmp, ...)\r
1028 -->\r
1029 <macrodef name="Build_Graphics">\r
1030 <attribute name="FILEPATH"/>\r
1031 <attribute name="FILENAME"/>\r
1032 <attribute name="FILEEXT" default="bmp"/>\r
1033\r
1034 <element name="EXTRA.INC" optional="yes"/>\r
1035 <element name="EXTRA.ARG" optional="yes"/>\r
1036\r
1037 <sequential>\r
5fc17c92 1038 <mkdir dir="${MODULE_DIR}/@{FILEPATH}" /> \r
1039 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
22e0585c 1040 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.bin"/>\r
878ddf1f 1041 </sequential>\r
5fc17c92 1042 </macrodef> \r
878ddf1f 1043 <macrodef name="Build_EFI">\r
1044 <attribute name="FILEPATH"/>\r
1045 <attribute name="FILENAME"/>\r
1046 <attribute name="FILEEXT" default="efi"/>\r
1047\r
1048 <element name="EXTRA.INC" optional="yes"/>\r
1049 <element name="EXTRA.ARG" optional="yes"/>\r
1050\r
1051 <sequential>\r
5fc17c92 1052 <mkdir dir="${MODULE_DIR}/@{FILEPATH}" /> \r
1053 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
22e0585c 1054 tofile="${DEST_DIR_OUTPUT}/${BASE_NAME}.efi"/>\r
878ddf1f 1055 </sequential>\r
1056 </macrodef>\r
1057</project>\r