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