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