Enhanced the <Build_Library> macro to check OBJECTS property in case it's empty
[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
933\r
a99a79e4 934 <!--\r
a387de3b 935 DUMMY - for skipping the source file which should not be built\r
a99a79e4 936 -->\r
937 <macrodef name="Build_DUMMY">\r
938 <attribute name="FILEPATH"/>\r
939 <attribute name="FILENAME"/>\r
940 <attribute name="FILEEXT"/>\r
941\r
942 <element name="EXTRA.INC" optional="yes"/>\r
943 <element name="EXTRA.ARG" optional="yes"/>\r
944\r
945 <sequential>\r
7446fb2d 946 <!--echo message="Ignoring ${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" level="info" /-->\r
a99a79e4 947 </sequential>\r
948 </macrodef>\r
949\r
878ddf1f 950<!--############################################################################\r
951 Build Sections\r
952#############################################################################-->\r
953 <!--\r
954 DLL\r
955 -->\r
956 <macrodef name="GenDll">\r
957 <attribute name="FILEPATH"/>\r
958 <attribute name="FILENAME"/>\r
959 <attribute name="FILEEXT"/>\r
960\r
961 <element name="LIB.ARG" optional="yes"/>\r
962 <element name="LINK.ARG" optional="yes"/>\r
963\r
964 <sequential>\r
5fc17c92 965 <var name="FILE_BASENAME" value="@{FILENAME}" />\r
966 <var name="FILE_PATH" value="@{FILEPATH}" />\r
878ddf1f 967 <OnDependency>\r
968 <sourcefiles>\r
878ddf1f 969 <file list="${LIBS}"/>\r
32a47954 970 <fileset dir="${DEST_DIR_OUTPUT}" includes="${OBJECTS}" />\r
878ddf1f 971 </sourcefiles>\r
972 <targetfiles>\r
22e0585c 973 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll"/>\r
878ddf1f 974 </targetfiles>\r
975\r
976 <sequential>\r
8b41e66e 977 <cc userdefine="on">\r
32c8b5a9 978 <command type="SLINK" cmd="${SLINK}" family="${SLINK_FAMILY}" dpath="${SLINK_DPATH}"\r
877de749 979 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib"\r
980 libpath="${SLINKLIBPATH}" include="${SLINK_INCLUDEPATH}">\r
5fc17c92 981 <argument value="${SLINK_FLAGS}"/>\r
982\r
32a47954 983 <fileset dir="${DEST_DIR_OUTPUT}" includes="${OBJECTS}"/>\r
8b41e66e 984 </command>\r
985 </cc>\r
878ddf1f 986 <cc userdefine="on">\r
5fc17c92 987 <command type="DLINK" cmd="${DLINK}" family="${DLINK_FAMILY}"\r
877de749 988 outputFile="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll" dpath="${DLINK_DPATH}" \r
989 libpath="${DLINK_LIBPATH}" include="${DLINK_INCLUDEPATH}">\r
5fc17c92 990 <argument value="${DLINK_FLAGS}"/>\r
63062e1e 991 <libset libs="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib ${LIBS} ${DLINK_SPATH}"/>\r
878ddf1f 992 <LINK.ARG/>\r
878ddf1f 993 </command>\r
994 </cc>\r
995 </sequential>\r
996 </OnDependency>\r
997 </sequential>\r
998 </macrodef>\r
999\r
1000 <!--\r
1001 EFI\r
1002 -->\r
1003 <macrodef name="GenEfi">\r
1004 <attribute name="FILEPATH"/>\r
1005 <attribute name="FILENAME"/>\r
1006 <attribute name="FILEEXT" default="dll"/>\r
1007\r
1008 <sequential>\r
1009 <OnDependency>\r
1010 <sourcefiles>\r
22e0585c 1011 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 1012 </sourcefiles>\r
1013 <targetfiles>\r
22e0585c 1014 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
878ddf1f 1015 </targetfiles>\r
1016\r
1017 <sequential>\r
5fc17c92 1018 <fwimage componentType="${MODULE_TYPE}" outImage="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" \r
22e0585c 1019 peImage="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" time="0"/>\r
878ddf1f 1020 </sequential>\r
1021 </OnDependency>\r
1022 </sequential>\r
1023 </macrodef>\r
1024\r
1025<!--\r
1026 EFI_SECTION_FREEFORM_SUBTYPE_GUID\r
1027 EFI_SECTION_VERSION\r
1028 EFI_SECTION_USER_INTERFACE\r
1029 EFI_SECTION_DXE_DEPEX\r
1030 EFI_SECTION_PEI_DEPEX\r
1031 EFI_SECTION_PE32\r
1032 EFI_SECTION_PIC\r
1033 EFI_SECTION_TE\r
1034 EFI_SECTION_RAW\r
1035 EFI_SECTION_COMPRESSION\r
1036 EFI_SECTION_GUID_DEFINED\r
1037 EFI_SECTION_COMPATIBILITY16\r
1038 EFI_SECTION_FIRMWARE_VOLUME_IMAGE\r
1039 -->\r
1040 <!--\r
1041 EFI_SECTION_PE32\r
1042 -->\r
46dde08c
LG
1043\r
1044 <macrodef name="EFI_SECTION_TE">\r
1045 <attribute name="FILEPATH"/>\r
1046 <attribute name="FILENAME"/>\r
1047 <attribute name="FILEEXT" default="" />\r
1048\r
1049 <element name="PRE.PROCESS" optional="yes"/>\r
1050 <element name="POST.PROCESS" optional="yes"/>\r
1051\r
1052 <sequential>\r
1053 <PRE.PROCESS/>\r
1054 <if>\r
1055 <not>\r
1056 <equals arg1="${LIBS}" arg2=""/>\r
1057 </not>\r
1058\r
1059 <then>\r
1060 <GenDll FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="">\r
1061 <LIB.ARG></LIB.ARG>\r
1062 <LINK.ARG></LINK.ARG>\r
1063 </GenDll>\r
1064\r
1065 <GenEfi FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="dll"/>\r
1066 </then>\r
1067 </if>\r
1068\r
1069 <OnDependency>\r
1070 <sourcefiles>\r
1071 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
1072 </sourcefiles>\r
1073 <targetfiles>\r
1074 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.tes"/>\r
1075 </targetfiles>\r
1076\r
1077 <sequential>\r
1078 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${BIN_DIR}/@{FILENAME}.efi" />\r
1079 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${DEST_DIR_DEBUG}/@{FILENAME}.efi" /> \r
1080 <genteimage Dump="false" Verbose="false" OutputDir="" OutputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.te" InputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
46dde08c
LG
1081 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.te" \r
1082 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.tes" \r
1083 sectiontype="EFI_SECTION_TE"/>\r
1084 <POST.PROCESS/>\r
1085 </sequential>\r
1086 </OnDependency>\r
1087 </sequential>\r
1088 </macrodef>\r
1089\r
878ddf1f 1090 <macrodef name="EFI_SECTION_PE32">\r
1091 <attribute name="FILEPATH"/>\r
1092 <attribute name="FILENAME"/>\r
1093 <attribute name="FILEEXT" default="" />\r
1094\r
1095 <element name="PRE.PROCESS" optional="yes"/>\r
1096 <element name="POST.PROCESS" optional="yes"/>\r
1097\r
1098 <sequential>\r
1099 <PRE.PROCESS/>\r
878ddf1f 1100 <if>\r
1101 <not>\r
5fc17c92 1102 <!-- TBD ${OBJECTS} -->\r
1103 <equals arg1="${LIBS}" arg2=""/>\r
878ddf1f 1104 </not>\r
1105\r
1106 <then>\r
1107 <GenDll FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="">\r
1108 <LIB.ARG></LIB.ARG>\r
1109 <LINK.ARG></LINK.ARG>\r
1110 </GenDll>\r
0fd9e137 1111\r
878ddf1f 1112 <GenEfi FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="dll"/>\r
1113 </then>\r
1114 </if>\r
5fc17c92 1115 \r
878ddf1f 1116 <OnDependency>\r
1117 <sourcefiles>\r
22e0585c 1118 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
878ddf1f 1119 </sourcefiles>\r
1120 <targetfiles>\r
22e0585c 1121 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32"/>\r
878ddf1f 1122 </targetfiles>\r
1123\r
1124 <sequential>\r
22e0585c 1125 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${BIN_DIR}/@{FILENAME}.efi" />\r
c084fb6e 1126 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${DEST_DIR_DEBUG}/@{FILENAME}.efi" />\r
5fc17c92 1127 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" \r
1128 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32" \r
878ddf1f 1129 sectiontype="EFI_SECTION_PE32"/>\r
5fc17c92 1130 \r
878ddf1f 1131 <POST.PROCESS/>\r
1132 </sequential>\r
1133 </OnDependency>\r
1134 </sequential>\r
1135 </macrodef>\r
1136\r
1137 <!--\r
1138 EFI_SECTION_VERSION\r
1139 -->\r
1140 <macrodef name="EFI_SECTION_VERSION">\r
1141 <attribute name="FILEPATH"/>\r
1142 <attribute name="FILENAME"/>\r
1143 <attribute name="FILEEXT" default="" />\r
1144 <attribute name="VERSION" default="0000"/>\r
1145\r
1146 <element name="PRE.PROCESS" optional="yes"/>\r
1147 <element name="POST.PROCESS" optional="yes"/>\r
1148\r
1149 <sequential>\r
1150 <if>\r
1151 <not>\r
22e0585c 1152 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver"/>\r
878ddf1f 1153 </not>\r
1154\r
1155 <then>\r
1156 <PRE.PROCESS/>\r
5fc17c92 1157 <gensection outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver" \r
878ddf1f 1158 versionnum="@{VERSION}"\r
1159 sectiontype="EFI_SECTION_VERSION"/>\r
1160 <POST.PROCESS/>\r
1161 </then>\r
1162 </if>\r
1163 </sequential>\r
1164 </macrodef>\r
1165\r
1166 <!--\r
1167 EFI_SECTION_USER_INTERFACE\r
1168 -->\r
1169 <macrodef name="EFI_SECTION_USER_INTERFACE">\r
1170 <attribute name="FILEPATH"/>\r
1171 <attribute name="FILENAME"/>\r
1172 <attribute name="FILEEXT" default="" />\r
1173 <attribute name="UI" default="${BASE_NAME}"/>\r
1174\r
1175 <element name="PRE.PROCESS" optional="yes"/>\r
1176 <element name="POST.PROCESS" optional="yes"/>\r
1177\r
1178 <sequential>\r
1179 <if>\r
1180 <not>\r
22e0585c 1181 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui"/>\r
878ddf1f 1182 </not>\r
1183\r
1184 <then>\r
1185 <PRE.PROCESS/>\r
1186 <gensection interfacestring="@{UI}"\r
5fc17c92 1187 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui" \r
878ddf1f 1188 sectiontype="EFI_SECTION_USER_INTERFACE"/>\r
1189 <POST.PROCESS/>\r
1190 </then>\r
1191 </if>\r
1192 </sequential>\r
1193 </macrodef>\r
1194\r
878ddf1f 1195 <!--\r
1196 EFI_SECTION_DXE_DEPEX\r
1197 -->\r
1198 <macrodef name="EFI_SECTION_DXE_DEPEX">\r
1199 <attribute name="FILEPATH"/>\r
1200 <attribute name="FILENAME"/>\r
1201 <attribute name="FILEEXT" default="dxs"/>\r
1202\r
1203 <element name="PRE.PROCESS" optional="yes"/>\r
1204 <element name="POST.PROCESS" optional="yes"/>\r
1205\r
1206 <sequential>\r
1207 <PRE.PROCESS/>\r
1208\r
1209 <if>\r
5fc17c92 1210 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 1211 <then>\r
1212 <OnDependency>\r
1213 <sourcefiles>\r
5fc17c92 1214 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 1215 </sourcefiles>\r
1216 <targetfiles>\r
22e0585c 1217 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1218 </targetfiles>\r
1219 <sequential>\r
5fc17c92 1220 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.depex" \r
1221 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx" \r
878ddf1f 1222 sectiontype="EFI_SECTION_DXE_DEPEX"/>\r
1223 </sequential>\r
1224 </OnDependency>\r
1225 </then>\r
1226 <else>\r
1227 <if>\r
1228 <not>\r
22e0585c 1229 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1230 </not>\r
1231 <then>\r
22e0585c 1232 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1233 </then>\r
1234 </if>\r
1235 </else>\r
1236 </if>\r
1237\r
1238 <POST.PROCESS/>\r
1239 </sequential>\r
1240 </macrodef>\r
1241\r
1242 <!--\r
1243 EFI_SECTION_PEI_DEPEX\r
1244 -->\r
1245 <macrodef name="EFI_SECTION_PEI_DEPEX">\r
1246 <attribute name="FILEPATH"/>\r
1247 <attribute name="FILENAME"/>\r
1248 <attribute name="FILEEXT" default="dxs"/>\r
1249\r
1250 <element name="PRE.PROCESS" optional="yes"/>\r
1251 <element name="POST.PROCESS" optional="yes"/>\r
1252 <sequential>\r
1253 <PRE.PROCESS/>\r
1254 <if>\r
5fc17c92 1255 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 1256 <then>\r
1257 <OnDependency>\r
1258 <sourcefiles>\r
5fc17c92 1259 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 1260 </sourcefiles>\r
1261 <targetfiles>\r
22e0585c 1262 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1263 </targetfiles>\r
1264\r
1265 <sequential>\r
5fc17c92 1266 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.depex" \r
1267 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx" \r
878ddf1f 1268 sectiontype="EFI_SECTION_PEI_DEPEX"/>\r
1269 </sequential>\r
1270 </OnDependency>\r
5fc17c92 1271 \r
878ddf1f 1272 </then>\r
1273 <else>\r
1274 <if>\r
1275 <not>\r
22e0585c 1276 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1277 </not>\r
1278 <then>\r
22e0585c 1279 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1280 </then>\r
1281 </if>\r
1282 </else>\r
1283 </if>\r
1284 <POST.PROCESS/>\r
1285 </sequential>\r
1286 </macrodef>\r
1287\r
878ddf1f 1288\r
1289 <!--\r
1290 EFI_SECTION_RAW\r
1291 -->\r
1292 <macrodef name="EFI_SECTION_RAW">\r
1293 <attribute name="FILEPATH"/>\r
1294 <attribute name="FILENAME"/>\r
1295 <attribute name="FILEEXT" default="bin"/>\r
1296\r
1297 <element name="PRE.PROCESS" optional="yes"/>\r
1298 <element name="POST.PROCESS" optional="yes"/>\r
1299\r
1300 <sequential>\r
1301 <OnDependency>\r
1302 <sourcefiles>\r
d8022b36 1303 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 1304 </sourcefiles>\r
1305 <targetfiles>\r
22e0585c 1306 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>\r
878ddf1f 1307 </targetfiles>\r
1308\r
1309 <sequential>\r
1310 <PRE.PROCESS/>\r
d8022b36 1311 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
5fc17c92 1312 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.sec" \r
878ddf1f 1313 sectiontype="EFI_SECTION_RAW"/>\r
1314 <POST.PROCESS/>\r
1315 </sequential>\r
1316 </OnDependency>\r
1317 </sequential>\r
1318 </macrodef>\r
1319\r
706c2ad4 1320 <!--\r
1321 EFI_SECTION_RAW_SEC\r
1322 -->\r
1323 <macrodef name="EFI_SECTION_RAW_SEC">\r
1324 <attribute name="FILEPATH"/>\r
1325 <attribute name="FILENAME"/>\r
1326 <attribute name="FILEEXT" default="cat"/>\r
1327\r
1328 <element name="PRE.PROCESS" optional="yes"/>\r
1329 <element name="POST.PROCESS" optional="yes"/>\r
1330\r
1331 <sequential>\r
1332 <OnDependency>\r
1333 <sourcefiles>\r
1334 <file name="${DEST_DIR_OUTPUT}/ResetVec.@{FILEEXT}"/>\r
1335 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.te"/>\r
1336 </sourcefiles>\r
1337 <targetfiles>\r
1338 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>\r
1339 </targetfiles>\r
1340\r
1341 <sequential>\r
1342 <PRE.PROCESS/>\r
1343 <secfixup secexefile="${DEST_DIR_OUTPUT}/@{FILENAME}.te" resetvectorDatafile="${DEST_DIR_OUTPUT}/ResetVec.@{FILEEXT}"\r
1344 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.bin"/>\r
1345 \r
1346 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.bin" \r
1347 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.sec" \r
1348 sectiontype="EFI_SECTION_RAW"/>\r
1349 <POST.PROCESS/>\r
1350 </sequential>\r
1351 </OnDependency>\r
1352 </sequential>\r
1353 </macrodef>\r
1354 \r
878ddf1f 1355 <!--\r
1356 EFI_SECTION_FIRMWARE_VOLUME_IMAGE\r
1357 -->\r
1358 <macrodef name="EFI_SECTION_FIRMWARE_VOLUME_IMAGE">\r
1359 <attribute name="FILEPATH"/>\r
1360 <attribute name="FILENAME"/>\r
1361 <attribute name="FILEEXT" default="fv"/>\r
1362\r
1363 <element name="PRE.PROCESS" optional="yes"/>\r
1364 <element name="POST.PROCESS" optional="yes"/>\r
1365\r
1366 <sequential>\r
1367 <OnDependency>\r
1368 <sourcefiles>\r
22e0585c 1369 <file name="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 1370 </sourcefiles>\r
1371 <targetfiles>\r
22e0585c 1372 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec"/>\r
878ddf1f 1373 </targetfiles>\r
1374\r
1375 <sequential>\r
1376 <PRE.PROCESS/>\r
5fc17c92 1377 \r
1378 <copy file="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
1379 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
878ddf1f 1380 overwrite="true"/>\r
5fc17c92 1381 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
1382 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec" \r
878ddf1f 1383 sectiontype="EFI_SECTION_FIRMWARE_VOLUME_IMAGE"/>\r
5fc17c92 1384 \r
878ddf1f 1385 <POST.PROCESS/>\r
1386 </sequential>\r
1387 </OnDependency>\r
1388 </sequential>\r
1389 </macrodef>\r
1390\r
1391 <!--\r
1392 Binary\r
1393 -->\r
1394 <macrodef name="Build_Binary">\r
1395 <attribute name="FILEPATH"/>\r
1396 <attribute name="FILENAME"/>\r
1397 <attribute name="FILEEXT" default="bin"/>\r
1398\r
1399 <element name="EXTRA.INC" optional="yes"/>\r
1400 <element name="EXTRA.ARG" optional="yes"/>\r
1401\r
1402 <sequential>\r
5fc17c92 1403 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
22e0585c 1404 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.bin"/>\r
878ddf1f 1405 </sequential>\r
1406 </macrodef>\r
d6123759 1407 \r
473f57d4 1408 <!--\r
1409 Microcode\r
1410 -->\r
1411 <macrodef name="Build_MICROCODE">\r
1412 <attribute name="FILEPATH"/>\r
1413 <attribute name="FILENAME"/>\r
1414 <attribute name="FILEEXT" default="TXT"/>\r
1415\r
1416 <element name="EXTRA.INC" optional="yes"/>\r
1417 <element name="EXTRA.ARG" optional="yes"/>\r
1418\r
1419 <sequential>\r
50017606 1420 <mkdir dir="${TARGET_DIR}/Microcode"/>\r
1421 <flashmap MCIFile="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" MCOFILE="${TARGET_DIR}/Microcode/@{FILENAME}.bin"/>\r
473f57d4 1422 </sequential>\r
1423 </macrodef> \r
878ddf1f 1424\r
1425 <!--\r
1426 Graphics (bmp, ...)\r
1427 -->\r
d6123759 1428 <macrodef name="Build_BMP">\r
878ddf1f 1429 <attribute name="FILEPATH"/>\r
473f57d4 1430 <attribute name="FILENAME"/> \r
878ddf1f 1431 <attribute name="FILEEXT" default="bmp"/>\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
5fc17c92 1440 </macrodef> \r
d6123759 1441\r
1442 <!--\r
1443 build EFI file\r
1444 -->\r
878ddf1f 1445 <macrodef name="Build_EFI">\r
1446 <attribute name="FILEPATH"/>\r
1447 <attribute name="FILENAME"/>\r
1448 <attribute name="FILEEXT" default="efi"/>\r
1449\r
1450 <element name="EXTRA.INC" optional="yes"/>\r
1451 <element name="EXTRA.ARG" optional="yes"/>\r
1452\r
1453 <sequential>\r
5fc17c92 1454 <mkdir dir="${MODULE_DIR}/@{FILEPATH}" /> \r
1455 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
22e0585c 1456 tofile="${DEST_DIR_OUTPUT}/${BASE_NAME}.efi"/>\r
878ddf1f 1457 </sequential>\r
1458 </macrodef>\r
380191dd 1459 \r
1460 <!-- \r
1461 Build macro for Apriori\r
1462 -->\r
1463 <macrodef name="Build_Apriori">\r
1464 <attribute name="FILEPATH" default="."/>\r
1465 <attribute name="FILENAME"/>\r
1466 <attribute name="FILEEXT" default="apr"/>\r
1467 <attribute name="GUID"/>\r
1468\r
1469 <sequential>\r
1470 <mkdir dir="${FV_DIR}/Apriori" />\r
1471 <gensection inputfile="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
1472 outputfile="${FV_DIR}/Apriori/@{FILENAME}.sec" \r
1473 sectiontype="EFI_SECTION_RAW"/>\r
1474\r
1475 <genffsfile BaseName="@{FILENAME}" ffsATTRIBCHECKSUM="TRUE" ffsFILETYPE="EFI_FV_FILETYPE_FREEFORM" \r
1476 fileGuid="@{GUID}" moduleType="BASE" outputDir="${FV_DIR}">\r
1477 <sectFile fileName="${FV_DIR}/Apriori/@{FILENAME}.sec"/>\r
1478 </genffsfile>\r
1479 \r
1480 </sequential>\r
1481 </macrodef>\r
878ddf1f 1482</project>\r