Changed the way of using precompiled header in the build process. Now the use of...
[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
60 <move file="${DEST_DIR_OUTPUT}/AutoGen.h.obj" tofile="${DEST_DIR_OUTPUT}/AutoGen.h.gch" overwrite="true"/>\r
61 </then>\r
62 <else>\r
63 <var name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/AutoGen.h.obj"/>\r
64 </else>\r
65 </if>\r
66 </sequential>\r
67 </OnDependency>\r
68 </then>\r
69 </if>\r
88f858a1 70 </sequential>\r
71 </macrodef>\r
72\r
73\r
878ddf1f 74 <!--\r
75 macro definitions for building files with different types\r
76 -->\r
77 <!--\r
78 C Code\r
79 -->\r
5fc17c92 80 <macrodef name="Build_CCode">\r
878ddf1f 81 <attribute name="FILEPATH"/>\r
82 <attribute name="FILENAME"/>\r
83 <attribute name="FILEEXT" default="c"/>\r
5fc17c92 84 \r
878ddf1f 85 <element name="EXTRA.INC" optional="yes"/>\r
86 <element name="EXTRA.ARG" optional="yes"/>\r
5fc17c92 87 \r
878ddf1f 88 <sequential>\r
5fc17c92 89 <var name="FILE_BASENAME" value="@{FILENAME}" />\r
90 <var name="FILE_PATH" value="@{FILEPATH}" />\r
22e0585c 91 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
878ddf1f 92\r
93 <if>\r
22e0585c 94 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 95 <then>\r
22e0585c 96 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">\r
97 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
98 <input file="${DEST_DIR_DEBUG}/AutoGen.h"/>\r
878ddf1f 99 <EXTRA.INC/>\r
100 </makedeps>\r
101 </then>\r
102 </if>\r
103\r
104 <OnDependency>\r
105 <sourcefiles>\r
22e0585c 106 <file ListFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
878ddf1f 107 </sourcefiles>\r
108 <targetfiles>\r
22e0585c 109 <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 110 </targetfiles>\r
111\r
112 <sequential>\r
113 <cc userdefine="on">\r
5fc17c92 114 <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" family="${CC_FAMILY}"\r
32c8b5a9 115 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" dpath="${CC_DPATH}">\r
878ddf1f 116 <EXTRA.INC/>\r
1549f516 117 <argument value="${CC_FLAGS}"/>\r
878ddf1f 118 <EXTRA.ARG/>\r
3fc9d866 119 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 120 </command>\r
121 </cc>\r
122 </sequential>\r
123 </OnDependency>\r
32a47954 124 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->\r
125 <if>\r
126 <equals arg1="@{FILEPATH}" arg2="." />\r
127 <then>\r
128 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}.obj" />\r
129 </then>\r
130 <else>\r
131 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}.obj" />\r
132 </else>\r
133 </if>\r
878ddf1f 134 </sequential>\r
135 </macrodef>\r
136\r
137\r
138 <macrodef name="Build_AUTOGEN">\r
139 <attribute name="FILEPATH"/>\r
140 <attribute name="FILENAME"/>\r
141 <attribute name="FILEEXT" default="c"/>\r
142\r
143 <element name="EXTRA.INC" optional="yes"/>\r
144 <element name="EXTRA.ARG" optional="yes"/>\r
145\r
146 <sequential>\r
5fc17c92 147 <var name="FILE_BASENAME" value="@{FILENAME}" />\r
148 <var name="FILE_PATH" value="@{FILEPATH}" />\r
22e0585c 149 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
878ddf1f 150\r
151 <if>\r
22e0585c 152 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 153 <then>\r
22e0585c 154 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">\r
155 <input file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
156 <input file="${DEST_DIR_DEBUG}/AutoGen.h"/>\r
878ddf1f 157 <EXTRA.INC/>\r
158 </makedeps>\r
159 </then>\r
160 </if>\r
161\r
162 <OnDependency>\r
163 <sourcefiles>\r
22e0585c 164 <file ListFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
878ddf1f 165 </sourcefiles>\r
166 <targetfiles>\r
22e0585c 167 <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 168 </targetfiles>\r
169\r
170 <sequential>\r
171 <cc userdefine="on">\r
5fc17c92 172 <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" family="${CC_FAMILY}"\r
32c8b5a9 173 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" dpath="${CC_DPATH}">\r
878ddf1f 174 <EXTRA.INC/>\r
1549f516 175 <argument value="${CC_FLAGS}"/>\r
878ddf1f 176 <EXTRA.ARG/>\r
3fc9d866 177 <fileset casesensitive="on" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 178 </command>\r
179 </cc>\r
180 </sequential>\r
181 </OnDependency>\r
32a47954 182 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->\r
183 <if>\r
184 <equals arg1="@{FILEPATH}" arg2="." />\r
185 <then>\r
186 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}.obj" />\r
187 </then>\r
188 <else>\r
189 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}.obj" />\r
190 </else>\r
191 </if>\r
878ddf1f 192 </sequential>\r
193 </macrodef>\r
194\r
5fc17c92 195 <macrodef name="Build_DPX">\r
878ddf1f 196 <attribute name="FILEPATH"/>\r
197 <attribute name="FILENAME"/>\r
198 <attribute name="FILEEXT" default="dxs"/>\r
199\r
200 <element name="EXTRA.INC" optional="yes"/>\r
201 <element name="EXTRA.ARG" optional="yes"/>\r
5fc17c92 202 \r
878ddf1f 203\r
204 <sequential>\r
5fc17c92 205 <var name="FILE_BASENAME" value="@{FILENAME}" />\r
206 <var name="FILE_PATH" value="@{FILEPATH}" />\r
22e0585c 207 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
878ddf1f 208\r
209 <OnDependency>\r
210 <sourcefiles>\r
22e0585c 211 <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 212 </sourcefiles>\r
213 <targetfiles>\r
5fc17c92 214 <file name="${DEST_DIR_OUTPUT}/${BASE_NAME}.depex"/>\r
878ddf1f 215 </targetfiles>\r
216\r
217 <sequential>\r
878ddf1f 218 <cc userdefine="on">\r
df569f61 219 <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}/@{FILEPATH}" family="${CC_FAMILY}"\r
32c8b5a9 220 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i" dpath="${CC_DPATH}">\r
878ddf1f 221 <EXTRA.INC/>\r
222 <argument value="${PP_FLAGS}"/>\r
3fc9d866 223 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 224 </command>\r
225 </cc>\r
5fc17c92 226 \r
df569f61 227 <gendepex inputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i" outputFile="${DEST_DIR_OUTPUT}/${BASE_NAME}.depex"/>\r
878ddf1f 228 </sequential>\r
229 </OnDependency>\r
230 </sequential>\r
231 </macrodef>\r
5fc17c92 232 \r
233 <macrodef name="Build_ASM">\r
878ddf1f 234 <attribute name="FILEPATH"/>\r
235 <attribute name="FILENAME"/>\r
236 <attribute name="FILEEXT" default="asm"/>\r
237\r
238 <element name="EXTRA.INC" optional="yes"/>\r
239 <element name="EXTRA.ARG" optional="yes"/>\r
5fc17c92 240 \r
241 <!-- Dispath ASM file, there are three type. \r
df569f61 242 asm - Build_Assembly\r
243 S - Build_Gcc_Assembly\r
244 s - Build_Ipf_Assembly -->\r
878ddf1f 245 <sequential>\r
5fc17c92 246 <if>\r
df569f61 247 <equals arg1="@{FILEEXT}" arg2="asm" />\r
5fc17c92 248 <then>\r
249 <Build_Assembly FILEPATH="@{FILEPATH}" FILENAME="@{FILENAME}" FILEEXT="@{FILEEXT}">\r
250 <EXTRA.INC.1><EXTRA.INC /></EXTRA.INC.1>\r
251 <EXTRA.ARG.1><EXTRA.ARG /></EXTRA.ARG.1>\r
252 </Build_Assembly>\r
253 </then>\r
df569f61 254 <elseif>\r
255 <equals arg1="@{FILEEXT}" arg2="S" />\r
256 <then>\r
257 <Build_Gcc_Assembly FILEPATH="@{FILEPATH}" FILENAME="@{FILENAME}" FILEEXT="@{FILEEXT}">\r
258 <EXTRA.INC.1><EXTRA.INC /></EXTRA.INC.1>\r
259 <EXTRA.ARG.1><EXTRA.ARG /></EXTRA.ARG.1>\r
260 </Build_Gcc_Assembly>\r
261 </then>\r
262 </elseif>\r
5fc17c92 263 <elseif>\r
25832ed3 264 <equals arg1="@{FILEEXT}" arg2="s" />\r
5fc17c92 265 <then>\r
266 <Build_IPF_Assembly_Code FILEPATH="@{FILEPATH}" FILENAME="@{FILENAME}" FILEEXT="@{FILEEXT}">\r
267 <EXTRA.INC.1><EXTRA.INC /></EXTRA.INC.1>\r
268 <EXTRA.ARG.1><EXTRA.ARG /></EXTRA.ARG.1>\r
269 </Build_IPF_Assembly_Code>\r
270 </then>\r
271 </elseif>\r
272 </if>\r
878ddf1f 273 </sequential>\r
274 </macrodef>\r
5fc17c92 275 \r
0fd9e137 276 <!--\r
5fc17c92 277 IA32/x64 Assembly\r
0fd9e137 278 -->\r
5fc17c92 279 <macrodef name="Build_Assembly">\r
0fd9e137 280 <attribute name="FILEPATH"/>\r
281 <attribute name="FILENAME"/>\r
282 <attribute name="FILEEXT" default="asm"/>\r
283\r
5fc17c92 284 <element name="EXTRA.INC.1" optional="yes"/>\r
285 <element name="EXTRA.ARG.1" optional="yes"/>\r
0fd9e137 286\r
287 <sequential>\r
5fc17c92 288 <var name="FILE_BASENAME" value="@{FILENAME}" />\r
289 <var name="FILE_PATH" value="@{FILEPATH}" />\r
0fd9e137 290 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
291\r
0fd9e137 292 <OnDependency>\r
293 <sourcefiles>\r
5fc17c92 294 <file Name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
0fd9e137 295 </sourcefiles>\r
296 <targetfiles>\r
297 <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
298 </targetfiles>\r
299\r
300 <sequential>\r
c44794ef 301 <cc userdefine="on">\r
32c8b5a9 302 <command type="PP" cmd="${PP}" workdir="${DEST_DIR_OUTPUT}/@{FILEPATH}" family="${PP_FAMILY}" dpath="${PP_DPATH}">\r
c44794ef 303 <EXTRA.INC.1/>\r
304 <argument value="${PP_FLAGS}"/>\r
3fc9d866 305 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
c44794ef 306 </command>\r
307 </cc>\r
308\r
309 <replaceregexp file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"\r
310 match="^(#line +1 +.*@{FILEPATH}/@{FILENAME}\.@{FILEEXT}&quot;).+\1"\r
311 replace=";"\r
312 flags="gs"/>\r
313 <replaceregexp file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"\r
314 match="^(#line .*)$"\r
315 replace="; \1"\r
316 byline="true"/>\r
317 <replaceregexp file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"\r
318 match="([^_a-zA-Z])0x([0-9a-fA-F]+)"\r
319 replace="\10\2h"\r
320 flags="g"\r
321 byline="true"/>\r
0d2001d3 322\r
0fd9e137 323 <cc userdefine="on">\r
5fc17c92 324 <command type="ASM" cmd="${ASM}" workdir="${DEST_DIR_OUTPUT}" family="${ASM_FAMILY}"\r
32c8b5a9 325 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" dpath="${ASM_DPATH}">\r
5fc17c92 326 <EXTRA.INC.1/>\r
327 \r
0fd9e137 328 <argument value="${ASM_FLAGS}"/>\r
5fc17c92 329 <EXTRA.ARG.1/>\r
330 \r
3fc9d866 331 <fileset casesensitive="on" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"/>\r
75d0c5b1 332 </command>\r
333 </cc>\r
334 </sequential>\r
335 </OnDependency>\r
32a47954 336 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->\r
337 <if>\r
338 <equals arg1="@{FILEPATH}" arg2="." />\r
339 <then>\r
340 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}.obj" />\r
341 </then>\r
342 <else>\r
343 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}.obj" />\r
344 </else>\r
345 </if>\r
75d0c5b1 346 </sequential>\r
df569f61 347 </macrodef>\r
348\r
349 <!--\r
350 Build GCC assembly code\r
351 -->\r
352 <macrodef name="Build_Gcc_Assembly">\r
353 <attribute name="FILEPATH"/>\r
354 <attribute name="FILENAME"/>\r
355 <attribute name="FILEEXT" default="asm"/>\r
356\r
357 <element name="EXTRA.INC.1" optional="yes"/>\r
358 <element name="EXTRA.ARG.1" optional="yes"/>\r
359\r
360 <sequential>\r
361 <var name="FILE_BASENAME" value="@{FILENAME}" />\r
362 <var name="FILE_PATH" value="@{FILEPATH}" />\r
363 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
364\r
365 <OnDependency>\r
366 <sourcefiles>\r
367 <file Name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
368 </sourcefiles>\r
369 <targetfiles>\r
370 <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
371 </targetfiles>\r
372\r
373 <sequential>\r
df569f61 374 <cc userdefine="on">\r
375 <command type="ASM" cmd="${ASM}" workdir="${DEST_DIR_OUTPUT}" family="${ASM_FAMILY}"\r
32c8b5a9 376 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" dpath="${ASM_DPATH}">\r
df569f61 377 <EXTRA.INC.1/>\r
378 \r
379 <argument value="${ASM_FLAGS}"/>\r
380 <EXTRA.ARG.1/>\r
381 \r
3fc9d866 382 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
df569f61 383 </command>\r
384 </cc>\r
385 </sequential>\r
386 </OnDependency>\r
32a47954 387 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->\r
388 <if>\r
389 <equals arg1="@{FILEPATH}" arg2="." />\r
390 <then>\r
391 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}.obj" />\r
392 </then>\r
393 <else>\r
394 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}.obj" />\r
395 </else>\r
396 </if>\r
df569f61 397 </sequential>\r
75d0c5b1 398 </macrodef>\r
399\r
878ddf1f 400 <!--\r
401 IPF Assembly\r
402 -->\r
403 <macrodef name="Build_IPF_Assembly_Code">\r
404 <attribute name="FILEPATH"/>\r
405 <attribute name="FILENAME"/>\r
406 <attribute name="FILEEXT" default="s"/>\r
407\r
5fc17c92 408 <element name="EXTRA.INC.1" optional="yes"/>\r
409 <element name="EXTRA.ARG.1" optional="yes"/>\r
878ddf1f 410\r
411 <sequential>\r
22e0585c 412 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
878ddf1f 413\r
414 <if>\r
22e0585c 415 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 416 <then>\r
22e0585c 417 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">\r
418 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
adb6105a 419 <input file="${DEST_DIR_DEBUG}/AutoGen.h"/>\r
5fc17c92 420 <EXTRA.INC.1/>\r
878ddf1f 421 </makedeps>\r
422 </then>\r
423 </if>\r
424\r
425 <OnDependency>\r
426 <sourcefiles>\r
22e0585c 427 <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
878ddf1f 428 </sourcefiles>\r
429 <targetfiles>\r
22e0585c 430 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 431 </targetfiles>\r
432\r
433 <sequential>\r
878ddf1f 434 <cc userdefine="on">\r
32c8b5a9 435 <command type="PP" cmd="${PP}" workdir="${DEST_DIR_OUTPUT}/@{FILEPATH}" family="${PP_FAMILY}" dpath="${PP_DPATH}">\r
5fc17c92 436 <EXTRA.INC.1/>\r
878ddf1f 437 <argument value="${PP_FLAGS}"/>\r
3fc9d866 438 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 439 </command>\r
440 </cc>\r
5fc17c92 441 \r
878ddf1f 442 <cc userdefine="on">\r
5fc17c92 443 <command type="ASM" cmd="${ASM}" workdir="${DEST_DIR_OUTPUT}" family="${ASM_FAMILY}"\r
32c8b5a9 444 includepathDelimiter="-I" outputDelimiter="-o" dpath="${ASM_DPATH}"\r
5fc17c92 445 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">\r
446 <EXTRA.INC.1/>\r
878ddf1f 447 <argument value="${ASM_FLAGS}"/>\r
5fc17c92 448 <EXTRA.ARG.1/>\r
3fc9d866 449 <fileset casesensitive="on" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"/>\r
878ddf1f 450 </command>\r
451 </cc>\r
452 </sequential>\r
453 </OnDependency>\r
32a47954 454 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->\r
455 <if>\r
456 <equals arg1="@{FILEPATH}" arg2="." />\r
457 <then>\r
458 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}.obj" />\r
459 </then>\r
460 <else>\r
461 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}.obj" />\r
462 </else>\r
463 </if>\r
878ddf1f 464 </sequential>\r
465 </macrodef>\r
466\r
467\r
468 <macrodef name="Build_IPF_PP_Code">\r
469 <attribute name="FILEPATH"/>\r
470 <attribute name="FILENAME"/>\r
471 <attribute name="FILEEXT" default="i"/>\r
472\r
473 <element name="EXTRA.INC" optional="yes"/>\r
474 <element name="EXTRA.ARG" optional="yes"/>\r
475\r
476 <sequential>\r
22e0585c 477 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
5fc17c92 478 \r
878ddf1f 479 <cc userdefine="on">\r
32c8b5a9 480 <command type="ASM" includepathDelimiter="-I" dpath="${ASM_DPATH}">\r
878ddf1f 481 <includepath path="${WORKSPACE_DIR}"/>\r
482 <includepath path="${MODULE_DIR}"/>\r
22e0585c 483 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 484 <EXTRA.INC/>\r
5fc17c92 485 \r
878ddf1f 486 <argument value="${ASM_FLAGS}"/>\r
487 <EXTRA.ARG/>\r
22e0585c 488 <OutputFile File="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
5fc17c92 489 \r
3fc9d866 490 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 491 </command>\r
492 </cc>\r
878ddf1f 493 </sequential>\r
494 </macrodef>\r
5fc17c92 495 \r
496 \r
497 <!--\r
498 Library private HashMap map = new HashMap();\r
878ddf1f 499 -->\r
5fc17c92 500 <macrodef name="Build_Library">\r
501 <attribute name="FILENAME" />\r
502 <attribute name="FILEEXT" default="obj"/>\r
503 \r
504 <sequential>\r
505 <var name="FILE_BASENAME" value="@{FILENAME}" />\r
506 <var name="FILE_PATH" value="." />\r
2e4af2a1 507 <if>\r
508 <available type="file" file="${DEST_DIR_OUTPUT}/AutoGen.h.obj"/>\r
509 <then>\r
510 <var name="SLINK_FLAGS" value="${SLINK_FLAGS} ${DEST_DIR_OUTPUT}/AutoGen.h.obj"/>\r
511 </then>\r
512 </if>\r
5fc17c92 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
2e4af2a1 756 <if>\r
757 <available type="file" file="${DEST_DIR_OUTPUT}/AutoGen.h.obj"/>\r
758 <then>\r
759 <var name="SLINK_FLAGS" value="${SLINK_FLAGS} ${DEST_DIR_OUTPUT}/AutoGen.h.obj"/>\r
760 </then>\r
761 </if>\r
878ddf1f 762 <OnDependency>\r
763 <sourcefiles>\r
878ddf1f 764 <file list="${LIBS}"/>\r
32a47954 765 <fileset dir="${DEST_DIR_OUTPUT}" includes="${OBJECTS}" />\r
878ddf1f 766 </sourcefiles>\r
767 <targetfiles>\r
22e0585c 768 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll"/>\r
878ddf1f 769 </targetfiles>\r
770\r
771 <sequential>\r
8b41e66e 772 <cc userdefine="on">\r
32c8b5a9 773 <command type="SLINK" cmd="${SLINK}" family="${SLINK_FAMILY}" dpath="${SLINK_DPATH}"\r
5fc17c92 774 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib">\r
775 <argument value="${SLINK_FLAGS}"/>\r
776\r
32a47954 777 <fileset dir="${DEST_DIR_OUTPUT}" includes="${OBJECTS}"/>\r
8b41e66e 778 </command>\r
779 </cc>\r
878ddf1f 780 <cc userdefine="on">\r
5fc17c92 781 <command type="DLINK" cmd="${DLINK}" family="${DLINK_FAMILY}"\r
32c8b5a9 782 outputFile="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll" dpath="${DLINK_DPATH}" >\r
5fc17c92 783 <argument value="${DLINK_FLAGS}"/>\r
63062e1e 784 <libset libs="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib ${LIBS} ${DLINK_SPATH}"/>\r
878ddf1f 785 <LINK.ARG/>\r
878ddf1f 786 </command>\r
787 </cc>\r
788 </sequential>\r
789 </OnDependency>\r
790 </sequential>\r
791 </macrodef>\r
792\r
793 <!--\r
794 EFI\r
795 -->\r
796 <macrodef name="GenEfi">\r
797 <attribute name="FILEPATH"/>\r
798 <attribute name="FILENAME"/>\r
799 <attribute name="FILEEXT" default="dll"/>\r
800\r
801 <sequential>\r
802 <OnDependency>\r
803 <sourcefiles>\r
22e0585c 804 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 805 </sourcefiles>\r
806 <targetfiles>\r
22e0585c 807 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
878ddf1f 808 </targetfiles>\r
809\r
810 <sequential>\r
5fc17c92 811 <fwimage componentType="${MODULE_TYPE}" outImage="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" \r
22e0585c 812 peImage="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" time="0"/>\r
878ddf1f 813 </sequential>\r
814 </OnDependency>\r
815 </sequential>\r
816 </macrodef>\r
817\r
818<!--\r
819 EFI_SECTION_FREEFORM_SUBTYPE_GUID\r
820 EFI_SECTION_VERSION\r
821 EFI_SECTION_USER_INTERFACE\r
822 EFI_SECTION_DXE_DEPEX\r
823 EFI_SECTION_PEI_DEPEX\r
824 EFI_SECTION_PE32\r
825 EFI_SECTION_PIC\r
826 EFI_SECTION_TE\r
827 EFI_SECTION_RAW\r
828 EFI_SECTION_COMPRESSION\r
829 EFI_SECTION_GUID_DEFINED\r
830 EFI_SECTION_COMPATIBILITY16\r
831 EFI_SECTION_FIRMWARE_VOLUME_IMAGE\r
832 -->\r
833 <!--\r
834 EFI_SECTION_PE32\r
835 -->\r
46dde08c
LG
836\r
837 <macrodef name="EFI_SECTION_TE">\r
838 <attribute name="FILEPATH"/>\r
839 <attribute name="FILENAME"/>\r
840 <attribute name="FILEEXT" default="" />\r
841\r
842 <element name="PRE.PROCESS" optional="yes"/>\r
843 <element name="POST.PROCESS" optional="yes"/>\r
844\r
845 <sequential>\r
846 <PRE.PROCESS/>\r
847 <if>\r
848 <not>\r
849 <equals arg1="${LIBS}" arg2=""/>\r
850 </not>\r
851\r
852 <then>\r
853 <GenDll FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="">\r
854 <LIB.ARG></LIB.ARG>\r
855 <LINK.ARG></LINK.ARG>\r
856 </GenDll>\r
857\r
858 <GenEfi FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="dll"/>\r
859 </then>\r
860 </if>\r
861\r
862 <OnDependency>\r
863 <sourcefiles>\r
864 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
865 </sourcefiles>\r
866 <targetfiles>\r
867 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.tes"/>\r
868 </targetfiles>\r
869\r
870 <sequential>\r
871 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${BIN_DIR}/@{FILENAME}.efi" />\r
872 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${DEST_DIR_DEBUG}/@{FILENAME}.efi" /> \r
873 <genteimage Dump="false" Verbose="false" OutputDir="" OutputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.te" InputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
46dde08c
LG
874 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.te" \r
875 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.tes" \r
876 sectiontype="EFI_SECTION_TE"/>\r
877 <POST.PROCESS/>\r
878 </sequential>\r
879 </OnDependency>\r
880 </sequential>\r
881 </macrodef>\r
882\r
878ddf1f 883 <macrodef name="EFI_SECTION_PE32">\r
884 <attribute name="FILEPATH"/>\r
885 <attribute name="FILENAME"/>\r
886 <attribute name="FILEEXT" default="" />\r
887\r
888 <element name="PRE.PROCESS" optional="yes"/>\r
889 <element name="POST.PROCESS" optional="yes"/>\r
890\r
891 <sequential>\r
892 <PRE.PROCESS/>\r
878ddf1f 893 <if>\r
894 <not>\r
5fc17c92 895 <!-- TBD ${OBJECTS} -->\r
896 <equals arg1="${LIBS}" arg2=""/>\r
878ddf1f 897 </not>\r
898\r
899 <then>\r
900 <GenDll FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="">\r
901 <LIB.ARG></LIB.ARG>\r
902 <LINK.ARG></LINK.ARG>\r
903 </GenDll>\r
0fd9e137 904\r
878ddf1f 905 <GenEfi FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="dll"/>\r
906 </then>\r
907 </if>\r
5fc17c92 908 \r
878ddf1f 909 <OnDependency>\r
910 <sourcefiles>\r
22e0585c 911 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
878ddf1f 912 </sourcefiles>\r
913 <targetfiles>\r
22e0585c 914 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32"/>\r
878ddf1f 915 </targetfiles>\r
916\r
917 <sequential>\r
22e0585c 918 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${BIN_DIR}/@{FILENAME}.efi" />\r
c084fb6e 919 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${DEST_DIR_DEBUG}/@{FILENAME}.efi" />\r
5fc17c92 920 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" \r
921 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32" \r
878ddf1f 922 sectiontype="EFI_SECTION_PE32"/>\r
5fc17c92 923 \r
878ddf1f 924 <POST.PROCESS/>\r
925 </sequential>\r
926 </OnDependency>\r
927 </sequential>\r
928 </macrodef>\r
929\r
930 <!--\r
931 EFI_SECTION_VERSION\r
932 -->\r
933 <macrodef name="EFI_SECTION_VERSION">\r
934 <attribute name="FILEPATH"/>\r
935 <attribute name="FILENAME"/>\r
936 <attribute name="FILEEXT" default="" />\r
937 <attribute name="VERSION" default="0000"/>\r
938\r
939 <element name="PRE.PROCESS" optional="yes"/>\r
940 <element name="POST.PROCESS" optional="yes"/>\r
941\r
942 <sequential>\r
943 <if>\r
944 <not>\r
22e0585c 945 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver"/>\r
878ddf1f 946 </not>\r
947\r
948 <then>\r
949 <PRE.PROCESS/>\r
5fc17c92 950 <gensection outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver" \r
878ddf1f 951 versionnum="@{VERSION}"\r
952 sectiontype="EFI_SECTION_VERSION"/>\r
953 <POST.PROCESS/>\r
954 </then>\r
955 </if>\r
956 </sequential>\r
957 </macrodef>\r
958\r
959 <!--\r
960 EFI_SECTION_USER_INTERFACE\r
961 -->\r
962 <macrodef name="EFI_SECTION_USER_INTERFACE">\r
963 <attribute name="FILEPATH"/>\r
964 <attribute name="FILENAME"/>\r
965 <attribute name="FILEEXT" default="" />\r
966 <attribute name="UI" default="${BASE_NAME}"/>\r
967\r
968 <element name="PRE.PROCESS" optional="yes"/>\r
969 <element name="POST.PROCESS" optional="yes"/>\r
970\r
971 <sequential>\r
972 <if>\r
973 <not>\r
22e0585c 974 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui"/>\r
878ddf1f 975 </not>\r
976\r
977 <then>\r
978 <PRE.PROCESS/>\r
979 <gensection interfacestring="@{UI}"\r
5fc17c92 980 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui" \r
878ddf1f 981 sectiontype="EFI_SECTION_USER_INTERFACE"/>\r
982 <POST.PROCESS/>\r
983 </then>\r
984 </if>\r
985 </sequential>\r
986 </macrodef>\r
987\r
878ddf1f 988 <!--\r
989 EFI_SECTION_DXE_DEPEX\r
990 -->\r
991 <macrodef name="EFI_SECTION_DXE_DEPEX">\r
992 <attribute name="FILEPATH"/>\r
993 <attribute name="FILENAME"/>\r
994 <attribute name="FILEEXT" default="dxs"/>\r
995\r
996 <element name="PRE.PROCESS" optional="yes"/>\r
997 <element name="POST.PROCESS" optional="yes"/>\r
998\r
999 <sequential>\r
1000 <PRE.PROCESS/>\r
1001\r
1002 <if>\r
5fc17c92 1003 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 1004 <then>\r
1005 <OnDependency>\r
1006 <sourcefiles>\r
5fc17c92 1007 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 1008 </sourcefiles>\r
1009 <targetfiles>\r
22e0585c 1010 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1011 </targetfiles>\r
1012 <sequential>\r
5fc17c92 1013 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.depex" \r
1014 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx" \r
878ddf1f 1015 sectiontype="EFI_SECTION_DXE_DEPEX"/>\r
1016 </sequential>\r
1017 </OnDependency>\r
1018 </then>\r
1019 <else>\r
1020 <if>\r
1021 <not>\r
22e0585c 1022 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1023 </not>\r
1024 <then>\r
22e0585c 1025 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1026 </then>\r
1027 </if>\r
1028 </else>\r
1029 </if>\r
1030\r
1031 <POST.PROCESS/>\r
1032 </sequential>\r
1033 </macrodef>\r
1034\r
1035 <!--\r
1036 EFI_SECTION_PEI_DEPEX\r
1037 -->\r
1038 <macrodef name="EFI_SECTION_PEI_DEPEX">\r
1039 <attribute name="FILEPATH"/>\r
1040 <attribute name="FILENAME"/>\r
1041 <attribute name="FILEEXT" default="dxs"/>\r
1042\r
1043 <element name="PRE.PROCESS" optional="yes"/>\r
1044 <element name="POST.PROCESS" optional="yes"/>\r
1045 <sequential>\r
1046 <PRE.PROCESS/>\r
1047 <if>\r
5fc17c92 1048 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 1049 <then>\r
1050 <OnDependency>\r
1051 <sourcefiles>\r
5fc17c92 1052 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 1053 </sourcefiles>\r
1054 <targetfiles>\r
22e0585c 1055 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1056 </targetfiles>\r
1057\r
1058 <sequential>\r
5fc17c92 1059 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.depex" \r
1060 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx" \r
878ddf1f 1061 sectiontype="EFI_SECTION_PEI_DEPEX"/>\r
1062 </sequential>\r
1063 </OnDependency>\r
5fc17c92 1064 \r
878ddf1f 1065 </then>\r
1066 <else>\r
1067 <if>\r
1068 <not>\r
22e0585c 1069 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1070 </not>\r
1071 <then>\r
22e0585c 1072 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1073 </then>\r
1074 </if>\r
1075 </else>\r
1076 </if>\r
1077 <POST.PROCESS/>\r
1078 </sequential>\r
1079 </macrodef>\r
1080\r
878ddf1f 1081\r
1082 <!--\r
1083 EFI_SECTION_RAW\r
1084 -->\r
1085 <macrodef name="EFI_SECTION_RAW">\r
1086 <attribute name="FILEPATH"/>\r
1087 <attribute name="FILENAME"/>\r
1088 <attribute name="FILEEXT" default="bin"/>\r
1089\r
1090 <element name="PRE.PROCESS" optional="yes"/>\r
1091 <element name="POST.PROCESS" optional="yes"/>\r
1092\r
1093 <sequential>\r
1094 <OnDependency>\r
1095 <sourcefiles>\r
22e0585c 1096 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 1097 </sourcefiles>\r
1098 <targetfiles>\r
22e0585c 1099 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>\r
878ddf1f 1100 </targetfiles>\r
1101\r
1102 <sequential>\r
1103 <PRE.PROCESS/>\r
5fc17c92 1104 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}" \r
1105 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.sec" \r
878ddf1f 1106 sectiontype="EFI_SECTION_RAW"/>\r
1107 <POST.PROCESS/>\r
1108 </sequential>\r
1109 </OnDependency>\r
1110 </sequential>\r
1111 </macrodef>\r
1112\r
878ddf1f 1113 <!--\r
1114 EFI_SECTION_FIRMWARE_VOLUME_IMAGE\r
1115 -->\r
1116 <macrodef name="EFI_SECTION_FIRMWARE_VOLUME_IMAGE">\r
1117 <attribute name="FILEPATH"/>\r
1118 <attribute name="FILENAME"/>\r
1119 <attribute name="FILEEXT" default="fv"/>\r
1120\r
1121 <element name="PRE.PROCESS" optional="yes"/>\r
1122 <element name="POST.PROCESS" optional="yes"/>\r
1123\r
1124 <sequential>\r
1125 <OnDependency>\r
1126 <sourcefiles>\r
22e0585c 1127 <file name="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 1128 </sourcefiles>\r
1129 <targetfiles>\r
22e0585c 1130 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec"/>\r
878ddf1f 1131 </targetfiles>\r
1132\r
1133 <sequential>\r
1134 <PRE.PROCESS/>\r
5fc17c92 1135 \r
1136 <copy file="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
1137 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
878ddf1f 1138 overwrite="true"/>\r
5fc17c92 1139 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
1140 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec" \r
878ddf1f 1141 sectiontype="EFI_SECTION_FIRMWARE_VOLUME_IMAGE"/>\r
5fc17c92 1142 \r
878ddf1f 1143 <POST.PROCESS/>\r
1144 </sequential>\r
1145 </OnDependency>\r
1146 </sequential>\r
1147 </macrodef>\r
1148\r
1149 <!--\r
1150 Binary\r
1151 -->\r
1152 <macrodef name="Build_Binary">\r
1153 <attribute name="FILEPATH"/>\r
1154 <attribute name="FILENAME"/>\r
1155 <attribute name="FILEEXT" default="bin"/>\r
1156\r
1157 <element name="EXTRA.INC" optional="yes"/>\r
1158 <element name="EXTRA.ARG" optional="yes"/>\r
1159\r
1160 <sequential>\r
5fc17c92 1161 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
22e0585c 1162 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.bin"/>\r
878ddf1f 1163 </sequential>\r
1164 </macrodef>\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
1185 <macrodef name="Build_Graphics">\r
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
878ddf1f 1199 <macrodef name="Build_EFI">\r
1200 <attribute name="FILEPATH"/>\r
1201 <attribute name="FILENAME"/>\r
1202 <attribute name="FILEEXT" default="efi"/>\r
1203\r
1204 <element name="EXTRA.INC" optional="yes"/>\r
1205 <element name="EXTRA.ARG" optional="yes"/>\r
1206\r
1207 <sequential>\r
5fc17c92 1208 <mkdir dir="${MODULE_DIR}/@{FILEPATH}" /> \r
1209 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
22e0585c 1210 tofile="${DEST_DIR_OUTPUT}/${BASE_NAME}.efi"/>\r
878ddf1f 1211 </sequential>\r
1212 </macrodef>\r
1213</project>\r