- Fixed PVCS tracker 484 by merging the GenDll and GenEfi macro in BuildMacro.xml...
[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
7407b98b 747 <else>\r
62f022cc 748 <cc userdefine="on">\r
749 <command type="PP" cmd="${PP}" workdir="${DEST_DIR_OUTPUT}/@{FILEPATH}" family="${PP_FAMILY}" \r
750 dpath="${PP_DPATH}" libpath="${PP_LIBPATH}" include="${PP_INCLUDEPATH}">\r
7407b98b 751 <argument value="${VFRPP_FLAGS}"/>\r
62f022cc 752 <!-- Output file of the preprocess --> \r
753 <EXTRA.INC/> \r
754 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/> \r
755 </command>\r
756 </cc>\r
7407b98b 757 </else>\r
62f022cc 758 </if>\r
759 \r
b609c89b 760 <vfrcompile createIfrBinFile="on" createListFile="on" outPutDir="${DEST_DIR_DEBUG}/@{FILEPATH}" vfrFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i">\r
878ddf1f 761 <EXTRA.INC/>\r
762 </vfrcompile>\r
5fc17c92 763 \r
878ddf1f 764 <cc userdefine="on">\r
5fc17c92 765 <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" \r
32c8b5a9 766 includepathDelimiter="-I" family="${CC_FAMILY}" dpath="${CC_DPATH}"\r
877de749 767 libpath="${CC_LIBPATH}" include="${CC_INCLUDEPATH}"\r
5fc17c92 768 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" >\r
1549f516 769 <argument value="${CC_FLAGS}"/>\r
5fc17c92 770 <EXTRA.INC/>\r
878ddf1f 771 <EXTRA.ARG/>\r
3fc9d866 772 <fileset casesensitive="on" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.c"/>\r
878ddf1f 773 </command>\r
774 </cc>\r
878ddf1f 775 </sequential>\r
776 </OnDependency>\r
32a47954 777 <!-- Since fileset can't scan file start with ./, remove ./ in previous. -->\r
778 <if>\r
779 <equals arg1="@{FILEPATH}" arg2="." />\r
780 <then>\r
781 <var name="OBJECTS" value="${OBJECTS} @{FILENAME}.obj" />\r
782 </then>\r
783 <else>\r
784 <var name="OBJECTS" value="${OBJECTS} @{FILEPATH}/@{FILENAME}.obj" />\r
785 </else>\r
786 </if>\r
878ddf1f 787 </sequential>\r
788 </macrodef>\r
789\r
706c2ad4 790 <!--\r
791 Build the real mode ASM file\r
792 -->\r
793 <macrodef name="Build_RealAsm">\r
794 <attribute name="FILEPATH"/>\r
795 <attribute name="FILENAME"/>\r
796 <attribute name="FILEEXT" default="asm"/>\r
797\r
798 <element name="EXTRA.INC" optional="yes"/>\r
799 <element name="EXTRA.ARG" optional="yes"/>\r
800 \r
801 <sequential>\r
741fb364
LG
802 <OnDependency>\r
803 <sourcefiles>\r
804 <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
805 </sourcefiles>\r
806 <targetfiles>\r
807 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.cat"/>\r
808 </targetfiles>\r
809 \r
810 <sequential>\r
811 <exec dir="${DEST_DIR_OUTPUT}" executable="${ASM}" failonerror="true">\r
812 <arg line="/nologo /omf ${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT} /Bl${ASMLINK} ${ASMLINK_FLAGS}"/>\r
813 </exec>\r
814 <concat destfile="${DEST_DIR_OUTPUT}/@{FILENAME}.cat" binary="yes">\r
815 <filelist dir="${MODULE_DIR}" files="Blank2.pad"/>\r
816 <filelist dir="${DEST_DIR_OUTPUT}" files="@{FILENAME}.com"/>\r
817 </concat>\r
818 </sequential>\r
819 </OnDependency>\r
706c2ad4 820 </sequential>\r
821 </macrodef>\r
d8022b36
LG
822\r
823 <!--\r
824 Build Asl table file\r
825 -->\r
826 <macrodef name="Build_ASL">\r
827 <attribute name="FILEPATH"/>\r
828 <attribute name="FILENAME"/>\r
829 <attribute name="FILEEXT" default="asl"/>\r
830\r
831 <element name="EXTRA.INC" optional="yes"/>\r
832 <element name="EXTRA.ARG" optional="yes"/>\r
833 \r
834 <sequential>\r
835 <mkdir dir="${DEST_DIR_OUTPUT}"/>\r
836\r
837 <OnDependency>\r
838 <sourcefiles>\r
839 <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
840 </sourcefiles>\r
841 <targetfiles>\r
842 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>\r
843 </targetfiles>\r
844\r
845 <sequential>\r
846 <cc userdefine="on">\r
847 <command type="PP" cmd="${PP}" workdir="${DEST_DIR_OUTPUT}" family="${PP_FAMILY}" \r
848 dpath="${PP_DPATH}" libpath="${PP_LIBPATH}" include="${PP_INCLUDEPATH}">\r
849 <argument value="${APP_FLAGS}"/>\r
850 <EXTRA.INC/> \r
851 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
852 </command>\r
853 </cc>\r
854\r
855 <exec dir="${DEST_DIR_OUTPUT}" executable="${ASL}" failonerror="true" outputproperty="ASL_OUTPUT">\r
856 <arg line="${DEST_DIR_OUTPUT}/@{FILENAME}.i"/>\r
857 </exec>\r
858\r
859 <if>\r
860 <or>\r
861 <contains string="${ASL_OUTPUT}" substring="Supports ACPI Specification Revision 2.0"/>\r
862 <contains string="${ASL_OUTPUT}" substring="Supports ACPI Specification Revision 1.0"/>\r
863 </or>\r
864 <then>\r
865 <fail message="Current Asl tool not support Acpi Spec 3.0. Pls update your Asl compiler."/>\r
866 </then>\r
867 </if>\r
868\r
869 <EFI_SECTION_RAW FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="aml"/>\r
870 \r
871 </sequential>\r
872 </OnDependency>\r
873 </sequential>\r
874 </macrodef> \r
875\r
876 <!--\r
877 Build Asl table c file\r
878 -->\r
879 <macrodef name="Build_CCASL">\r
880 <attribute name="FILEPATH"/>\r
881 <attribute name="FILENAME"/>\r
882 <attribute name="FILEEXT" default="c"/>\r
883\r
884 <element name="EXTRA.INC" optional="yes"/>\r
885 <element name="EXTRA.ARG" optional="yes"/>\r
886 \r
887 <sequential>\r
888 <mkdir dir="${DEST_DIR_OUTPUT}"/>\r
889\r
890 <OnDependency>\r
891 <sourcefiles>\r
892 <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
893 </sourcefiles>\r
894 <targetfiles>\r
895 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>\r
896 </targetfiles>\r
897\r
898 <sequential>\r
899\r
900 <cc userdefine="on">\r
901 <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" family="${CC_FAMILY}"\r
902 outputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.obj" dpath="${CC_DPATH}" \r
903 libpath="${CC_LIBPATH}" include="${CC_INCLUDEPATH}">\r
904 <EXTRA.INC/>\r
905 <argument value="${CC_FLAGS}"/>\r
906 <EXTRA.ARG/>\r
907 <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
908 </command>\r
909 </cc>\r
910\r
911 <cc userdefine="on">\r
912 <command type="DLINK" cmd="${DLINK}" family="${DLINK_FAMILY}" \r
913 outputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.exe" dpath="${DLINK_DPATH}" >\r
914 <argument value="${SLINK_FLAGS}"/>\r
915 <fileset casesensitive="on" file="${DEST_DIR_OUTPUT}/@{FILENAME}.obj"/>\r
916 </command>\r
917 </cc>\r
918 \r
919 <genacpitable inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.exe" outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.acpi" /> \r
920 \r
921 <EFI_SECTION_RAW FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="acpi"/>\r
922 </sequential>\r
923 </OnDependency>\r
924 </sequential>\r
925 </macrodef> \r
febc6433 926 <!--\r
927 Build ACPI Bin File\r
928 -->\r
929 <macrodef name="Build_ACPIBIN">\r
930 <attribute name="FILEPATH"/>\r
931 <attribute name="FILENAME"/>\r
932 <attribute name="FILEEXT" default="bin"/>\r
933\r
934 <element name="EXTRA.INC" optional="yes"/>\r
935 <element name="EXTRA.ARG" optional="yes"/>\r
936 \r
937 <sequential>\r
938 <mkdir dir="${DEST_DIR_OUTPUT}"/>\r
d8022b36 939\r
febc6433 940 <OnDependency>\r
941 <sourcefiles>\r
942 <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
943 </sourcefiles>\r
944 <targetfiles>\r
945 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>\r
946 </targetfiles>\r
947\r
948 <sequential>\r
949 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" tofile="${DEST_DIR_OUTPUT}/@{FILENAME}.acpi" />\r
950 \r
951 <exec executable="attrib">\r
952 <arg line="-r ${DEST_DIR_OUTPUT}/@{FILENAME}.acpi"/>\r
953 </exec>\r
954\r
955 <EFI_SECTION_RAW FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="acpi"/>\r
956 </sequential>\r
957 </OnDependency>\r
958 </sequential>\r
959 </macrodef> \r
960 \r
a99a79e4 961 <!--\r
a387de3b 962 DUMMY - for skipping the source file which should not be built\r
a99a79e4 963 -->\r
964 <macrodef name="Build_DUMMY">\r
965 <attribute name="FILEPATH"/>\r
966 <attribute name="FILENAME"/>\r
967 <attribute name="FILEEXT"/>\r
968\r
969 <element name="EXTRA.INC" optional="yes"/>\r
970 <element name="EXTRA.ARG" optional="yes"/>\r
971\r
972 <sequential>\r
7446fb2d 973 <!--echo message="Ignoring ${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" level="info" /-->\r
a99a79e4 974 </sequential>\r
975 </macrodef>\r
976\r
878ddf1f 977 <!--\r
a30ae9fa 978 Generate efi file\r
878ddf1f 979 -->\r
a30ae9fa 980 <macrodef name="GenEfi">\r
878ddf1f 981 <attribute name="FILEPATH"/>\r
982 <attribute name="FILENAME"/>\r
a30ae9fa 983 <attribute name="FILEEXT" default="efi"/>\r
878ddf1f 984\r
985 <element name="LIB.ARG" optional="yes"/>\r
986 <element name="LINK.ARG" optional="yes"/>\r
987\r
988 <sequential>\r
5fc17c92 989 <var name="FILE_BASENAME" value="@{FILENAME}" />\r
990 <var name="FILE_PATH" value="@{FILEPATH}" />\r
878ddf1f 991 <OnDependency>\r
992 <sourcefiles>\r
878ddf1f 993 <file list="${LIBS}"/>\r
32a47954 994 <fileset dir="${DEST_DIR_OUTPUT}" includes="${OBJECTS}" />\r
878ddf1f 995 </sourcefiles>\r
996 <targetfiles>\r
a30ae9fa 997 <file name="${DEST_DIR_DEBUG}/@{FILENAME}.efi"/>\r
878ddf1f 998 </targetfiles>\r
999\r
1000 <sequential>\r
a30ae9fa 1001 <!-- Generate a temporary lib file for object files -->\r
8b41e66e 1002 <cc userdefine="on">\r
32c8b5a9 1003 <command type="SLINK" cmd="${SLINK}" family="${SLINK_FAMILY}" dpath="${SLINK_DPATH}"\r
a30ae9fa 1004 outputFile="${DEST_DIR_OUTPUT}/@{FILENAME}Local.lib"\r
877de749 1005 libpath="${SLINKLIBPATH}" include="${SLINK_INCLUDEPATH}">\r
5fc17c92 1006 <argument value="${SLINK_FLAGS}"/>\r
1007\r
32a47954 1008 <fileset dir="${DEST_DIR_OUTPUT}" includes="${OBJECTS}"/>\r
8b41e66e 1009 </command>\r
1010 </cc>\r
a30ae9fa 1011\r
1012 <!-- Link the temporary lib file with dependent libraries -->\r
878ddf1f 1013 <cc userdefine="on">\r
5fc17c92 1014 <command type="DLINK" cmd="${DLINK}" family="${DLINK_FAMILY}"\r
a30ae9fa 1015 outputFile="${DEST_DIR_DEBUG}/@{FILENAME}.dll" dpath="${DLINK_DPATH}" \r
877de749 1016 libpath="${DLINK_LIBPATH}" include="${DLINK_INCLUDEPATH}">\r
5fc17c92 1017 <argument value="${DLINK_FLAGS}"/>\r
a30ae9fa 1018 <libset libs="${DEST_DIR_OUTPUT}/@{FILENAME}Local.lib ${LIBS} ${DLINK_SPATH}"/>\r
878ddf1f 1019 <LINK.ARG/>\r
878ddf1f 1020 </command>\r
1021 </cc>\r
a30ae9fa 1022\r
1023 <!-- Convert the dll file to efi file -->\r
1024 <fwimage componentType="${MODULE_TYPE}" outImage="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" \r
1025 peImage="${DEST_DIR_DEBUG}/@{FILENAME}.dll" time="0"/>\r
1026\r
1027 <!-- Copy the efi file to BIN and OUTPUT directory -->\r
1028 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${BIN_DIR}/@{FILENAME}.efi" />\r
1029 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${DEST_DIR_DEBUG}/@{FILENAME}.efi" /> \r
878ddf1f 1030 </sequential>\r
1031 </OnDependency>\r
1032 </sequential>\r
1033 </macrodef>\r
1034\r
1035 <!--\r
a30ae9fa 1036 Binary\r
878ddf1f 1037 -->\r
a30ae9fa 1038 <macrodef name="Build_Binary">\r
878ddf1f 1039 <attribute name="FILEPATH"/>\r
1040 <attribute name="FILENAME"/>\r
a30ae9fa 1041 <attribute name="FILEEXT" default="bin"/>\r
878ddf1f 1042\r
a30ae9fa 1043 <element name="EXTRA.INC" optional="yes"/>\r
1044 <element name="EXTRA.ARG" optional="yes"/>\r
878ddf1f 1045\r
a30ae9fa 1046 <sequential>\r
1047 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
1048 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.bin"/>\r
878ddf1f 1049 </sequential>\r
1050 </macrodef>\r
a30ae9fa 1051 \r
1052 <!--\r
1053 Microcode\r
1054 -->\r
1055 <macrodef name="Build_MICROCODE">\r
1056 <attribute name="FILEPATH"/>\r
1057 <attribute name="FILENAME"/>\r
1058 <attribute name="FILEEXT" default="TXT"/>\r
878ddf1f 1059\r
a30ae9fa 1060 <element name="EXTRA.INC" optional="yes"/>\r
1061 <element name="EXTRA.ARG" optional="yes"/>\r
1062\r
1063 <sequential>\r
1064 <mkdir dir="${TARGET_DIR}/Microcode"/>\r
1065 <flashmap MCIFile="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" MCOFILE="${TARGET_DIR}/Microcode/@{FILENAME}.bin"/>\r
1066 </sequential>\r
1067 </macrodef> \r
1068\r
1069 <!--\r
1070 Graphics (bmp, ...)\r
1071 -->\r
1072 <macrodef name="Build_BMP">\r
1073 <attribute name="FILEPATH"/>\r
1074 <attribute name="FILENAME"/> \r
1075 <attribute name="FILEEXT" default="bmp"/>\r
1076\r
1077 <element name="EXTRA.INC" optional="yes"/>\r
1078 <element name="EXTRA.ARG" optional="yes"/>\r
1079\r
1080 <sequential>\r
1081 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
1082 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.bin"/>\r
1083 </sequential>\r
1084 </macrodef> \r
1085\r
1086 <!--\r
1087 build EFI file\r
1088 -->\r
1089 <macrodef name="Build_EFI">\r
1090 <attribute name="FILEPATH"/>\r
1091 <attribute name="FILENAME"/>\r
1092 <attribute name="FILEEXT" default="efi"/>\r
1093\r
1094 <element name="EXTRA.INC" optional="yes"/>\r
1095 <element name="EXTRA.ARG" optional="yes"/>\r
1096\r
1097 <sequential>\r
1098 <mkdir dir="${MODULE_DIR}/@{FILEPATH}" /> \r
1099 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
1100 tofile="${DEST_DIR_OUTPUT}/${BASE_NAME}.efi"/>\r
1101 </sequential>\r
1102 </macrodef>\r
1103 \r
1104 <!-- \r
1105 Build macro for Apriori\r
878ddf1f 1106 -->\r
a30ae9fa 1107 <macrodef name="Build_Apriori">\r
1108 <attribute name="FILEPATH" default="."/>\r
1109 <attribute name="FILENAME"/>\r
1110 <attribute name="FILEEXT" default="apr"/>\r
1111 <attribute name="GUID"/>\r
1112\r
1113 <sequential>\r
1114 <mkdir dir="${FV_DIR}/Apriori" />\r
1115 <gensection inputfile="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
1116 outputfile="${FV_DIR}/Apriori/@{FILENAME}.sec" \r
1117 sectiontype="EFI_SECTION_RAW"/>\r
1118\r
1119 <genffsfile BaseName="@{FILENAME}" ffsATTRIBCHECKSUM="TRUE" ffsFILETYPE="EFI_FV_FILETYPE_FREEFORM" \r
1120 fileGuid="@{GUID}" moduleType="BASE" outputDir="${FV_DIR}">\r
1121 <sectFile fileName="${FV_DIR}/Apriori/@{FILENAME}.sec"/>\r
1122 </genffsfile>\r
1123 \r
1124 </sequential>\r
1125 </macrodef>\r
1126\r
1127<!--############################################################################\r
1128 Build Sections\r
1129#############################################################################-->\r
878ddf1f 1130 <!--\r
a30ae9fa 1131 EFI_SECTION_TE\r
878ddf1f 1132 -->\r
46dde08c
LG
1133\r
1134 <macrodef name="EFI_SECTION_TE">\r
1135 <attribute name="FILEPATH"/>\r
1136 <attribute name="FILENAME"/>\r
a30ae9fa 1137 <attribute name="FILEEXT" default="efi" />\r
46dde08c
LG
1138\r
1139 <element name="PRE.PROCESS" optional="yes"/>\r
1140 <element name="POST.PROCESS" optional="yes"/>\r
1141\r
1142 <sequential>\r
46dde08c
LG
1143 <OnDependency>\r
1144 <sourcefiles>\r
1145 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
1146 </sourcefiles>\r
1147 <targetfiles>\r
1148 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.tes"/>\r
1149 </targetfiles>\r
1150\r
1151 <sequential>\r
a30ae9fa 1152 <PRE.PROCESS/>\r
1153\r
46dde08c 1154 <genteimage Dump="false" Verbose="false" OutputDir="" OutputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.te" InputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
46dde08c
LG
1155 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.te" \r
1156 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.tes" \r
1157 sectiontype="EFI_SECTION_TE"/>\r
a30ae9fa 1158\r
46dde08c
LG
1159 <POST.PROCESS/>\r
1160 </sequential>\r
1161 </OnDependency>\r
1162 </sequential>\r
1163 </macrodef>\r
1164\r
a30ae9fa 1165 <!--\r
1166 EFI_SECTION_PE32\r
1167 -->\r
878ddf1f 1168 <macrodef name="EFI_SECTION_PE32">\r
1169 <attribute name="FILEPATH"/>\r
1170 <attribute name="FILENAME"/>\r
a30ae9fa 1171 <attribute name="FILEEXT" default="efi"/>\r
878ddf1f 1172\r
1173 <element name="PRE.PROCESS" optional="yes"/>\r
1174 <element name="POST.PROCESS" optional="yes"/>\r
1175\r
1176 <sequential>\r
878ddf1f 1177 <OnDependency>\r
1178 <sourcefiles>\r
22e0585c 1179 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
878ddf1f 1180 </sourcefiles>\r
1181 <targetfiles>\r
22e0585c 1182 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32"/>\r
878ddf1f 1183 </targetfiles>\r
1184\r
1185 <sequential>\r
a30ae9fa 1186 <PRE.PROCESS/>\r
1187\r
5fc17c92 1188 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" \r
1189 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32" \r
878ddf1f 1190 sectiontype="EFI_SECTION_PE32"/>\r
5fc17c92 1191 \r
878ddf1f 1192 <POST.PROCESS/>\r
1193 </sequential>\r
1194 </OnDependency>\r
1195 </sequential>\r
1196 </macrodef>\r
1197\r
1198 <!--\r
1199 EFI_SECTION_VERSION\r
1200 -->\r
1201 <macrodef name="EFI_SECTION_VERSION">\r
1202 <attribute name="FILEPATH"/>\r
1203 <attribute name="FILENAME"/>\r
1204 <attribute name="FILEEXT" default="" />\r
1205 <attribute name="VERSION" default="0000"/>\r
1206\r
1207 <element name="PRE.PROCESS" optional="yes"/>\r
1208 <element name="POST.PROCESS" optional="yes"/>\r
1209\r
1210 <sequential>\r
1211 <if>\r
1212 <not>\r
22e0585c 1213 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver"/>\r
878ddf1f 1214 </not>\r
1215\r
1216 <then>\r
1217 <PRE.PROCESS/>\r
5fc17c92 1218 <gensection outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver" \r
878ddf1f 1219 versionnum="@{VERSION}"\r
1220 sectiontype="EFI_SECTION_VERSION"/>\r
1221 <POST.PROCESS/>\r
1222 </then>\r
1223 </if>\r
1224 </sequential>\r
1225 </macrodef>\r
1226\r
1227 <!--\r
1228 EFI_SECTION_USER_INTERFACE\r
1229 -->\r
1230 <macrodef name="EFI_SECTION_USER_INTERFACE">\r
1231 <attribute name="FILEPATH"/>\r
1232 <attribute name="FILENAME"/>\r
1233 <attribute name="FILEEXT" default="" />\r
1234 <attribute name="UI" default="${BASE_NAME}"/>\r
1235\r
1236 <element name="PRE.PROCESS" optional="yes"/>\r
1237 <element name="POST.PROCESS" optional="yes"/>\r
1238\r
1239 <sequential>\r
1240 <if>\r
1241 <not>\r
22e0585c 1242 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui"/>\r
878ddf1f 1243 </not>\r
1244\r
1245 <then>\r
1246 <PRE.PROCESS/>\r
1247 <gensection interfacestring="@{UI}"\r
5fc17c92 1248 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui" \r
878ddf1f 1249 sectiontype="EFI_SECTION_USER_INTERFACE"/>\r
1250 <POST.PROCESS/>\r
1251 </then>\r
1252 </if>\r
1253 </sequential>\r
1254 </macrodef>\r
1255\r
878ddf1f 1256 <!--\r
1257 EFI_SECTION_DXE_DEPEX\r
1258 -->\r
1259 <macrodef name="EFI_SECTION_DXE_DEPEX">\r
1260 <attribute name="FILEPATH"/>\r
1261 <attribute name="FILENAME"/>\r
1262 <attribute name="FILEEXT" default="dxs"/>\r
1263\r
1264 <element name="PRE.PROCESS" optional="yes"/>\r
1265 <element name="POST.PROCESS" optional="yes"/>\r
1266\r
1267 <sequential>\r
1268 <PRE.PROCESS/>\r
1269\r
1270 <if>\r
5fc17c92 1271 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 1272 <then>\r
1273 <OnDependency>\r
1274 <sourcefiles>\r
5fc17c92 1275 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 1276 </sourcefiles>\r
1277 <targetfiles>\r
22e0585c 1278 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1279 </targetfiles>\r
1280 <sequential>\r
5fc17c92 1281 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.depex" \r
1282 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx" \r
878ddf1f 1283 sectiontype="EFI_SECTION_DXE_DEPEX"/>\r
1284 </sequential>\r
1285 </OnDependency>\r
1286 </then>\r
1287 <else>\r
1288 <if>\r
1289 <not>\r
22e0585c 1290 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1291 </not>\r
1292 <then>\r
22e0585c 1293 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1294 </then>\r
1295 </if>\r
1296 </else>\r
1297 </if>\r
1298\r
1299 <POST.PROCESS/>\r
1300 </sequential>\r
1301 </macrodef>\r
1302\r
1303 <!--\r
1304 EFI_SECTION_PEI_DEPEX\r
1305 -->\r
1306 <macrodef name="EFI_SECTION_PEI_DEPEX">\r
1307 <attribute name="FILEPATH"/>\r
1308 <attribute name="FILENAME"/>\r
1309 <attribute name="FILEEXT" default="dxs"/>\r
1310\r
1311 <element name="PRE.PROCESS" optional="yes"/>\r
1312 <element name="POST.PROCESS" optional="yes"/>\r
1313 <sequential>\r
1314 <PRE.PROCESS/>\r
1315 <if>\r
5fc17c92 1316 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 1317 <then>\r
1318 <OnDependency>\r
1319 <sourcefiles>\r
5fc17c92 1320 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.depex"/>\r
878ddf1f 1321 </sourcefiles>\r
1322 <targetfiles>\r
22e0585c 1323 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1324 </targetfiles>\r
1325\r
1326 <sequential>\r
5fc17c92 1327 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.depex" \r
1328 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx" \r
878ddf1f 1329 sectiontype="EFI_SECTION_PEI_DEPEX"/>\r
1330 </sequential>\r
1331 </OnDependency>\r
5fc17c92 1332 \r
878ddf1f 1333 </then>\r
1334 <else>\r
1335 <if>\r
1336 <not>\r
22e0585c 1337 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1338 </not>\r
1339 <then>\r
22e0585c 1340 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1341 </then>\r
1342 </if>\r
1343 </else>\r
1344 </if>\r
1345 <POST.PROCESS/>\r
1346 </sequential>\r
1347 </macrodef>\r
1348\r
878ddf1f 1349\r
1350 <!--\r
1351 EFI_SECTION_RAW\r
1352 -->\r
1353 <macrodef name="EFI_SECTION_RAW">\r
1354 <attribute name="FILEPATH"/>\r
1355 <attribute name="FILENAME"/>\r
1356 <attribute name="FILEEXT" default="bin"/>\r
1357\r
1358 <element name="PRE.PROCESS" optional="yes"/>\r
1359 <element name="POST.PROCESS" optional="yes"/>\r
1360\r
1361 <sequential>\r
1362 <OnDependency>\r
1363 <sourcefiles>\r
d8022b36 1364 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 1365 </sourcefiles>\r
1366 <targetfiles>\r
22e0585c 1367 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>\r
878ddf1f 1368 </targetfiles>\r
1369\r
1370 <sequential>\r
1371 <PRE.PROCESS/>\r
d8022b36 1372 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
5fc17c92 1373 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.sec" \r
878ddf1f 1374 sectiontype="EFI_SECTION_RAW"/>\r
1375 <POST.PROCESS/>\r
1376 </sequential>\r
1377 </OnDependency>\r
1378 </sequential>\r
1379 </macrodef>\r
1380\r
706c2ad4 1381 <!--\r
1382 EFI_SECTION_RAW_SEC\r
1383 -->\r
1384 <macrodef name="EFI_SECTION_RAW_SEC">\r
1385 <attribute name="FILEPATH"/>\r
1386 <attribute name="FILENAME"/>\r
1387 <attribute name="FILEEXT" default="cat"/>\r
1388\r
1389 <element name="PRE.PROCESS" optional="yes"/>\r
1390 <element name="POST.PROCESS" optional="yes"/>\r
1391\r
1392 <sequential>\r
1393 <OnDependency>\r
1394 <sourcefiles>\r
1395 <file name="${DEST_DIR_OUTPUT}/ResetVec.@{FILEEXT}"/>\r
1396 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.te"/>\r
1397 </sourcefiles>\r
1398 <targetfiles>\r
1399 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>\r
1400 </targetfiles>\r
1401\r
1402 <sequential>\r
1403 <PRE.PROCESS/>\r
1404 <secfixup secexefile="${DEST_DIR_OUTPUT}/@{FILENAME}.te" resetvectorDatafile="${DEST_DIR_OUTPUT}/ResetVec.@{FILEEXT}"\r
1405 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.bin"/>\r
1406 \r
1407 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.bin" \r
1408 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.sec" \r
1409 sectiontype="EFI_SECTION_RAW"/>\r
1410 <POST.PROCESS/>\r
1411 </sequential>\r
1412 </OnDependency>\r
1413 </sequential>\r
1414 </macrodef>\r
1415 \r
878ddf1f 1416 <!--\r
1417 EFI_SECTION_FIRMWARE_VOLUME_IMAGE\r
1418 -->\r
1419 <macrodef name="EFI_SECTION_FIRMWARE_VOLUME_IMAGE">\r
1420 <attribute name="FILEPATH"/>\r
1421 <attribute name="FILENAME"/>\r
1422 <attribute name="FILEEXT" default="fv"/>\r
1423\r
1424 <element name="PRE.PROCESS" optional="yes"/>\r
1425 <element name="POST.PROCESS" optional="yes"/>\r
1426\r
1427 <sequential>\r
1428 <OnDependency>\r
1429 <sourcefiles>\r
22e0585c 1430 <file name="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 1431 </sourcefiles>\r
1432 <targetfiles>\r
22e0585c 1433 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec"/>\r
878ddf1f 1434 </targetfiles>\r
1435\r
1436 <sequential>\r
1437 <PRE.PROCESS/>\r
5fc17c92 1438 \r
1439 <copy file="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
1440 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
878ddf1f 1441 overwrite="true"/>\r
5fc17c92 1442 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
1443 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec" \r
878ddf1f 1444 sectiontype="EFI_SECTION_FIRMWARE_VOLUME_IMAGE"/>\r
5fc17c92 1445 \r
878ddf1f 1446 <POST.PROCESS/>\r
1447 </sequential>\r
1448 </OnDependency>\r
1449 </sequential>\r
1450 </macrodef>\r
1451\r
878ddf1f 1452</project>\r