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