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