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