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