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