Optimized HighBitSetXX() functions
[mirror_edk2.git] / Tools / Conf / BuildMacro.xml
CommitLineData
a1c90cf6 1<?xml version="1.0" encoding="UTF-8"?>\r
878ddf1f 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
a1c90cf6 63 <!-- Use pre-compiled header if available -->\r
64 <if>\r
65 <and>\r
66 <equals arg1="${CC_FAMILY}" arg2="MSFT" casesensitive="false"/>\r
ac242ae4 67 <available file="${DEST_DIR_OUTPUT}/AutoGen.h.gch"/>\r
a1c90cf6 68 </and>\r
69 <then>\r
ac242ae4 70 <var name="LOCAL_CC_FLAGS" value="${CC_FLAGS} /Yu${DEST_DIR_DEBUG}/AutoGen.h /Fp${DEST_DIR_OUTPUT}/AutoGen.h.gch"/>\r
a1c90cf6 71 </then>\r
72 <else>\r
73 <var name="LOCAL_CC_FLAGS" value="${CC_FLAGS}"/>\r
74 </else>\r
75 </if>\r
76\r
878ddf1f 77 <cc userdefine="on">\r
5fc17c92 78 <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" family="${CC_FAMILY}"\r
32c8b5a9 79 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" dpath="${CC_DPATH}">\r
878ddf1f 80 <EXTRA.INC/>\r
a1c90cf6 81 <argument value="${LOCAL_CC_FLAGS}"/>\r
878ddf1f 82 <EXTRA.ARG/>\r
3fc9d866 83 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 84 </command>\r
85 </cc>\r
86 </sequential>\r
87 </OnDependency>\r
32a47954 88 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->\r
89 <if>\r
90 <equals arg1="@{FILEPATH}" arg2="." />\r
91 <then>\r
92 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}.obj" />\r
93 </then>\r
94 <else>\r
95 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}.obj" />\r
96 </else>\r
97 </if>\r
878ddf1f 98 </sequential>\r
99 </macrodef>\r
100\r
101\r
102 <macrodef name="Build_AUTOGEN">\r
103 <attribute name="FILEPATH"/>\r
104 <attribute name="FILENAME"/>\r
105 <attribute name="FILEEXT" default="c"/>\r
106\r
107 <element name="EXTRA.INC" optional="yes"/>\r
108 <element name="EXTRA.ARG" optional="yes"/>\r
109\r
110 <sequential>\r
5fc17c92 111 <var name="FILE_BASENAME" value="@{FILENAME}" />\r
112 <var name="FILE_PATH" value="@{FILEPATH}" />\r
22e0585c 113 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
878ddf1f 114\r
f88b9153 115 <if>\r
ac242ae4 116 <available type="file" file="${DEST_DIR_OUTPUT}/AutoGen.h.gch"/>\r
f88b9153 117 <then>\r
118 <makedeps DepsFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep">\r
119 <input file="${DEST_DIR_DEBUG}/AutoGen.h"/>\r
120 <EXTRA.INC/>\r
121 </makedeps>\r
122 </then>\r
123 </if>\r
124\r
125 <OnDependency>\r
126 <sourcefiles>\r
127 <file ListFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"/>\r
128 </sourcefiles>\r
129 <targetfiles>\r
ac242ae4 130 <file Name="${DEST_DIR_OUTPUT}/AutoGen.h.gch"/>\r
f88b9153 131 </targetfiles>\r
132\r
133 <sequential>\r
134 <!-- Generate pre-compiled header -->\r
135 <if>\r
136 <equals arg1="${CC_FAMILY}" arg2="MSFT" casesensitive="false"/>\r
137 <then>\r
ac242ae4 138 <var name="LOCAL_CC_FLAGS" value="${CC_FLAGS} /TC /Yc /Fp${DEST_DIR_OUTPUT}/AutoGen.h.gch"/>\r
f88b9153 139 <cc userdefine="on">\r
140 <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" family="${CC_FAMILY}"\r
32c8b5a9 141 outputFile="${DEST_DIR_OUTPUT}/AutoGen.h.obj" dpath="${CC_DPATH}">\r
f88b9153 142 <EXTRA.INC/>\r
143 <argument value="${LOCAL_CC_FLAGS}"/>\r
144 <EXTRA.ARG/>\r
145 <fileset casesensitive="on" file="${DEST_DIR_DEBUG}/AutoGen.h"/>\r
146 </command>\r
147 </cc>\r
148 </then>\r
149 </if>\r
150 </sequential>\r
151 </OnDependency>\r
152\r
878ddf1f 153 <if>\r
22e0585c 154 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 155 <then>\r
22e0585c 156 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">\r
157 <input file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
158 <input file="${DEST_DIR_DEBUG}/AutoGen.h"/>\r
878ddf1f 159 <EXTRA.INC/>\r
160 </makedeps>\r
161 </then>\r
162 </if>\r
163\r
164 <OnDependency>\r
165 <sourcefiles>\r
22e0585c 166 <file ListFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
878ddf1f 167 </sourcefiles>\r
168 <targetfiles>\r
22e0585c 169 <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 170 </targetfiles>\r
171\r
172 <sequential>\r
a1c90cf6 173 <!-- Generate pre-compiled header -->\r
174 <if>\r
175 <equals arg1="${CC_FAMILY}" arg2="MSFT" casesensitive="false"/>\r
176 <then>\r
ac242ae4 177 <var name="LOCAL_CC_FLAGS" value="${CC_FLAGS} /Yu${DEST_DIR_DEBUG}/AutoGen.h /Fp${DEST_DIR_OUTPUT}/AutoGen.h.gch"/>\r
a1c90cf6 178 </then>\r
179 <else>\r
180 <var name="LOCAL_CC_FLAGS" value="${CC_FLAGS}"/>\r
181 </else>\r
182 </if>\r
183\r
878ddf1f 184 <cc userdefine="on">\r
5fc17c92 185 <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" family="${CC_FAMILY}"\r
32c8b5a9 186 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" dpath="${CC_DPATH}">\r
878ddf1f 187 <EXTRA.INC/>\r
a1c90cf6 188 <argument value="${LOCAL_CC_FLAGS}"/>\r
878ddf1f 189 <EXTRA.ARG/>\r
3fc9d866 190 <fileset casesensitive="on" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 191 </command>\r
192 </cc>\r
193 </sequential>\r
194 </OnDependency>\r
32a47954 195 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->\r
196 <if>\r
197 <equals arg1="@{FILEPATH}" arg2="." />\r
198 <then>\r
199 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}.obj" />\r
200 </then>\r
201 <else>\r
202 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}.obj" />\r
203 </else>\r
204 </if>\r
878ddf1f 205 </sequential>\r
206 </macrodef>\r
207\r
5fc17c92 208 <macrodef name="Build_DPX">\r
878ddf1f 209 <attribute name="FILEPATH"/>\r
210 <attribute name="FILENAME"/>\r
211 <attribute name="FILEEXT" default="dxs"/>\r
212\r
213 <element name="EXTRA.INC" optional="yes"/>\r
214 <element name="EXTRA.ARG" optional="yes"/>\r
5fc17c92 215 \r
878ddf1f 216\r
217 <sequential>\r
5fc17c92 218 <var name="FILE_BASENAME" value="@{FILENAME}" />\r
219 <var name="FILE_PATH" value="@{FILEPATH}" />\r
22e0585c 220 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
878ddf1f 221\r
222 <OnDependency>\r
223 <sourcefiles>\r
22e0585c 224 <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 225 </sourcefiles>\r
226 <targetfiles>\r
5fc17c92 227 <file name="${DEST_DIR_OUTPUT}/${BASE_NAME}.depex"/>\r
878ddf1f 228 </targetfiles>\r
229\r
230 <sequential>\r
878ddf1f 231 <cc userdefine="on">\r
df569f61 232 <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}/@{FILEPATH}" family="${CC_FAMILY}"\r
32c8b5a9 233 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i" dpath="${CC_DPATH}">\r
878ddf1f 234 <EXTRA.INC/>\r
235 <argument value="${PP_FLAGS}"/>\r
3fc9d866 236 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 237 </command>\r
238 </cc>\r
5fc17c92 239 \r
df569f61 240 <gendepex inputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i" outputFile="${DEST_DIR_OUTPUT}/${BASE_NAME}.depex"/>\r
878ddf1f 241 </sequential>\r
242 </OnDependency>\r
243 </sequential>\r
244 </macrodef>\r
5fc17c92 245 \r
246 <macrodef name="Build_ASM">\r
878ddf1f 247 <attribute name="FILEPATH"/>\r
248 <attribute name="FILENAME"/>\r
249 <attribute name="FILEEXT" default="asm"/>\r
250\r
251 <element name="EXTRA.INC" optional="yes"/>\r
252 <element name="EXTRA.ARG" optional="yes"/>\r
5fc17c92 253 \r
254 <!-- Dispath ASM file, there are three type. \r
df569f61 255 asm - Build_Assembly\r
256 S - Build_Gcc_Assembly\r
257 s - Build_Ipf_Assembly -->\r
878ddf1f 258 <sequential>\r
5fc17c92 259 <if>\r
df569f61 260 <equals arg1="@{FILEEXT}" arg2="asm" />\r
5fc17c92 261 <then>\r
262 <Build_Assembly FILEPATH="@{FILEPATH}" FILENAME="@{FILENAME}" FILEEXT="@{FILEEXT}">\r
263 <EXTRA.INC.1><EXTRA.INC /></EXTRA.INC.1>\r
264 <EXTRA.ARG.1><EXTRA.ARG /></EXTRA.ARG.1>\r
265 </Build_Assembly>\r
266 </then>\r
df569f61 267 <elseif>\r
268 <equals arg1="@{FILEEXT}" arg2="S" />\r
269 <then>\r
270 <Build_Gcc_Assembly FILEPATH="@{FILEPATH}" FILENAME="@{FILENAME}" FILEEXT="@{FILEEXT}">\r
271 <EXTRA.INC.1><EXTRA.INC /></EXTRA.INC.1>\r
272 <EXTRA.ARG.1><EXTRA.ARG /></EXTRA.ARG.1>\r
273 </Build_Gcc_Assembly>\r
274 </then>\r
275 </elseif>\r
5fc17c92 276 <elseif>\r
25832ed3 277 <equals arg1="@{FILEEXT}" arg2="s" />\r
5fc17c92 278 <then>\r
279 <Build_IPF_Assembly_Code FILEPATH="@{FILEPATH}" FILENAME="@{FILENAME}" FILEEXT="@{FILEEXT}">\r
280 <EXTRA.INC.1><EXTRA.INC /></EXTRA.INC.1>\r
281 <EXTRA.ARG.1><EXTRA.ARG /></EXTRA.ARG.1>\r
282 </Build_IPF_Assembly_Code>\r
283 </then>\r
284 </elseif>\r
285 </if>\r
878ddf1f 286 </sequential>\r
287 </macrodef>\r
5fc17c92 288 \r
0fd9e137 289 <!--\r
5fc17c92 290 IA32/x64 Assembly\r
0fd9e137 291 -->\r
5fc17c92 292 <macrodef name="Build_Assembly">\r
0fd9e137 293 <attribute name="FILEPATH"/>\r
294 <attribute name="FILENAME"/>\r
295 <attribute name="FILEEXT" default="asm"/>\r
296\r
5fc17c92 297 <element name="EXTRA.INC.1" optional="yes"/>\r
298 <element name="EXTRA.ARG.1" optional="yes"/>\r
0fd9e137 299\r
300 <sequential>\r
5fc17c92 301 <var name="FILE_BASENAME" value="@{FILENAME}" />\r
302 <var name="FILE_PATH" value="@{FILEPATH}" />\r
0fd9e137 303 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
304\r
0fd9e137 305 <OnDependency>\r
306 <sourcefiles>\r
5fc17c92 307 <file Name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
0fd9e137 308 </sourcefiles>\r
309 <targetfiles>\r
310 <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
311 </targetfiles>\r
312\r
313 <sequential>\r
c44794ef 314 <cc userdefine="on">\r
32c8b5a9 315 <command type="PP" cmd="${PP}" workdir="${DEST_DIR_OUTPUT}/@{FILEPATH}" family="${PP_FAMILY}" dpath="${PP_DPATH}">\r
c44794ef 316 <EXTRA.INC.1/>\r
317 <argument value="${PP_FLAGS}"/>\r
3fc9d866 318 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
c44794ef 319 </command>\r
320 </cc>\r
321\r
322 <replaceregexp file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"\r
323 match="^(#line +1 +.*@{FILEPATH}/@{FILENAME}\.@{FILEEXT}&quot;).+\1"\r
324 replace=";"\r
325 flags="gs"/>\r
326 <replaceregexp file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"\r
327 match="^(#line .*)$"\r
328 replace="; \1"\r
329 byline="true"/>\r
330 <replaceregexp file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"\r
331 match="([^_a-zA-Z])0x([0-9a-fA-F]+)"\r
332 replace="\10\2h"\r
333 flags="g"\r
334 byline="true"/>\r
0d2001d3 335\r
0fd9e137 336 <cc userdefine="on">\r
5fc17c92 337 <command type="ASM" cmd="${ASM}" workdir="${DEST_DIR_OUTPUT}" family="${ASM_FAMILY}"\r
32c8b5a9 338 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" dpath="${ASM_DPATH}">\r
5fc17c92 339 <EXTRA.INC.1/>\r
340 \r
0fd9e137 341 <argument value="${ASM_FLAGS}"/>\r
5fc17c92 342 <EXTRA.ARG.1/>\r
343 \r
3fc9d866 344 <fileset casesensitive="on" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"/>\r
75d0c5b1 345 </command>\r
346 </cc>\r
347 </sequential>\r
348 </OnDependency>\r
32a47954 349 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->\r
350 <if>\r
351 <equals arg1="@{FILEPATH}" arg2="." />\r
352 <then>\r
353 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}.obj" />\r
354 </then>\r
355 <else>\r
356 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}.obj" />\r
357 </else>\r
358 </if>\r
75d0c5b1 359 </sequential>\r
df569f61 360 </macrodef>\r
361\r
362 <!--\r
363 Build GCC assembly code\r
364 -->\r
365 <macrodef name="Build_Gcc_Assembly">\r
366 <attribute name="FILEPATH"/>\r
367 <attribute name="FILENAME"/>\r
368 <attribute name="FILEEXT" default="asm"/>\r
369\r
370 <element name="EXTRA.INC.1" optional="yes"/>\r
371 <element name="EXTRA.ARG.1" optional="yes"/>\r
372\r
373 <sequential>\r
374 <var name="FILE_BASENAME" value="@{FILENAME}" />\r
375 <var name="FILE_PATH" value="@{FILEPATH}" />\r
376 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
377\r
378 <OnDependency>\r
379 <sourcefiles>\r
380 <file Name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
381 </sourcefiles>\r
382 <targetfiles>\r
383 <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
384 </targetfiles>\r
385\r
386 <sequential>\r
df569f61 387 <cc userdefine="on">\r
388 <command type="ASM" cmd="${ASM}" workdir="${DEST_DIR_OUTPUT}" family="${ASM_FAMILY}"\r
32c8b5a9 389 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" dpath="${ASM_DPATH}">\r
df569f61 390 <EXTRA.INC.1/>\r
391 \r
392 <argument value="${ASM_FLAGS}"/>\r
393 <EXTRA.ARG.1/>\r
394 \r
3fc9d866 395 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
df569f61 396 </command>\r
397 </cc>\r
398 </sequential>\r
399 </OnDependency>\r
32a47954 400 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->\r
401 <if>\r
402 <equals arg1="@{FILEPATH}" arg2="." />\r
403 <then>\r
404 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}.obj" />\r
405 </then>\r
406 <else>\r
407 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}.obj" />\r
408 </else>\r
409 </if>\r
df569f61 410 </sequential>\r
75d0c5b1 411 </macrodef>\r
412\r
878ddf1f 413 <!--\r
414 IPF Assembly\r
415 -->\r
416 <macrodef name="Build_IPF_Assembly_Code">\r
417 <attribute name="FILEPATH"/>\r
418 <attribute name="FILENAME"/>\r
419 <attribute name="FILEEXT" default="s"/>\r
420\r
5fc17c92 421 <element name="EXTRA.INC.1" optional="yes"/>\r
422 <element name="EXTRA.ARG.1" optional="yes"/>\r
878ddf1f 423\r
424 <sequential>\r
22e0585c 425 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
878ddf1f 426\r
427 <if>\r
22e0585c 428 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 429 <then>\r
22e0585c 430 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">\r
431 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
adb6105a 432 <input file="${DEST_DIR_DEBUG}/AutoGen.h"/>\r
5fc17c92 433 <EXTRA.INC.1/>\r
878ddf1f 434 </makedeps>\r
435 </then>\r
436 </if>\r
437\r
438 <OnDependency>\r
439 <sourcefiles>\r
22e0585c 440 <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
878ddf1f 441 </sourcefiles>\r
442 <targetfiles>\r
22e0585c 443 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 444 </targetfiles>\r
445\r
446 <sequential>\r
878ddf1f 447 <cc userdefine="on">\r
32c8b5a9 448 <command type="PP" cmd="${PP}" workdir="${DEST_DIR_OUTPUT}/@{FILEPATH}" family="${PP_FAMILY}" dpath="${PP_DPATH}">\r
5fc17c92 449 <EXTRA.INC.1/>\r
878ddf1f 450 <argument value="${PP_FLAGS}"/>\r
3fc9d866 451 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 452 </command>\r
453 </cc>\r
5fc17c92 454 \r
878ddf1f 455 <cc userdefine="on">\r
5fc17c92 456 <command type="ASM" cmd="${ASM}" workdir="${DEST_DIR_OUTPUT}" family="${ASM_FAMILY}"\r
32c8b5a9 457 includepathDelimiter="-I" outputDelimiter="-o" dpath="${ASM_DPATH}"\r
5fc17c92 458 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">\r
459 <EXTRA.INC.1/>\r
878ddf1f 460 <argument value="${ASM_FLAGS}"/>\r
5fc17c92 461 <EXTRA.ARG.1/>\r
3fc9d866 462 <fileset casesensitive="on" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"/>\r
878ddf1f 463 </command>\r
464 </cc>\r
465 </sequential>\r
466 </OnDependency>\r
32a47954 467 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->\r
468 <if>\r
469 <equals arg1="@{FILEPATH}" arg2="." />\r
470 <then>\r
471 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}.obj" />\r
472 </then>\r
473 <else>\r
474 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}.obj" />\r
475 </else>\r
476 </if>\r
878ddf1f 477 </sequential>\r
478 </macrodef>\r
479\r
480\r
481 <macrodef name="Build_IPF_PP_Code">\r
482 <attribute name="FILEPATH"/>\r
483 <attribute name="FILENAME"/>\r
484 <attribute name="FILEEXT" default="i"/>\r
485\r
486 <element name="EXTRA.INC" optional="yes"/>\r
487 <element name="EXTRA.ARG" optional="yes"/>\r
488\r
489 <sequential>\r
22e0585c 490 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
5fc17c92 491 \r
878ddf1f 492 <cc userdefine="on">\r
32c8b5a9 493 <command type="ASM" includepathDelimiter="-I" dpath="${ASM_DPATH}">\r
878ddf1f 494 <includepath path="${WORKSPACE_DIR}"/>\r
495 <includepath path="${MODULE_DIR}"/>\r
22e0585c 496 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 497 <EXTRA.INC/>\r
5fc17c92 498 \r
878ddf1f 499 <argument value="${ASM_FLAGS}"/>\r
500 <EXTRA.ARG/>\r
22e0585c 501 <OutputFile File="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
5fc17c92 502 \r
3fc9d866 503 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 504 </command>\r
505 </cc>\r
878ddf1f 506 </sequential>\r
507 </macrodef>\r
5fc17c92 508 \r
509 \r
510 <!--\r
511 Library private HashMap map = new HashMap();\r
878ddf1f 512 -->\r
5fc17c92 513 <macrodef name="Build_Library">\r
514 <attribute name="FILENAME" />\r
515 <attribute name="FILEEXT" default="obj"/>\r
516 \r
517 <sequential>\r
518 <var name="FILE_BASENAME" value="@{FILENAME}" />\r
519 <var name="FILE_PATH" value="." />\r
2e4af2a1 520 <if>\r
521 <available type="file" file="${DEST_DIR_OUTPUT}/AutoGen.h.obj"/>\r
522 <then>\r
523 <var name="SLINK_FLAGS" value="${SLINK_FLAGS} ${DEST_DIR_OUTPUT}/AutoGen.h.obj"/>\r
524 </then>\r
525 </if>\r
5fc17c92 526 <mkdir dir="${BIN_DIR}"/>\r
878ddf1f 527\r
5fc17c92 528 <OnDependency>\r
529 <sourcefiles>\r
32a47954 530 <fileset dir="${DEST_DIR_OUTPUT}" includes="${OBJECTS}" />\r
5fc17c92 531 </sourcefiles>\r
532 <targetfiles>\r
533 <file name="${BIN_DIR}/@{FILENAME}.lib"/>\r
534 </targetfiles>\r
878ddf1f 535\r
5fc17c92 536 <sequential>\r
537 <cc userdefine="on">\r
538 <command type="SLINK" cmd="${SLINK}" family="${SLINK_FAMILY}"\r
32c8b5a9 539 outputFile="${BIN_DIR}/@{FILENAME}.lib" dpath="${SLINK_DPATH}">\r
5fc17c92 540 <argument value="${SLINK_FLAGS}"/>\r
878ddf1f 541\r
32a47954 542 <fileset dir="${DEST_DIR_OUTPUT}" includes="${OBJECTS}"/>\r
5fc17c92 543 </command>\r
544 </cc>\r
545 </sequential>\r
546 </OnDependency>\r
878ddf1f 547 </sequential>\r
548 </macrodef>\r
549\r
550 <!--\r
551 Unicode -> .sdb\r
552 -->\r
5fc17c92 553 <macrodef name="Build_UNI">\r
878ddf1f 554 <attribute name="FILEPATH"/>\r
555 <attribute name="FILENAME"/>\r
556 <attribute name="FILEEXT" default="uni"/>\r
557\r
558 <element name="EXTRA.INC" optional="yes"/>\r
559 <element name="EXTRA.ARG" optional="yes"/>\r
560\r
561 <sequential>\r
22e0585c 562 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
878ddf1f 563\r
564 <OnDependency>\r
565 <sourcefiles>\r
22e0585c 566 <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 567 </sourcefiles>\r
568 <targetfiles>\r
22e0585c 569 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 570 </targetfiles>\r
571\r
572 <sequential>\r
573 <strgather commandtype="parse" newdatabase="true">\r
22e0585c 574 <database name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 575 <EXTRA.INC/>\r
576 <EXTRA.ARG/>\r
22e0585c 577 <inputfile name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 578 </strgather>\r
579 </sequential>\r
580 </OnDependency>\r
581\r
5fc17c92 582 <var name="SDB_FILES" value="${SDB_FILES}, ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 583 </sequential>\r
584 </macrodef>\r
585\r
586 <!--\r
587 .sdb(s) -> .c, .h -> .obj\r
588 -->\r
589 <macrodef name="Build_Unicode_Database">\r
590 <attribute name="FILEPATH"/>\r
591 <attribute name="FILENAME"/>\r
592 <attribute name="FILEEXT" default="sdb"/>\r
593\r
594 <element name="EXTRA.INC" optional="yes"/>\r
595 <element name="EXTRA.ARG" optional="yes"/>\r
596\r
597 <sequential>\r
5fc17c92 598 <var name="FILE_BASENAME" value="@{FILENAME}" />\r
599 <var name="FILE_PATH" value="@{FILEPATH}" />\r
878ddf1f 600 <OnDependency>\r
601 <sourcefiles>\r
602 <file list="${SDB_FILES}"/>\r
603 <file list="${SOURCE_FILES}"/>\r
604 </sourcefiles>\r
605 <targetfiles>\r
22e0585c 606 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 607 </targetfiles>\r
5fc17c92 608 \r
878ddf1f 609 <sequential>\r
22e0585c 610 <strgather commandtype="scan" outputdatabase="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb" verbose="read">\r
878ddf1f 611 <skipext name=".uni"/>\r
612 <skipext name=".h"/>\r
613 <database list="${SDB_FILES}"/>\r
614 <inputfile name="${SOURCE_FILES}"/>\r
615 </strgather>\r
616 </sequential>\r
617 </OnDependency>\r
618\r
619 <OnDependency>\r
620 <sourcefiles>\r
22e0585c 621 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 622 </sourcefiles>\r
623 <targetfiles>\r
22e0585c 624 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}StrDefs.h"/>\r
625 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.hpk"/>\r
626 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c"/>\r
878ddf1f 627 </targetfiles>\r
5fc17c92 628 \r
878ddf1f 629 <sequential>\r
630 <strgather basename="@{FILENAME}Strings" commandtype="dump"\r
22e0585c 631 outputdefines="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}StrDefs.h"\r
632 outputhpk="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.hpk"\r
633 outputstring="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c">\r
634 <database name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 635 </strgather>\r
636 </sequential>\r
637 </OnDependency>\r
638\r
639 <OnDependency>\r
640 <sourcefiles>\r
22e0585c 641 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c"/>\r
878ddf1f 642 </sourcefiles>\r
643 <targetfiles>\r
22e0585c 644 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Strings.obj"/>\r
878ddf1f 645 </targetfiles>\r
5fc17c92 646 \r
878ddf1f 647 <sequential>\r
a1c90cf6 648 <!-- Use pre-compiled header if available -->\r
649 <if>\r
650 <and>\r
651 <equals arg1="${CC_FAMILY}" arg2="MSFT" casesensitive="false"/>\r
ac242ae4 652 <available file="${DEST_DIR_OUTPUT}/AutoGen.h.gch"/>\r
a1c90cf6 653 </and>\r
654 <then>\r
ac242ae4 655 <var name="LOCAL_CC_FLAGS" value="${CC_FLAGS} /Yc${DEST_DIR_DEBUG}/AutoGen.h /Yu${DEST_DIR_DEBUG}/AutoGen.h /Fp${DEST_DIR_OUTPUT}/AutoGen.h.gch"/>\r
a1c90cf6 656 </then>\r
657 <else>\r
658 <var name="LOCAL_CC_FLAGS" value="${CC_FLAGS}"/>\r
659 </else>\r
660 </if>\r
661\r
878ddf1f 662 <cc userdefine="on">\r
5fc17c92 663 <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" family="${CC_FAMILY}"\r
32c8b5a9 664 includepathDelimiter="-I" dpath="${CC_DPATH}"\r
5fc17c92 665 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Strings.obj">\r
a1c90cf6 666 <argument value="${LOCAL_CC_FLAGS}"/>\r
5fc17c92 667 <EXTRA.INC />\r
3fc9d866 668 <fileset casesensitive="on" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c"/>\r
878ddf1f 669 </command>\r
670 </cc>\r
671 </sequential>\r
672 </OnDependency>\r
4436ffdc 673\r
32a47954 674 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->\r
675 <if>\r
676 <equals arg1="@{FILEPATH}" arg2="." />\r
677 <then>\r
678 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}Strings.obj" />\r
679 </then>\r
680 <else>\r
681 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}Strings.obj" />\r
682 </else>\r
683 </if>\r
878ddf1f 684 </sequential>\r
685 </macrodef>\r
686\r
687 <!--\r
688 Vfr\r
689 -->\r
5fc17c92 690 <macrodef name="Build_VFR">\r
878ddf1f 691 <attribute name="FILEPATH"/>\r
692 <attribute name="FILENAME"/>\r
693 <attribute name="FILEEXT" default="vfr"/>\r
694\r
695 <element name="EXTRA.INC" optional="yes"/>\r
696 <element name="EXTRA.ARG" optional="yes"/>\r
697\r
698 <sequential>\r
699 <mkdir dir="${DEST_DIR_DEBUG}/@{FILEPATH}"/>\r
700\r
701 <if>\r
22e0585c 702 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 703 <then>\r
22e0585c 704 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">\r
705 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
adb6105a 706 <input file="${DEST_DIR_DEBUG}/AutoGen.h"/>\r
878ddf1f 707 <EXTRA.INC/>\r
708 </makedeps>\r
709 </then>\r
710 </if>\r
711\r
712 <OnDependency>\r
713 <sourcefiles>\r
22e0585c 714 <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
878ddf1f 715 </sourcefiles>\r
716 <targetfiles>\r
22e0585c 717 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 718 </targetfiles>\r
719\r
720 <sequential>\r
32c8b5a9 721 <vfrcompile createIfrBinFile="on" createListFile="on" outPutDir="${DEST_DIR_DEBUG}/@{FILEPATH}" vfrFile="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}">\r
878ddf1f 722 <EXTRA.INC/>\r
723 </vfrcompile>\r
5fc17c92 724 \r
a1c90cf6 725 <!-- Use pre-compiled header if available -->\r
726 <if>\r
727 <and>\r
728 <equals arg1="${CC_FAMILY}" arg2="MSFT" casesensitive="false"/>\r
ac242ae4 729 <available file="${DEST_DIR_OUTPUT}/AutoGen.h.gch"/>\r
a1c90cf6 730 </and>\r
731 <then>\r
ac242ae4 732 <var name="LOCAL_CC_FLAGS" value="${CC_FLAGS} /Yu${DEST_DIR_DEBUG}/AutoGen.h /Fp${DEST_DIR_OUTPUT}/AutoGen.h.gch"/>\r
a1c90cf6 733 </then>\r
734 <else>\r
735 <var name="LOCAL_CC_FLAGS" value="${CC_FLAGS}"/>\r
736 </else>\r
737 </if>\r
738\r
878ddf1f 739 <cc userdefine="on">\r
5fc17c92 740 <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" \r
32c8b5a9 741 includepathDelimiter="-I" family="${CC_FAMILY}" dpath="${CC_DPATH}"\r
5fc17c92 742 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" >\r
a1c90cf6 743 <argument value="${LOCAL_CC_FLAGS}"/>\r
5fc17c92 744 <EXTRA.INC/>\r
878ddf1f 745 <EXTRA.ARG/>\r
3fc9d866 746 <fileset casesensitive="on" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.c"/>\r
878ddf1f 747 </command>\r
748 </cc>\r
878ddf1f 749 </sequential>\r
750 </OnDependency>\r
32a47954 751 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->\r
752 <if>\r
753 <equals arg1="@{FILEPATH}" arg2="." />\r
754 <then>\r
755 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}.obj" />\r
756 </then>\r
757 <else>\r
758 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}.obj" />\r
759 </else>\r
760 </if>\r
878ddf1f 761 </sequential>\r
762 </macrodef>\r
763\r
a99a79e4 764 <!--\r
765 DUMMY\r
766 -->\r
767 <macrodef name="Build_DUMMY">\r
768 <attribute name="FILEPATH"/>\r
769 <attribute name="FILENAME"/>\r
770 <attribute name="FILEEXT"/>\r
771\r
772 <element name="EXTRA.INC" optional="yes"/>\r
773 <element name="EXTRA.ARG" optional="yes"/>\r
774\r
775 <sequential>\r
1a0d7262 776 <echo message="Ignoring ${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" level="info" />\r
a99a79e4 777 </sequential>\r
778 </macrodef>\r
779\r
878ddf1f 780<!--############################################################################\r
781 Build Sections\r
782#############################################################################-->\r
783 <!--\r
784 DLL\r
785 -->\r
786 <macrodef name="GenDll">\r
787 <attribute name="FILEPATH"/>\r
788 <attribute name="FILENAME"/>\r
789 <attribute name="FILEEXT"/>\r
790\r
791 <element name="LIB.ARG" optional="yes"/>\r
792 <element name="LINK.ARG" optional="yes"/>\r
793\r
794 <sequential>\r
5fc17c92 795 <var name="FILE_BASENAME" value="@{FILENAME}" />\r
796 <var name="FILE_PATH" value="@{FILEPATH}" />\r
2e4af2a1 797 <if>\r
798 <available type="file" file="${DEST_DIR_OUTPUT}/AutoGen.h.obj"/>\r
799 <then>\r
800 <var name="SLINK_FLAGS" value="${SLINK_FLAGS} ${DEST_DIR_OUTPUT}/AutoGen.h.obj"/>\r
801 </then>\r
802 </if>\r
878ddf1f 803 <OnDependency>\r
804 <sourcefiles>\r
878ddf1f 805 <file list="${LIBS}"/>\r
32a47954 806 <fileset dir="${DEST_DIR_OUTPUT}" includes="${OBJECTS}" />\r
878ddf1f 807 </sourcefiles>\r
808 <targetfiles>\r
22e0585c 809 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll"/>\r
878ddf1f 810 </targetfiles>\r
811\r
812 <sequential>\r
8b41e66e 813 <cc userdefine="on">\r
32c8b5a9 814 <command type="SLINK" cmd="${SLINK}" family="${SLINK_FAMILY}" dpath="${SLINK_DPATH}"\r
5fc17c92 815 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib">\r
816 <argument value="${SLINK_FLAGS}"/>\r
817\r
32a47954 818 <fileset dir="${DEST_DIR_OUTPUT}" includes="${OBJECTS}"/>\r
8b41e66e 819 </command>\r
820 </cc>\r
878ddf1f 821 <cc userdefine="on">\r
5fc17c92 822 <command type="DLINK" cmd="${DLINK}" family="${DLINK_FAMILY}"\r
32c8b5a9 823 outputFile="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll" dpath="${DLINK_DPATH}" >\r
5fc17c92 824 <argument value="${DLINK_FLAGS}"/>\r
63062e1e 825 <libset libs="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib ${LIBS} ${DLINK_SPATH}"/>\r
878ddf1f 826 <LINK.ARG/>\r
878ddf1f 827 </command>\r
828 </cc>\r
829 </sequential>\r
830 </OnDependency>\r
831 </sequential>\r
832 </macrodef>\r
833\r
834 <!--\r
835 EFI\r
836 -->\r
837 <macrodef name="GenEfi">\r
838 <attribute name="FILEPATH"/>\r
839 <attribute name="FILENAME"/>\r
840 <attribute name="FILEEXT" default="dll"/>\r
841\r
842 <sequential>\r
843 <OnDependency>\r
844 <sourcefiles>\r
22e0585c 845 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 846 </sourcefiles>\r
847 <targetfiles>\r
22e0585c 848 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
878ddf1f 849 </targetfiles>\r
850\r
851 <sequential>\r
5fc17c92 852 <fwimage componentType="${MODULE_TYPE}" outImage="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" \r
22e0585c 853 peImage="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" time="0"/>\r
878ddf1f 854 </sequential>\r
855 </OnDependency>\r
856 </sequential>\r
857 </macrodef>\r
858\r
859<!--\r
860 EFI_SECTION_FREEFORM_SUBTYPE_GUID\r
861 EFI_SECTION_VERSION\r
862 EFI_SECTION_USER_INTERFACE\r
863 EFI_SECTION_DXE_DEPEX\r
864 EFI_SECTION_PEI_DEPEX\r
865 EFI_SECTION_PE32\r
866 EFI_SECTION_PIC\r
867 EFI_SECTION_TE\r
868 EFI_SECTION_RAW\r
869 EFI_SECTION_COMPRESSION\r
870 EFI_SECTION_GUID_DEFINED\r
871 EFI_SECTION_COMPATIBILITY16\r
872 EFI_SECTION_FIRMWARE_VOLUME_IMAGE\r
873 -->\r
874 <!--\r
875 EFI_SECTION_PE32\r
876 -->\r
46dde08c
LG
877\r
878 <macrodef name="EFI_SECTION_TE">\r
879 <attribute name="FILEPATH"/>\r
880 <attribute name="FILENAME"/>\r
881 <attribute name="FILEEXT" default="" />\r
882\r
883 <element name="PRE.PROCESS" optional="yes"/>\r
884 <element name="POST.PROCESS" optional="yes"/>\r
885\r
886 <sequential>\r
887 <PRE.PROCESS/>\r
888 <if>\r
889 <not>\r
890 <equals arg1="${LIBS}" arg2=""/>\r
891 </not>\r
892\r
893 <then>\r
894 <GenDll FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="">\r
895 <LIB.ARG></LIB.ARG>\r
896 <LINK.ARG></LINK.ARG>\r
897 </GenDll>\r
898\r
899 <GenEfi FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="dll"/>\r
900 </then>\r
901 </if>\r
902\r
903 <OnDependency>\r
904 <sourcefiles>\r
905 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
906 </sourcefiles>\r
907 <targetfiles>\r
908 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.tes"/>\r
909 </targetfiles>\r
910\r
911 <sequential>\r
912 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${BIN_DIR}/@{FILENAME}.efi" />\r
913 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${DEST_DIR_DEBUG}/@{FILENAME}.efi" /> \r
914 <genteimage Dump="false" Verbose="false" OutputDir="" OutputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.te" InputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
46dde08c
LG
915 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.te" \r
916 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.tes" \r
917 sectiontype="EFI_SECTION_TE"/>\r
918 <POST.PROCESS/>\r
919 </sequential>\r
920 </OnDependency>\r
921 </sequential>\r
922 </macrodef>\r
923\r
878ddf1f 924 <macrodef name="EFI_SECTION_PE32">\r
925 <attribute name="FILEPATH"/>\r
926 <attribute name="FILENAME"/>\r
927 <attribute name="FILEEXT" default="" />\r
928\r
929 <element name="PRE.PROCESS" optional="yes"/>\r
930 <element name="POST.PROCESS" optional="yes"/>\r
931\r
932 <sequential>\r
933 <PRE.PROCESS/>\r
878ddf1f 934 <if>\r
935 <not>\r
5fc17c92 936 <!-- TBD ${OBJECTS} -->\r
937 <equals arg1="${LIBS}" arg2=""/>\r
878ddf1f 938 </not>\r
939\r
940 <then>\r
941 <GenDll FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="">\r
942 <LIB.ARG></LIB.ARG>\r
943 <LINK.ARG></LINK.ARG>\r
944 </GenDll>\r
0fd9e137 945\r
878ddf1f 946 <GenEfi FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="dll"/>\r
947 </then>\r
948 </if>\r
5fc17c92 949 \r
878ddf1f 950 <OnDependency>\r
951 <sourcefiles>\r
22e0585c 952 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
878ddf1f 953 </sourcefiles>\r
954 <targetfiles>\r
22e0585c 955 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32"/>\r
878ddf1f 956 </targetfiles>\r
957\r
958 <sequential>\r
22e0585c 959 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${BIN_DIR}/@{FILENAME}.efi" />\r
c084fb6e 960 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${DEST_DIR_DEBUG}/@{FILENAME}.efi" />\r
5fc17c92 961 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" \r
962 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32" \r
878ddf1f 963 sectiontype="EFI_SECTION_PE32"/>\r
5fc17c92 964 \r
878ddf1f 965 <POST.PROCESS/>\r
966 </sequential>\r
967 </OnDependency>\r
968 </sequential>\r
969 </macrodef>\r
970\r
971 <!--\r
972 EFI_SECTION_VERSION\r
973 -->\r
974 <macrodef name="EFI_SECTION_VERSION">\r
975 <attribute name="FILEPATH"/>\r
976 <attribute name="FILENAME"/>\r
977 <attribute name="FILEEXT" default="" />\r
978 <attribute name="VERSION" default="0000"/>\r
979\r
980 <element name="PRE.PROCESS" optional="yes"/>\r
981 <element name="POST.PROCESS" optional="yes"/>\r
982\r
983 <sequential>\r
984 <if>\r
985 <not>\r
22e0585c 986 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver"/>\r
878ddf1f 987 </not>\r
988\r
989 <then>\r
990 <PRE.PROCESS/>\r
5fc17c92 991 <gensection outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver" \r
878ddf1f 992 versionnum="@{VERSION}"\r
993 sectiontype="EFI_SECTION_VERSION"/>\r
994 <POST.PROCESS/>\r
995 </then>\r
996 </if>\r
997 </sequential>\r
998 </macrodef>\r
999\r
1000 <!--\r
1001 EFI_SECTION_USER_INTERFACE\r
1002 -->\r
1003 <macrodef name="EFI_SECTION_USER_INTERFACE">\r
1004 <attribute name="FILEPATH"/>\r
1005 <attribute name="FILENAME"/>\r
1006 <attribute name="FILEEXT" default="" />\r
1007 <attribute name="UI" default="${BASE_NAME}"/>\r
1008\r
1009 <element name="PRE.PROCESS" optional="yes"/>\r
1010 <element name="POST.PROCESS" optional="yes"/>\r
1011\r
1012 <sequential>\r
1013 <if>\r
1014 <not>\r
22e0585c 1015 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui"/>\r
878ddf1f 1016 </not>\r
1017\r
1018 <then>\r
1019 <PRE.PROCESS/>\r
1020 <gensection interfacestring="@{UI}"\r
5fc17c92 1021 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui" \r
878ddf1f 1022 sectiontype="EFI_SECTION_USER_INTERFACE"/>\r
1023 <POST.PROCESS/>\r
1024 </then>\r
1025 </if>\r
1026 </sequential>\r
1027 </macrodef>\r
1028\r
878ddf1f 1029 <!--\r
1030 EFI_SECTION_DXE_DEPEX\r
1031 -->\r
1032 <macrodef name="EFI_SECTION_DXE_DEPEX">\r
1033 <attribute name="FILEPATH"/>\r
1034 <attribute name="FILENAME"/>\r
1035 <attribute name="FILEEXT" default="dxs"/>\r
1036\r
1037 <element name="PRE.PROCESS" optional="yes"/>\r
1038 <element name="POST.PROCESS" optional="yes"/>\r
1039\r
1040 <sequential>\r
1041 <PRE.PROCESS/>\r
1042\r
1043 <if>\r
5fc17c92 1044 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 1045 <then>\r
1046 <OnDependency>\r
1047 <sourcefiles>\r
5fc17c92 1048 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 1049 </sourcefiles>\r
1050 <targetfiles>\r
22e0585c 1051 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1052 </targetfiles>\r
1053 <sequential>\r
5fc17c92 1054 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.depex" \r
1055 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx" \r
878ddf1f 1056 sectiontype="EFI_SECTION_DXE_DEPEX"/>\r
1057 </sequential>\r
1058 </OnDependency>\r
1059 </then>\r
1060 <else>\r
1061 <if>\r
1062 <not>\r
22e0585c 1063 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1064 </not>\r
1065 <then>\r
22e0585c 1066 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1067 </then>\r
1068 </if>\r
1069 </else>\r
1070 </if>\r
1071\r
1072 <POST.PROCESS/>\r
1073 </sequential>\r
1074 </macrodef>\r
1075\r
1076 <!--\r
1077 EFI_SECTION_PEI_DEPEX\r
1078 -->\r
1079 <macrodef name="EFI_SECTION_PEI_DEPEX">\r
1080 <attribute name="FILEPATH"/>\r
1081 <attribute name="FILENAME"/>\r
1082 <attribute name="FILEEXT" default="dxs"/>\r
1083\r
1084 <element name="PRE.PROCESS" optional="yes"/>\r
1085 <element name="POST.PROCESS" optional="yes"/>\r
1086 <sequential>\r
1087 <PRE.PROCESS/>\r
1088 <if>\r
5fc17c92 1089 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 1090 <then>\r
1091 <OnDependency>\r
1092 <sourcefiles>\r
5fc17c92 1093 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 1094 </sourcefiles>\r
1095 <targetfiles>\r
22e0585c 1096 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1097 </targetfiles>\r
1098\r
1099 <sequential>\r
5fc17c92 1100 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.depex" \r
1101 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx" \r
878ddf1f 1102 sectiontype="EFI_SECTION_PEI_DEPEX"/>\r
1103 </sequential>\r
1104 </OnDependency>\r
5fc17c92 1105 \r
878ddf1f 1106 </then>\r
1107 <else>\r
1108 <if>\r
1109 <not>\r
22e0585c 1110 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1111 </not>\r
1112 <then>\r
22e0585c 1113 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1114 </then>\r
1115 </if>\r
1116 </else>\r
1117 </if>\r
1118 <POST.PROCESS/>\r
1119 </sequential>\r
1120 </macrodef>\r
1121\r
878ddf1f 1122\r
1123 <!--\r
1124 EFI_SECTION_RAW\r
1125 -->\r
1126 <macrodef name="EFI_SECTION_RAW">\r
1127 <attribute name="FILEPATH"/>\r
1128 <attribute name="FILENAME"/>\r
1129 <attribute name="FILEEXT" default="bin"/>\r
1130\r
1131 <element name="PRE.PROCESS" optional="yes"/>\r
1132 <element name="POST.PROCESS" optional="yes"/>\r
1133\r
1134 <sequential>\r
1135 <OnDependency>\r
1136 <sourcefiles>\r
22e0585c 1137 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 1138 </sourcefiles>\r
1139 <targetfiles>\r
22e0585c 1140 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>\r
878ddf1f 1141 </targetfiles>\r
1142\r
1143 <sequential>\r
1144 <PRE.PROCESS/>\r
5fc17c92 1145 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}" \r
1146 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.sec" \r
878ddf1f 1147 sectiontype="EFI_SECTION_RAW"/>\r
1148 <POST.PROCESS/>\r
1149 </sequential>\r
1150 </OnDependency>\r
1151 </sequential>\r
1152 </macrodef>\r
1153\r
878ddf1f 1154 <!--\r
1155 EFI_SECTION_FIRMWARE_VOLUME_IMAGE\r
1156 -->\r
1157 <macrodef name="EFI_SECTION_FIRMWARE_VOLUME_IMAGE">\r
1158 <attribute name="FILEPATH"/>\r
1159 <attribute name="FILENAME"/>\r
1160 <attribute name="FILEEXT" default="fv"/>\r
1161\r
1162 <element name="PRE.PROCESS" optional="yes"/>\r
1163 <element name="POST.PROCESS" optional="yes"/>\r
1164\r
1165 <sequential>\r
1166 <OnDependency>\r
1167 <sourcefiles>\r
22e0585c 1168 <file name="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 1169 </sourcefiles>\r
1170 <targetfiles>\r
22e0585c 1171 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec"/>\r
878ddf1f 1172 </targetfiles>\r
1173\r
1174 <sequential>\r
1175 <PRE.PROCESS/>\r
5fc17c92 1176 \r
1177 <copy file="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
1178 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
878ddf1f 1179 overwrite="true"/>\r
5fc17c92 1180 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
1181 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec" \r
878ddf1f 1182 sectiontype="EFI_SECTION_FIRMWARE_VOLUME_IMAGE"/>\r
5fc17c92 1183 \r
878ddf1f 1184 <POST.PROCESS/>\r
1185 </sequential>\r
1186 </OnDependency>\r
1187 </sequential>\r
1188 </macrodef>\r
1189\r
1190 <!--\r
1191 Binary\r
1192 -->\r
1193 <macrodef name="Build_Binary">\r
1194 <attribute name="FILEPATH"/>\r
1195 <attribute name="FILENAME"/>\r
1196 <attribute name="FILEEXT" default="bin"/>\r
1197\r
1198 <element name="EXTRA.INC" optional="yes"/>\r
1199 <element name="EXTRA.ARG" optional="yes"/>\r
1200\r
1201 <sequential>\r
5fc17c92 1202 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
22e0585c 1203 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.bin"/>\r
878ddf1f 1204 </sequential>\r
1205 </macrodef>\r
473f57d4 1206 <!--\r
1207 Microcode\r
1208 -->\r
1209 <macrodef name="Build_MICROCODE">\r
1210 <attribute name="FILEPATH"/>\r
1211 <attribute name="FILENAME"/>\r
1212 <attribute name="FILEEXT" default="TXT"/>\r
1213\r
1214 <element name="EXTRA.INC" optional="yes"/>\r
1215 <element name="EXTRA.ARG" optional="yes"/>\r
1216\r
1217 <sequential>\r
50017606 1218 <mkdir dir="${TARGET_DIR}/Microcode"/>\r
1219 <flashmap MCIFile="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" MCOFILE="${TARGET_DIR}/Microcode/@{FILENAME}.bin"/>\r
473f57d4 1220 </sequential>\r
1221 </macrodef> \r
878ddf1f 1222\r
1223 <!--\r
1224 Graphics (bmp, ...)\r
1225 -->\r
1226 <macrodef name="Build_Graphics">\r
1227 <attribute name="FILEPATH"/>\r
473f57d4 1228 <attribute name="FILENAME"/> \r
878ddf1f 1229 <attribute name="FILEEXT" default="bmp"/>\r
1230\r
1231 <element name="EXTRA.INC" optional="yes"/>\r
1232 <element name="EXTRA.ARG" optional="yes"/>\r
1233\r
1234 <sequential>\r
5fc17c92 1235 <mkdir dir="${MODULE_DIR}/@{FILEPATH}" /> \r
1236 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
22e0585c 1237 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.bin"/>\r
878ddf1f 1238 </sequential>\r
5fc17c92 1239 </macrodef> \r
878ddf1f 1240 <macrodef name="Build_EFI">\r
1241 <attribute name="FILEPATH"/>\r
1242 <attribute name="FILENAME"/>\r
1243 <attribute name="FILEEXT" default="efi"/>\r
1244\r
1245 <element name="EXTRA.INC" optional="yes"/>\r
1246 <element name="EXTRA.ARG" optional="yes"/>\r
1247\r
1248 <sequential>\r
5fc17c92 1249 <mkdir dir="${MODULE_DIR}/@{FILEPATH}" /> \r
1250 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
22e0585c 1251 tofile="${DEST_DIR_OUTPUT}/${BASE_NAME}.efi"/>\r
878ddf1f 1252 </sequential>\r
1253 </macrodef>\r
1254</project>\r