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