1. Refresh applicable library instances after one illegal library instance is removed.
[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
ba3a1cb5 543 <if>\r
544 <equals arg1="${OBJECTS}" arg2="" trim="true"/>\r
545 <then>\r
546 <fail message="No object files"/>\r
547 </then>\r
548 </if>\r
549\r
5fc17c92 550 <OnDependency>\r
551 <sourcefiles>\r
32a47954 552 <fileset dir="${DEST_DIR_OUTPUT}" includes="${OBJECTS}" />\r
5fc17c92 553 </sourcefiles>\r
554 <targetfiles>\r
555 <file name="${BIN_DIR}/@{FILENAME}.lib"/>\r
556 </targetfiles>\r
878ddf1f 557\r
5fc17c92 558 <sequential>\r
559 <cc userdefine="on">\r
560 <command type="SLINK" cmd="${SLINK}" family="${SLINK_FAMILY}"\r
877de749 561 outputFile="${BIN_DIR}/@{FILENAME}.lib" dpath="${SLINK_DPATH}"\r
562 libpath="${SLINK_LIBPATH}" include="${SLINK_INCLUDEPATH}">\r
5fc17c92 563 <argument value="${SLINK_FLAGS}"/>\r
878ddf1f 564\r
32a47954 565 <fileset dir="${DEST_DIR_OUTPUT}" includes="${OBJECTS}"/>\r
5fc17c92 566 </command>\r
567 </cc>\r
568 </sequential>\r
569 </OnDependency>\r
878ddf1f 570 </sequential>\r
571 </macrodef>\r
572\r
573 <!--\r
574 Unicode -> .sdb\r
575 -->\r
5fc17c92 576 <macrodef name="Build_UNI">\r
878ddf1f 577 <attribute name="FILEPATH"/>\r
578 <attribute name="FILENAME"/>\r
579 <attribute name="FILEEXT" default="uni"/>\r
580\r
581 <element name="EXTRA.INC" optional="yes"/>\r
582 <element name="EXTRA.ARG" optional="yes"/>\r
583\r
584 <sequential>\r
22e0585c 585 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
a387de3b 586 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"\r
587 TargetFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb">\r
588 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
589 <EXTRA.INC/>\r
590 </makedeps>\r
878ddf1f 591\r
592 <OnDependency>\r
593 <sourcefiles>\r
a387de3b 594 <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
878ddf1f 595 </sourcefiles>\r
596 <targetfiles>\r
22e0585c 597 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 598 </targetfiles>\r
599\r
600 <sequential>\r
601 <strgather commandtype="parse" newdatabase="true">\r
22e0585c 602 <database name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 603 <EXTRA.INC/>\r
604 <EXTRA.ARG/>\r
22e0585c 605 <inputfile name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 606 </strgather>\r
607 </sequential>\r
608 </OnDependency>\r
609\r
5fc17c92 610 <var name="SDB_FILES" value="${SDB_FILES}, ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 611 </sequential>\r
612 </macrodef>\r
613\r
614 <!--\r
615 .sdb(s) -> .c, .h -> .obj\r
616 -->\r
617 <macrodef name="Build_Unicode_Database">\r
618 <attribute name="FILEPATH"/>\r
619 <attribute name="FILENAME"/>\r
620 <attribute name="FILEEXT" default="sdb"/>\r
621\r
622 <element name="EXTRA.INC" optional="yes"/>\r
623 <element name="EXTRA.ARG" optional="yes"/>\r
624\r
625 <sequential>\r
5fc17c92 626 <var name="FILE_BASENAME" value="@{FILENAME}" />\r
627 <var name="FILE_PATH" value="@{FILEPATH}" />\r
878ddf1f 628 <OnDependency>\r
629 <sourcefiles>\r
630 <file list="${SDB_FILES}"/>\r
631 <file list="${SOURCE_FILES}"/>\r
632 </sourcefiles>\r
633 <targetfiles>\r
22e0585c 634 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 635 </targetfiles>\r
5fc17c92 636 \r
878ddf1f 637 <sequential>\r
22e0585c 638 <strgather commandtype="scan" outputdatabase="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb" verbose="read">\r
878ddf1f 639 <skipext name=".uni"/>\r
640 <skipext name=".h"/>\r
641 <database list="${SDB_FILES}"/>\r
642 <inputfile name="${SOURCE_FILES}"/>\r
643 </strgather>\r
644 </sequential>\r
645 </OnDependency>\r
646\r
647 <OnDependency>\r
648 <sourcefiles>\r
22e0585c 649 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 650 </sourcefiles>\r
651 <targetfiles>\r
22e0585c 652 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}StrDefs.h"/>\r
653 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.hpk"/>\r
654 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c"/>\r
878ddf1f 655 </targetfiles>\r
5fc17c92 656 \r
878ddf1f 657 <sequential>\r
658 <strgather basename="@{FILENAME}Strings" commandtype="dump"\r
22e0585c 659 outputdefines="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}StrDefs.h"\r
660 outputhpk="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.hpk"\r
661 outputstring="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c">\r
662 <database name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 663 </strgather>\r
664 </sequential>\r
665 </OnDependency>\r
666\r
667 <OnDependency>\r
668 <sourcefiles>\r
22e0585c 669 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c"/>\r
20480ea1 670 <file ListFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"/>\r
878ddf1f 671 </sourcefiles>\r
672 <targetfiles>\r
22e0585c 673 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Strings.obj"/>\r
878ddf1f 674 </targetfiles>\r
5fc17c92 675 \r
878ddf1f 676 <sequential>\r
677 <cc userdefine="on">\r
5fc17c92 678 <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" family="${CC_FAMILY}"\r
32c8b5a9 679 includepathDelimiter="-I" dpath="${CC_DPATH}"\r
877de749 680 libpath="${CC_LIBPATH}" include="${CC_INCLUDEPATH}"\r
5fc17c92 681 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Strings.obj">\r
1549f516 682 <argument value="${CC_FLAGS}"/>\r
5fc17c92 683 <EXTRA.INC />\r
3fc9d866 684 <fileset casesensitive="on" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c"/>\r
878ddf1f 685 </command>\r
686 </cc>\r
687 </sequential>\r
688 </OnDependency>\r
4436ffdc 689\r
32a47954 690 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->\r
691 <if>\r
692 <equals arg1="@{FILEPATH}" arg2="." />\r
693 <then>\r
694 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}Strings.obj" />\r
695 </then>\r
696 <else>\r
697 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}Strings.obj" />\r
698 </else>\r
699 </if>\r
878ddf1f 700 </sequential>\r
701 </macrodef>\r
702\r
703 <!--\r
704 Vfr\r
705 -->\r
5fc17c92 706 <macrodef name="Build_VFR">\r
878ddf1f 707 <attribute name="FILEPATH"/>\r
708 <attribute name="FILENAME"/>\r
709 <attribute name="FILEEXT" default="vfr"/>\r
710\r
711 <element name="EXTRA.INC" optional="yes"/>\r
712 <element name="EXTRA.ARG" optional="yes"/>\r
713\r
714 <sequential>\r
715 <mkdir dir="${DEST_DIR_DEBUG}/@{FILEPATH}"/>\r
716\r
a387de3b 717 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"\r
718 TargetFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">\r
719 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
720 <EXTRA.INC/>\r
721 </makedeps>\r
878ddf1f 722\r
723 <OnDependency>\r
724 <sourcefiles>\r
22e0585c 725 <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
a387de3b 726 <file ListFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"/>\r
878ddf1f 727 </sourcefiles>\r
728 <targetfiles>\r
22e0585c 729 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 730 </targetfiles>\r
731\r
732 <sequential>\r
62f022cc 733 <!-- if "TOOLCHIAN FAMILY" is "GCC", it should point the ouput file for preprocess compiler --> \r
734 <if>\r
735 <equals arg1="${CC_FAMILY}" arg2="GCC"/>\r
736 <then>\r
737 <cc userdefine="on">\r
738 <command type="PP" cmd="${PP}" workdir="${DEST_DIR_OUTPUT}/@{FILEPATH}" family="${PP_FAMILY}" \r
739 dpath="${PP_DPATH}" libpath="${PP_LIBPATH}" include="${PP_INCLUDEPATH}">\r
740 <argument value="${VFRPP_FLAGS} -o ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"/>\r
741 <!-- Output file of the preprocess --> \r
742 <EXTRA.INC/> \r
743 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/> \r
744 </command>\r
745 </cc>\r
746 </then>\r
747 </if>\r
748 \r
749 <if>\r
750 <not>\r
751 <equals arg1="${CC_FAMILY}" arg2="GCC"/>\r
752 </not>\r
753 <then>\r
754 <cc userdefine="on">\r
755 <command type="PP" cmd="${PP}" workdir="${DEST_DIR_OUTPUT}/@{FILEPATH}" family="${PP_FAMILY}" \r
756 dpath="${PP_DPATH}" libpath="${PP_LIBPATH}" include="${PP_INCLUDEPATH}">\r
55cc5329 757 <argument value="${VFRPP_FLAGS} ${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
62f022cc 758 <!-- Output file of the preprocess --> \r
759 <EXTRA.INC/> \r
760 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/> \r
761 </command>\r
762 </cc>\r
763 </then>\r
764 </if>\r
765 \r
b609c89b 766 \r
767 <vfrcompile createIfrBinFile="on" createListFile="on" outPutDir="${DEST_DIR_DEBUG}/@{FILEPATH}" vfrFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i">\r
878ddf1f 768 <EXTRA.INC/>\r
769 </vfrcompile>\r
5fc17c92 770 \r
878ddf1f 771 <cc userdefine="on">\r
5fc17c92 772 <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" \r
32c8b5a9 773 includepathDelimiter="-I" family="${CC_FAMILY}" dpath="${CC_DPATH}"\r
877de749 774 libpath="${CC_LIBPATH}" include="${CC_INCLUDEPATH}"\r
5fc17c92 775 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" >\r
1549f516 776 <argument value="${CC_FLAGS}"/>\r
5fc17c92 777 <EXTRA.INC/>\r
878ddf1f 778 <EXTRA.ARG/>\r
3fc9d866 779 <fileset casesensitive="on" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.c"/>\r
878ddf1f 780 </command>\r
781 </cc>\r
878ddf1f 782 </sequential>\r
783 </OnDependency>\r
32a47954 784 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->\r
785 <if>\r
786 <equals arg1="@{FILEPATH}" arg2="." />\r
787 <then>\r
788 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}.obj" />\r
789 </then>\r
790 <else>\r
791 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}.obj" />\r
792 </else>\r
793 </if>\r
878ddf1f 794 </sequential>\r
795 </macrodef>\r
796\r
706c2ad4 797 <!--\r
798 Build the real mode ASM file\r
799 -->\r
800 <macrodef name="Build_RealAsm">\r
801 <attribute name="FILEPATH"/>\r
802 <attribute name="FILENAME"/>\r
803 <attribute name="FILEEXT" default="asm"/>\r
804\r
805 <element name="EXTRA.INC" optional="yes"/>\r
806 <element name="EXTRA.ARG" optional="yes"/>\r
807 \r
808 <sequential>\r
741fb364
LG
809 <OnDependency>\r
810 <sourcefiles>\r
811 <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
812 </sourcefiles>\r
813 <targetfiles>\r
814 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.cat"/>\r
815 </targetfiles>\r
816 \r
817 <sequential>\r
818 <exec dir="${DEST_DIR_OUTPUT}" executable="${ASM}" failonerror="true">\r
819 <arg line="/nologo /omf ${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT} /Bl${ASMLINK} ${ASMLINK_FLAGS}"/>\r
820 </exec>\r
821 <concat destfile="${DEST_DIR_OUTPUT}/@{FILENAME}.cat" binary="yes">\r
822 <filelist dir="${MODULE_DIR}" files="Blank2.pad"/>\r
823 <filelist dir="${DEST_DIR_OUTPUT}" files="@{FILENAME}.com"/>\r
824 </concat>\r
825 </sequential>\r
826 </OnDependency>\r
706c2ad4 827 </sequential>\r
828 </macrodef>\r
d8022b36
LG
829\r
830 <!--\r
831 Build Asl table file\r
832 -->\r
833 <macrodef name="Build_ASL">\r
834 <attribute name="FILEPATH"/>\r
835 <attribute name="FILENAME"/>\r
836 <attribute name="FILEEXT" default="asl"/>\r
837\r
838 <element name="EXTRA.INC" optional="yes"/>\r
839 <element name="EXTRA.ARG" optional="yes"/>\r
840 \r
841 <sequential>\r
842 <mkdir dir="${DEST_DIR_OUTPUT}"/>\r
843\r
844 <OnDependency>\r
845 <sourcefiles>\r
846 <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
847 </sourcefiles>\r
848 <targetfiles>\r
849 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>\r
850 </targetfiles>\r
851\r
852 <sequential>\r
853 <cc userdefine="on">\r
854 <command type="PP" cmd="${PP}" workdir="${DEST_DIR_OUTPUT}" family="${PP_FAMILY}" \r
855 dpath="${PP_DPATH}" libpath="${PP_LIBPATH}" include="${PP_INCLUDEPATH}">\r
856 <argument value="${APP_FLAGS}"/>\r
857 <EXTRA.INC/> \r
858 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
859 </command>\r
860 </cc>\r
861\r
862 <exec dir="${DEST_DIR_OUTPUT}" executable="${ASL}" failonerror="true" outputproperty="ASL_OUTPUT">\r
863 <arg line="${DEST_DIR_OUTPUT}/@{FILENAME}.i"/>\r
864 </exec>\r
865\r
866 <if>\r
867 <or>\r
868 <contains string="${ASL_OUTPUT}" substring="Supports ACPI Specification Revision 2.0"/>\r
869 <contains string="${ASL_OUTPUT}" substring="Supports ACPI Specification Revision 1.0"/>\r
870 </or>\r
871 <then>\r
872 <fail message="Current Asl tool not support Acpi Spec 3.0. Pls update your Asl compiler."/>\r
873 </then>\r
874 </if>\r
875\r
876 <EFI_SECTION_RAW FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="aml"/>\r
877 \r
878 </sequential>\r
879 </OnDependency>\r
880 </sequential>\r
881 </macrodef> \r
882\r
883 <!--\r
884 Build Asl table c file\r
885 -->\r
886 <macrodef name="Build_CCASL">\r
887 <attribute name="FILEPATH"/>\r
888 <attribute name="FILENAME"/>\r
889 <attribute name="FILEEXT" default="c"/>\r
890\r
891 <element name="EXTRA.INC" optional="yes"/>\r
892 <element name="EXTRA.ARG" optional="yes"/>\r
893 \r
894 <sequential>\r
895 <mkdir dir="${DEST_DIR_OUTPUT}"/>\r
896\r
897 <OnDependency>\r
898 <sourcefiles>\r
899 <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
900 </sourcefiles>\r
901 <targetfiles>\r
902 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>\r
903 </targetfiles>\r
904\r
905 <sequential>\r
906\r
907 <cc userdefine="on">\r
908 <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" family="${CC_FAMILY}"\r
909 outputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.obj" dpath="${CC_DPATH}" \r
910 libpath="${CC_LIBPATH}" include="${CC_INCLUDEPATH}">\r
911 <EXTRA.INC/>\r
912 <argument value="${CC_FLAGS}"/>\r
913 <EXTRA.ARG/>\r
914 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
915 </command>\r
916 </cc>\r
917\r
918 <cc userdefine="on">\r
919 <command type="DLINK" cmd="${DLINK}" family="${DLINK_FAMILY}" \r
920 outputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.exe" dpath="${DLINK_DPATH}" >\r
921 <argument value="${SLINK_FLAGS}"/>\r
922 <fileset casesensitive="on" file="${DEST_DIR_OUTPUT}/@{FILENAME}.obj"/>\r
923 </command>\r
924 </cc>\r
925 \r
926 <genacpitable inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.exe" outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.acpi" /> \r
927 \r
928 <EFI_SECTION_RAW FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="acpi"/>\r
929 </sequential>\r
930 </OnDependency>\r
931 </sequential>\r
932 </macrodef> \r
febc6433 933 <!--\r
934 Build ACPI Bin File\r
935 -->\r
936 <macrodef name="Build_ACPIBIN">\r
937 <attribute name="FILEPATH"/>\r
938 <attribute name="FILENAME"/>\r
939 <attribute name="FILEEXT" default="bin"/>\r
940\r
941 <element name="EXTRA.INC" optional="yes"/>\r
942 <element name="EXTRA.ARG" optional="yes"/>\r
943 \r
944 <sequential>\r
945 <mkdir dir="${DEST_DIR_OUTPUT}"/>\r
d8022b36 946\r
febc6433 947 <OnDependency>\r
948 <sourcefiles>\r
949 <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
950 </sourcefiles>\r
951 <targetfiles>\r
952 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>\r
953 </targetfiles>\r
954\r
955 <sequential>\r
956 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" tofile="${DEST_DIR_OUTPUT}/@{FILENAME}.acpi" />\r
957 \r
958 <exec executable="attrib">\r
959 <arg line="-r ${DEST_DIR_OUTPUT}/@{FILENAME}.acpi"/>\r
960 </exec>\r
961\r
962 <EFI_SECTION_RAW FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="acpi"/>\r
963 </sequential>\r
964 </OnDependency>\r
965 </sequential>\r
966 </macrodef> \r
967 \r
a99a79e4 968 <!--\r
a387de3b 969 DUMMY - for skipping the source file which should not be built\r
a99a79e4 970 -->\r
971 <macrodef name="Build_DUMMY">\r
972 <attribute name="FILEPATH"/>\r
973 <attribute name="FILENAME"/>\r
974 <attribute name="FILEEXT"/>\r
975\r
976 <element name="EXTRA.INC" optional="yes"/>\r
977 <element name="EXTRA.ARG" optional="yes"/>\r
978\r
979 <sequential>\r
7446fb2d 980 <!--echo message="Ignoring ${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" level="info" /-->\r
a99a79e4 981 </sequential>\r
982 </macrodef>\r
983\r
878ddf1f 984<!--############################################################################\r
985 Build Sections\r
986#############################################################################-->\r
987 <!--\r
988 DLL\r
989 -->\r
990 <macrodef name="GenDll">\r
991 <attribute name="FILEPATH"/>\r
992 <attribute name="FILENAME"/>\r
993 <attribute name="FILEEXT"/>\r
994\r
995 <element name="LIB.ARG" optional="yes"/>\r
996 <element name="LINK.ARG" optional="yes"/>\r
997\r
998 <sequential>\r
5fc17c92 999 <var name="FILE_BASENAME" value="@{FILENAME}" />\r
1000 <var name="FILE_PATH" value="@{FILEPATH}" />\r
878ddf1f 1001 <OnDependency>\r
1002 <sourcefiles>\r
878ddf1f 1003 <file list="${LIBS}"/>\r
32a47954 1004 <fileset dir="${DEST_DIR_OUTPUT}" includes="${OBJECTS}" />\r
878ddf1f 1005 </sourcefiles>\r
1006 <targetfiles>\r
22e0585c 1007 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll"/>\r
878ddf1f 1008 </targetfiles>\r
1009\r
1010 <sequential>\r
8b41e66e 1011 <cc userdefine="on">\r
32c8b5a9 1012 <command type="SLINK" cmd="${SLINK}" family="${SLINK_FAMILY}" dpath="${SLINK_DPATH}"\r
877de749 1013 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib"\r
1014 libpath="${SLINKLIBPATH}" include="${SLINK_INCLUDEPATH}">\r
5fc17c92 1015 <argument value="${SLINK_FLAGS}"/>\r
1016\r
32a47954 1017 <fileset dir="${DEST_DIR_OUTPUT}" includes="${OBJECTS}"/>\r
8b41e66e 1018 </command>\r
1019 </cc>\r
878ddf1f 1020 <cc userdefine="on">\r
5fc17c92 1021 <command type="DLINK" cmd="${DLINK}" family="${DLINK_FAMILY}"\r
877de749 1022 outputFile="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll" dpath="${DLINK_DPATH}" \r
1023 libpath="${DLINK_LIBPATH}" include="${DLINK_INCLUDEPATH}">\r
5fc17c92 1024 <argument value="${DLINK_FLAGS}"/>\r
63062e1e 1025 <libset libs="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib ${LIBS} ${DLINK_SPATH}"/>\r
878ddf1f 1026 <LINK.ARG/>\r
878ddf1f 1027 </command>\r
1028 </cc>\r
1029 </sequential>\r
1030 </OnDependency>\r
1031 </sequential>\r
1032 </macrodef>\r
1033\r
1034 <!--\r
1035 EFI\r
1036 -->\r
1037 <macrodef name="GenEfi">\r
1038 <attribute name="FILEPATH"/>\r
1039 <attribute name="FILENAME"/>\r
1040 <attribute name="FILEEXT" default="dll"/>\r
1041\r
1042 <sequential>\r
1043 <OnDependency>\r
1044 <sourcefiles>\r
22e0585c 1045 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 1046 </sourcefiles>\r
1047 <targetfiles>\r
22e0585c 1048 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
878ddf1f 1049 </targetfiles>\r
1050\r
1051 <sequential>\r
5fc17c92 1052 <fwimage componentType="${MODULE_TYPE}" outImage="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" \r
22e0585c 1053 peImage="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" time="0"/>\r
878ddf1f 1054 </sequential>\r
1055 </OnDependency>\r
1056 </sequential>\r
1057 </macrodef>\r
1058\r
1059<!--\r
1060 EFI_SECTION_FREEFORM_SUBTYPE_GUID\r
1061 EFI_SECTION_VERSION\r
1062 EFI_SECTION_USER_INTERFACE\r
1063 EFI_SECTION_DXE_DEPEX\r
1064 EFI_SECTION_PEI_DEPEX\r
1065 EFI_SECTION_PE32\r
1066 EFI_SECTION_PIC\r
1067 EFI_SECTION_TE\r
1068 EFI_SECTION_RAW\r
1069 EFI_SECTION_COMPRESSION\r
1070 EFI_SECTION_GUID_DEFINED\r
1071 EFI_SECTION_COMPATIBILITY16\r
1072 EFI_SECTION_FIRMWARE_VOLUME_IMAGE\r
1073 -->\r
1074 <!--\r
1075 EFI_SECTION_PE32\r
1076 -->\r
46dde08c
LG
1077\r
1078 <macrodef name="EFI_SECTION_TE">\r
1079 <attribute name="FILEPATH"/>\r
1080 <attribute name="FILENAME"/>\r
1081 <attribute name="FILEEXT" default="" />\r
1082\r
1083 <element name="PRE.PROCESS" optional="yes"/>\r
1084 <element name="POST.PROCESS" optional="yes"/>\r
1085\r
1086 <sequential>\r
1087 <PRE.PROCESS/>\r
1088 <if>\r
1089 <not>\r
1090 <equals arg1="${LIBS}" arg2=""/>\r
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
1098\r
1099 <GenEfi FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="dll"/>\r
1100 </then>\r
1101 </if>\r
1102\r
1103 <OnDependency>\r
1104 <sourcefiles>\r
1105 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
1106 </sourcefiles>\r
1107 <targetfiles>\r
1108 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.tes"/>\r
1109 </targetfiles>\r
1110\r
1111 <sequential>\r
1112 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${BIN_DIR}/@{FILENAME}.efi" />\r
1113 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${DEST_DIR_DEBUG}/@{FILENAME}.efi" /> \r
1114 <genteimage Dump="false" Verbose="false" OutputDir="" OutputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.te" InputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
46dde08c
LG
1115 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.te" \r
1116 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.tes" \r
1117 sectiontype="EFI_SECTION_TE"/>\r
1118 <POST.PROCESS/>\r
1119 </sequential>\r
1120 </OnDependency>\r
1121 </sequential>\r
1122 </macrodef>\r
1123\r
878ddf1f 1124 <macrodef name="EFI_SECTION_PE32">\r
1125 <attribute name="FILEPATH"/>\r
1126 <attribute name="FILENAME"/>\r
1127 <attribute name="FILEEXT" default="" />\r
1128\r
1129 <element name="PRE.PROCESS" optional="yes"/>\r
1130 <element name="POST.PROCESS" optional="yes"/>\r
1131\r
1132 <sequential>\r
1133 <PRE.PROCESS/>\r
878ddf1f 1134 <if>\r
1135 <not>\r
5fc17c92 1136 <!-- TBD ${OBJECTS} -->\r
1137 <equals arg1="${LIBS}" arg2=""/>\r
878ddf1f 1138 </not>\r
1139\r
1140 <then>\r
1141 <GenDll FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="">\r
1142 <LIB.ARG></LIB.ARG>\r
1143 <LINK.ARG></LINK.ARG>\r
1144 </GenDll>\r
0fd9e137 1145\r
878ddf1f 1146 <GenEfi FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="dll"/>\r
1147 </then>\r
1148 </if>\r
5fc17c92 1149 \r
878ddf1f 1150 <OnDependency>\r
1151 <sourcefiles>\r
22e0585c 1152 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
878ddf1f 1153 </sourcefiles>\r
1154 <targetfiles>\r
22e0585c 1155 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32"/>\r
878ddf1f 1156 </targetfiles>\r
1157\r
1158 <sequential>\r
22e0585c 1159 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${BIN_DIR}/@{FILENAME}.efi" />\r
c084fb6e 1160 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${DEST_DIR_DEBUG}/@{FILENAME}.efi" />\r
5fc17c92 1161 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" \r
1162 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32" \r
878ddf1f 1163 sectiontype="EFI_SECTION_PE32"/>\r
5fc17c92 1164 \r
878ddf1f 1165 <POST.PROCESS/>\r
1166 </sequential>\r
1167 </OnDependency>\r
1168 </sequential>\r
1169 </macrodef>\r
1170\r
1171 <!--\r
1172 EFI_SECTION_VERSION\r
1173 -->\r
1174 <macrodef name="EFI_SECTION_VERSION">\r
1175 <attribute name="FILEPATH"/>\r
1176 <attribute name="FILENAME"/>\r
1177 <attribute name="FILEEXT" default="" />\r
1178 <attribute name="VERSION" default="0000"/>\r
1179\r
1180 <element name="PRE.PROCESS" optional="yes"/>\r
1181 <element name="POST.PROCESS" optional="yes"/>\r
1182\r
1183 <sequential>\r
1184 <if>\r
1185 <not>\r
22e0585c 1186 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver"/>\r
878ddf1f 1187 </not>\r
1188\r
1189 <then>\r
1190 <PRE.PROCESS/>\r
5fc17c92 1191 <gensection outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver" \r
878ddf1f 1192 versionnum="@{VERSION}"\r
1193 sectiontype="EFI_SECTION_VERSION"/>\r
1194 <POST.PROCESS/>\r
1195 </then>\r
1196 </if>\r
1197 </sequential>\r
1198 </macrodef>\r
1199\r
1200 <!--\r
1201 EFI_SECTION_USER_INTERFACE\r
1202 -->\r
1203 <macrodef name="EFI_SECTION_USER_INTERFACE">\r
1204 <attribute name="FILEPATH"/>\r
1205 <attribute name="FILENAME"/>\r
1206 <attribute name="FILEEXT" default="" />\r
1207 <attribute name="UI" default="${BASE_NAME}"/>\r
1208\r
1209 <element name="PRE.PROCESS" optional="yes"/>\r
1210 <element name="POST.PROCESS" optional="yes"/>\r
1211\r
1212 <sequential>\r
1213 <if>\r
1214 <not>\r
22e0585c 1215 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui"/>\r
878ddf1f 1216 </not>\r
1217\r
1218 <then>\r
1219 <PRE.PROCESS/>\r
1220 <gensection interfacestring="@{UI}"\r
5fc17c92 1221 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui" \r
878ddf1f 1222 sectiontype="EFI_SECTION_USER_INTERFACE"/>\r
1223 <POST.PROCESS/>\r
1224 </then>\r
1225 </if>\r
1226 </sequential>\r
1227 </macrodef>\r
1228\r
878ddf1f 1229 <!--\r
1230 EFI_SECTION_DXE_DEPEX\r
1231 -->\r
1232 <macrodef name="EFI_SECTION_DXE_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\r
1240 <sequential>\r
1241 <PRE.PROCESS/>\r
1242\r
1243 <if>\r
5fc17c92 1244 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 1245 <then>\r
1246 <OnDependency>\r
1247 <sourcefiles>\r
5fc17c92 1248 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 1249 </sourcefiles>\r
1250 <targetfiles>\r
22e0585c 1251 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1252 </targetfiles>\r
1253 <sequential>\r
5fc17c92 1254 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.depex" \r
1255 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx" \r
878ddf1f 1256 sectiontype="EFI_SECTION_DXE_DEPEX"/>\r
1257 </sequential>\r
1258 </OnDependency>\r
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\r
1272 <POST.PROCESS/>\r
1273 </sequential>\r
1274 </macrodef>\r
1275\r
1276 <!--\r
1277 EFI_SECTION_PEI_DEPEX\r
1278 -->\r
1279 <macrodef name="EFI_SECTION_PEI_DEPEX">\r
1280 <attribute name="FILEPATH"/>\r
1281 <attribute name="FILENAME"/>\r
1282 <attribute name="FILEEXT" default="dxs"/>\r
1283\r
1284 <element name="PRE.PROCESS" optional="yes"/>\r
1285 <element name="POST.PROCESS" optional="yes"/>\r
1286 <sequential>\r
1287 <PRE.PROCESS/>\r
1288 <if>\r
5fc17c92 1289 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 1290 <then>\r
1291 <OnDependency>\r
1292 <sourcefiles>\r
5fc17c92 1293 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 1294 </sourcefiles>\r
1295 <targetfiles>\r
22e0585c 1296 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1297 </targetfiles>\r
1298\r
1299 <sequential>\r
5fc17c92 1300 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.depex" \r
1301 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx" \r
878ddf1f 1302 sectiontype="EFI_SECTION_PEI_DEPEX"/>\r
1303 </sequential>\r
1304 </OnDependency>\r
5fc17c92 1305 \r
878ddf1f 1306 </then>\r
1307 <else>\r
1308 <if>\r
1309 <not>\r
22e0585c 1310 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1311 </not>\r
1312 <then>\r
22e0585c 1313 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1314 </then>\r
1315 </if>\r
1316 </else>\r
1317 </if>\r
1318 <POST.PROCESS/>\r
1319 </sequential>\r
1320 </macrodef>\r
1321\r
878ddf1f 1322\r
1323 <!--\r
1324 EFI_SECTION_RAW\r
1325 -->\r
1326 <macrodef name="EFI_SECTION_RAW">\r
1327 <attribute name="FILEPATH"/>\r
1328 <attribute name="FILENAME"/>\r
1329 <attribute name="FILEEXT" default="bin"/>\r
1330\r
1331 <element name="PRE.PROCESS" optional="yes"/>\r
1332 <element name="POST.PROCESS" optional="yes"/>\r
1333\r
1334 <sequential>\r
1335 <OnDependency>\r
1336 <sourcefiles>\r
d8022b36 1337 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 1338 </sourcefiles>\r
1339 <targetfiles>\r
22e0585c 1340 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>\r
878ddf1f 1341 </targetfiles>\r
1342\r
1343 <sequential>\r
1344 <PRE.PROCESS/>\r
d8022b36 1345 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
5fc17c92 1346 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.sec" \r
878ddf1f 1347 sectiontype="EFI_SECTION_RAW"/>\r
1348 <POST.PROCESS/>\r
1349 </sequential>\r
1350 </OnDependency>\r
1351 </sequential>\r
1352 </macrodef>\r
1353\r
706c2ad4 1354 <!--\r
1355 EFI_SECTION_RAW_SEC\r
1356 -->\r
1357 <macrodef name="EFI_SECTION_RAW_SEC">\r
1358 <attribute name="FILEPATH"/>\r
1359 <attribute name="FILENAME"/>\r
1360 <attribute name="FILEEXT" default="cat"/>\r
1361\r
1362 <element name="PRE.PROCESS" optional="yes"/>\r
1363 <element name="POST.PROCESS" optional="yes"/>\r
1364\r
1365 <sequential>\r
1366 <OnDependency>\r
1367 <sourcefiles>\r
1368 <file name="${DEST_DIR_OUTPUT}/ResetVec.@{FILEEXT}"/>\r
1369 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.te"/>\r
1370 </sourcefiles>\r
1371 <targetfiles>\r
1372 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>\r
1373 </targetfiles>\r
1374\r
1375 <sequential>\r
1376 <PRE.PROCESS/>\r
1377 <secfixup secexefile="${DEST_DIR_OUTPUT}/@{FILENAME}.te" resetvectorDatafile="${DEST_DIR_OUTPUT}/ResetVec.@{FILEEXT}"\r
1378 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.bin"/>\r
1379 \r
1380 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.bin" \r
1381 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.sec" \r
1382 sectiontype="EFI_SECTION_RAW"/>\r
1383 <POST.PROCESS/>\r
1384 </sequential>\r
1385 </OnDependency>\r
1386 </sequential>\r
1387 </macrodef>\r
1388 \r
878ddf1f 1389 <!--\r
1390 EFI_SECTION_FIRMWARE_VOLUME_IMAGE\r
1391 -->\r
1392 <macrodef name="EFI_SECTION_FIRMWARE_VOLUME_IMAGE">\r
1393 <attribute name="FILEPATH"/>\r
1394 <attribute name="FILENAME"/>\r
1395 <attribute name="FILEEXT" default="fv"/>\r
1396\r
1397 <element name="PRE.PROCESS" optional="yes"/>\r
1398 <element name="POST.PROCESS" optional="yes"/>\r
1399\r
1400 <sequential>\r
1401 <OnDependency>\r
1402 <sourcefiles>\r
22e0585c 1403 <file name="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 1404 </sourcefiles>\r
1405 <targetfiles>\r
22e0585c 1406 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec"/>\r
878ddf1f 1407 </targetfiles>\r
1408\r
1409 <sequential>\r
1410 <PRE.PROCESS/>\r
5fc17c92 1411 \r
1412 <copy file="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
1413 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
878ddf1f 1414 overwrite="true"/>\r
5fc17c92 1415 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
1416 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec" \r
878ddf1f 1417 sectiontype="EFI_SECTION_FIRMWARE_VOLUME_IMAGE"/>\r
5fc17c92 1418 \r
878ddf1f 1419 <POST.PROCESS/>\r
1420 </sequential>\r
1421 </OnDependency>\r
1422 </sequential>\r
1423 </macrodef>\r
1424\r
1425 <!--\r
1426 Binary\r
1427 -->\r
1428 <macrodef name="Build_Binary">\r
1429 <attribute name="FILEPATH"/>\r
1430 <attribute name="FILENAME"/>\r
1431 <attribute name="FILEEXT" default="bin"/>\r
1432\r
1433 <element name="EXTRA.INC" optional="yes"/>\r
1434 <element name="EXTRA.ARG" optional="yes"/>\r
1435\r
1436 <sequential>\r
5fc17c92 1437 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
22e0585c 1438 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.bin"/>\r
878ddf1f 1439 </sequential>\r
1440 </macrodef>\r
d6123759 1441 \r
473f57d4 1442 <!--\r
1443 Microcode\r
1444 -->\r
1445 <macrodef name="Build_MICROCODE">\r
1446 <attribute name="FILEPATH"/>\r
1447 <attribute name="FILENAME"/>\r
1448 <attribute name="FILEEXT" default="TXT"/>\r
1449\r
1450 <element name="EXTRA.INC" optional="yes"/>\r
1451 <element name="EXTRA.ARG" optional="yes"/>\r
1452\r
1453 <sequential>\r
50017606 1454 <mkdir dir="${TARGET_DIR}/Microcode"/>\r
1455 <flashmap MCIFile="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" MCOFILE="${TARGET_DIR}/Microcode/@{FILENAME}.bin"/>\r
473f57d4 1456 </sequential>\r
1457 </macrodef> \r
878ddf1f 1458\r
1459 <!--\r
1460 Graphics (bmp, ...)\r
1461 -->\r
d6123759 1462 <macrodef name="Build_BMP">\r
878ddf1f 1463 <attribute name="FILEPATH"/>\r
473f57d4 1464 <attribute name="FILENAME"/> \r
878ddf1f 1465 <attribute name="FILEEXT" default="bmp"/>\r
1466\r
1467 <element name="EXTRA.INC" optional="yes"/>\r
1468 <element name="EXTRA.ARG" optional="yes"/>\r
1469\r
1470 <sequential>\r
5fc17c92 1471 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
22e0585c 1472 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.bin"/>\r
878ddf1f 1473 </sequential>\r
5fc17c92 1474 </macrodef> \r
d6123759 1475\r
1476 <!--\r
1477 build EFI file\r
1478 -->\r
878ddf1f 1479 <macrodef name="Build_EFI">\r
1480 <attribute name="FILEPATH"/>\r
1481 <attribute name="FILENAME"/>\r
1482 <attribute name="FILEEXT" default="efi"/>\r
1483\r
1484 <element name="EXTRA.INC" optional="yes"/>\r
1485 <element name="EXTRA.ARG" optional="yes"/>\r
1486\r
1487 <sequential>\r
5fc17c92 1488 <mkdir dir="${MODULE_DIR}/@{FILEPATH}" /> \r
1489 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
22e0585c 1490 tofile="${DEST_DIR_OUTPUT}/${BASE_NAME}.efi"/>\r
878ddf1f 1491 </sequential>\r
1492 </macrodef>\r
380191dd 1493 \r
1494 <!-- \r
1495 Build macro for Apriori\r
1496 -->\r
1497 <macrodef name="Build_Apriori">\r
1498 <attribute name="FILEPATH" default="."/>\r
1499 <attribute name="FILENAME"/>\r
1500 <attribute name="FILEEXT" default="apr"/>\r
1501 <attribute name="GUID"/>\r
1502\r
1503 <sequential>\r
1504 <mkdir dir="${FV_DIR}/Apriori" />\r
1505 <gensection inputfile="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
1506 outputfile="${FV_DIR}/Apriori/@{FILENAME}.sec" \r
1507 sectiontype="EFI_SECTION_RAW"/>\r
1508\r
1509 <genffsfile BaseName="@{FILENAME}" ffsATTRIBCHECKSUM="TRUE" ffsFILETYPE="EFI_FV_FILETYPE_FREEFORM" \r
1510 fileGuid="@{GUID}" moduleType="BASE" outputDir="${FV_DIR}">\r
1511 <sectFile fileName="${FV_DIR}/Apriori/@{FILENAME}.sec"/>\r
1512 </genffsfile>\r
1513 \r
1514 </sequential>\r
1515 </macrodef>\r
878ddf1f 1516</project>\r