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