Change to new XML Schema
[mirror_edk2.git] / Tools / Conf / BuildMacro.xml
CommitLineData
878ddf1f 1<?xml version="1.0" encoding="UTF-8"?>\r
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
13 <!--\r
14 macro definitions for building files with different types\r
15 -->\r
16 <!--\r
17 C Code\r
18 -->\r
19 <macrodef name="Build_C_Code">\r
20 <attribute name="FILEPATH"/>\r
21 <attribute name="FILENAME"/>\r
22 <attribute name="FILEEXT" default="c"/>\r
23\r
24 <element name="EXTRA.INC" optional="yes"/>\r
25 <element name="EXTRA.ARG" optional="yes"/>\r
26\r
27 <sequential>\r
22e0585c 28 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
878ddf1f 29\r
30 <if>\r
22e0585c 31 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 32 <then>\r
22e0585c 33 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">\r
34 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
35 <input file="${DEST_DIR_DEBUG}/AutoGen.h"/>\r
878ddf1f 36 <includepath path="${WORKSPACE_DIR}"/>\r
37 <includepath path="${MODULE_DIR}"/>\r
22e0585c 38 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 39 <EXTRA.INC/>\r
40 </makedeps>\r
41 </then>\r
42 </if>\r
43\r
44 <OnDependency>\r
45 <sourcefiles>\r
22e0585c 46 <file ListFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
878ddf1f 47 </sourcefiles>\r
48 <targetfiles>\r
22e0585c 49 <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 50 </targetfiles>\r
51\r
52 <sequential>\r
53 <cc userdefine="on">\r
54 <command type="CC" workdir="${DEST_DIR_OUTPUT}">\r
55 <includepath path="${WORKSPACE_DIR}"/>\r
56 <includepath path="${MODULE_DIR}"/>\r
22e0585c 57 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 58 <EXTRA.INC/>\r
59\r
60 <argument value="${CC_FLAGS}"/>\r
61 <EXTRA.ARG/>\r
22e0585c 62 <!-- <argument value="/FI${DEST_DIR_DEBUG}/AutoGen.h" /> -->\r
63 <includeFile value="${DEST_DIR_DEBUG}/AutoGen.h"/>\r
64 <!-- <argument value="/Fo${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> -->\r
65 <outputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 66\r
22e0585c 67 <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 68 </command>\r
69 </cc>\r
70 </sequential>\r
71 </OnDependency>\r
72\r
73 <!--\r
74 for library generation later\r
75 -->\r
0fd9e137 76 <bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 77 </sequential>\r
78 </macrodef>\r
79\r
80\r
81 <macrodef name="Build_AUTOGEN">\r
82 <attribute name="FILEPATH"/>\r
83 <attribute name="FILENAME"/>\r
84 <attribute name="FILEEXT" default="c"/>\r
85\r
86 <element name="EXTRA.INC" optional="yes"/>\r
87 <element name="EXTRA.ARG" optional="yes"/>\r
88\r
89 <sequential>\r
22e0585c 90 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
878ddf1f 91\r
92 <if>\r
22e0585c 93 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 94 <then>\r
22e0585c 95 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">\r
96 <input file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
97 <input file="${DEST_DIR_DEBUG}/AutoGen.h"/>\r
878ddf1f 98 <includepath path="${WORKSPACE_DIR}"/>\r
99 <includepath path="${MODULE_DIR}"/>\r
22e0585c 100 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 101 <EXTRA.INC/>\r
102 </makedeps>\r
103 </then>\r
104 </if>\r
105\r
106 <OnDependency>\r
107 <sourcefiles>\r
22e0585c 108 <file ListFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
878ddf1f 109 </sourcefiles>\r
110 <targetfiles>\r
22e0585c 111 <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 112 </targetfiles>\r
113\r
114 <sequential>\r
115 <cc userdefine="on">\r
116 <command type="CC" workdir="${DEST_DIR_OUTPUT}">\r
117 <includepath path="${WORKSPACE_DIR}"/>\r
118 <includepath path="${MODULE_DIR}"/>\r
22e0585c 119 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 120 <EXTRA.INC/>\r
0fd9e137 121\r
878ddf1f 122 <argument value="${CC_FLAGS}"/>\r
123 <EXTRA.ARG/>\r
22e0585c 124 <!-- <argument value="/FI${DEST_DIR_DEBUG}/AutoGen.h" /> -->\r
125 <includeFile value="${DEST_DIR_DEBUG}/AutoGen.h"/>\r
126 <!-- <argument value="/Fo${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> -->\r
127 <outputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
0fd9e137 128\r
22e0585c 129 <fileset casesensitive="off" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 130 </command>\r
131 </cc>\r
132 </sequential>\r
133 </OnDependency>\r
134 <!--\r
135 for library generation later\r
136 -->\r
0fd9e137 137 <bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 138 </sequential>\r
139 </macrodef>\r
140\r
141 <macrodef name="Build_Dependency_File">\r
142 <attribute name="FILEPATH"/>\r
143 <attribute name="FILENAME"/>\r
144 <attribute name="FILEEXT" default="dxs"/>\r
145\r
146 <element name="EXTRA.INC" optional="yes"/>\r
147 <element name="EXTRA.ARG" optional="yes"/>\r
148\r
149 <sequential>\r
22e0585c 150 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
878ddf1f 151\r
152 <OnDependency>\r
153 <sourcefiles>\r
22e0585c 154 <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 155 </sourcefiles>\r
156 <targetfiles>\r
22e0585c 157 <file name="${DEST_DIR_OUTPUT}/${BASE_NAME}.@{FILEEXT}.depex"/>\r
878ddf1f 158 </targetfiles>\r
159\r
160 <sequential>\r
0fd9e137 161 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
22e0585c 162 tofile="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.c"/>\r
878ddf1f 163\r
164 <cc userdefine="on">\r
165 <command type="CC" workdir=".">\r
0fd9e137 166 <includepath path="${DEST_DIR_DEBUG}" />\r
878ddf1f 167 <includepath path="${WORKSPACE_DIR}"/>\r
168 <includepath path="${MODULE_DIR}"/>\r
22e0585c 169 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 170 <EXTRA.INC/>\r
171 <argument value="${PP_FLAGS}"/>\r
22e0585c 172 <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.c"/>\r
878ddf1f 173 <outputFile value="@{FILENAME}.@{FILEEXT}.i"/>\r
174 </command>\r
175 </cc>\r
0fd9e137 176\r
22e0585c 177 <gendepex inputFile="@{FILENAME}.@{FILEEXT}.i" outputFile="${DEST_DIR_OUTPUT}/${BASE_NAME}.@{FILEEXT}.depex"/>\r
878ddf1f 178 <delete file="@{FILENAME}.@{FILEEXT}.i" />\r
0fd9e137 179 <delete file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.c" />\r
878ddf1f 180 </sequential>\r
181 </OnDependency>\r
182 </sequential>\r
183 </macrodef>\r
0fd9e137 184\r
878ddf1f 185<!-- Usage Example\r
186 <Build_C_Code\r
187 FILEPATH="."\r
188 FILENAME="${SOURCE_NAME}"\r
189 FILEEXT="c">\r
190 <EXTRA.INC>\r
22e0585c 191 <includepath path="${PACKAGE_DIR}/Include"/>\r
192 <includepath path="${PACKAGE_DIR}/Include/${ARCH}"/>\r
878ddf1f 193 </EXTRA.INC>\r
194\r
195 <EXTRA.ARG>\r
196 <argument value="/D EFI_DEBUG /D EFI_WHATEVER_FLAG"/>\r
197 </EXTRA.ARG>\r
198 </Build_C_Code>\r
199 -->\r
200\r
201 <!--\r
202 IA32/x64 Assembly\r
203 -->\r
204 <macrodef name="Build_Assembly">\r
205 <attribute name="FILEPATH"/>\r
206 <attribute name="FILENAME"/>\r
207 <attribute name="FILEEXT" default="asm"/>\r
208\r
209 <element name="EXTRA.INC" optional="yes"/>\r
210 <element name="EXTRA.ARG" optional="yes"/>\r
211\r
212 <sequential>\r
22e0585c 213 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
878ddf1f 214\r
215 <OnDependency>\r
216 <sourcefiles>\r
22e0585c 217 <file Name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 218 </sourcefiles>\r
219 <targetfiles>\r
22e0585c 220 <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 221 </targetfiles>\r
222\r
223 <sequential>\r
224 <cc userdefine="on">\r
225 <command type="ASM">\r
226 <includepath path="${WORKSPACE_DIR}"/>\r
227 <includepath path="${MODULE_DIR}"/>\r
22e0585c 228 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 229 <EXTRA.INC/>\r
0fd9e137 230\r
878ddf1f 231 <argument value="${ASM_FLAGS}"/>\r
232 <EXTRA.ARG/>\r
22e0585c 233 <argument value="/Fl${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.lst"/>\r
234 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
0fd9e137 235\r
22e0585c 236 <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 237 </command>\r
238 </cc>\r
239 </sequential>\r
240 </OnDependency>\r
241 <!--\r
242 for library generation later\r
243 -->\r
22e0585c 244 <bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 245 </sequential>\r
246 </macrodef>\r
247\r
0fd9e137 248 <!--\r
249 Build x86 assembly with C preprocessing on AutoGen.h\r
250 -->\r
251 <macrodef name="Build_x86_asm_autogen">\r
252 <attribute name="FILEPATH"/>\r
253 <attribute name="FILENAME"/>\r
254 <attribute name="FILEEXT" default="asm"/>\r
255\r
256 <element name="EXTRA.INC" optional="yes"/>\r
257 <element name="EXTRA.ARG" optional="yes"/>\r
258\r
259 <sequential>\r
260 <mkdir dir="${DEST_DIR_DEBUG}/@{FILEPATH}"/>\r
261 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
262\r
263 <if>\r
264 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
265 <then>\r
266 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">\r
267 <input file="${DEST_DIR_DEBUG}/AutoGen.h"/>\r
268 <includepath path="${WORKSPACE_DIR}"/>\r
269 <includepath path="${MODULE_DIR}"/>\r
270 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
271 <EXTRA.INC/>\r
272 </makedeps>\r
273 </then>\r
274 </if>\r
275\r
276 <OnDependency>\r
277 <sourcefiles>\r
278 <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
279 <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
280 </sourcefiles>\r
281 <targetfiles>\r
282 <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
283 </targetfiles>\r
284\r
285 <sequential>\r
567df693 286 <pathconvert property="ModuleDirUnixName" targetos="unix">\r
287 <path path="${MODULE_DIR}"/>\r
288 <mapper>\r
289 <chainedmapper>\r
290 <filtermapper>\r
291 <replacestring from="\" to="/"/>\r
292 </filtermapper>\r
293 </chainedmapper>\r
294 </mapper>\r
295 </pathconvert>\r
0fd9e137 296 <cc userdefine="on">\r
297 <command type="CC" workdir="${DEST_DIR_DEBUG}/@{FILEPATH}">\r
298 <includepath path="${WORKSPACE_DIR}"/>\r
299 <includepath path="${MODULE_DIR}"/>\r
300 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
301 <EXTRA.INC/>\r
302 <argument value="${PP_FLAGS}"/>\r
303 <argument value="/FI${DEST_DIR_DEBUG}/AutoGen.h"/>\r
304 <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
305 </command>\r
306 </cc>\r
307 <replaceregexp file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"\r
fe3262a3 308 match="^(#line +1 +.*@{FILEPATH}/@{FILENAME}\.@{FILEEXT}&quot;).+\1"\r
567df693 309 replace="; Source: ${ModuleDirUnixName}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
0fd9e137 310 flags="gs"/>\r
fe3262a3 311 <replaceregexp file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"\r
312 match="^(#line .*)$"\r
313 replace="; \1"\r
314 byline="true"/>\r
0fd9e137 315 <replaceregexp file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"\r
316 match="([^_a-zA-Z])0x([0-9a-fA-F]+)"\r
317 replace="\10\2h"\r
318 flags="g"\r
319 byline="true"/>\r
320 <move file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"\r
321 tofile="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
322 <cc userdefine="on">\r
323 <command type="ASM">\r
324 <includepath path="${WORKSPACE_DIR}"/>\r
325 <includepath path="${MODULE_DIR}"/>\r
326 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
327 <EXTRA.INC/>\r
328\r
329 <argument value="${ASM_FLAGS}"/>\r
330 <EXTRA.ARG/>\r
331 <argument value="/Fl${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.lst"/>\r
332 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
333\r
334 <fileset casesensitive="off" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
335 </command>\r
336 </cc>\r
337 </sequential>\r
338 </OnDependency>\r
339 <!--\r
340 for library generation later\r
341 -->\r
342 <bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
343 </sequential>\r
344 </macrodef>\r
345\r
878ddf1f 346 <!--\r
347 Library private HashMap map = new HashMap();\r
348 -->\r
349 <macrodef name="Build_Library">\r
350 <attribute name="FILENAME" />\r
351 <attribute name="FILEEXT" default="obj"/>\r
352\r
353 <element name="EXTRA.INC" optional="yes"/>\r
354 <element name="EXTRA.ARG" optional="yes"/>\r
355\r
356 <sequential>\r
357 <mkdir dir="${BIN_DIR}"/>\r
358\r
359 <OnDependency>\r
360 <sourcefiles>\r
361 <file list="${OBJECTS}"/>\r
362 </sourcefiles>\r
363 <targetfiles>\r
22e0585c 364 <file name="${BIN_DIR}/@{FILENAME}.lib"/>\r
878ddf1f 365 </targetfiles>\r
366\r
367 <sequential>\r
368 <!-- <echo>re-generate library</echo> -->\r
369 <cc userdefine="on">\r
370 <command type="LIB">\r
371 <argument value="${LIB_FLAGS}"/>\r
372 <!--<argument value="${OBJECTS}"/>-->\r
373 <FileList dir="" files="${OBJECTS}"/>\r
22e0585c 374 <!-- <argument value="/out:${BIN_DIR}/@{FILENAME}.lib"/> -->\r
375 <OutputFile value="${BIN_DIR}/@{FILENAME}.lib"/>\r
878ddf1f 376 </command>\r
377 </cc>\r
378 </sequential>\r
379 </OnDependency>\r
380 </sequential>\r
381 </macrodef>\r
382\r
75d0c5b1 383 <!--\r
384 GCC Assembly\r
385 -->\r
386 <macrodef name="Build_GCC_Assembly_Code">\r
387 <attribute name="FILEPATH"/>\r
388 <attribute name="FILENAME"/>\r
97520113 389 <attribute name="FILEEXT" default="S"/>\r
75d0c5b1 390\r
391 <element name="EXTRA.INC" optional="yes"/>\r
392 <element name="EXTRA.ARG" optional="yes"/>\r
393\r
394 <sequential>\r
395 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
396\r
397 <if>\r
398 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
399 <then>\r
400 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">\r
401 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
402 <includepath path="${WORKSPACE_DIR}"/>\r
403 <includepath path="${MODULE_DIR}"/>\r
404 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
405 <EXTRA.INC/>\r
406 </makedeps>\r
407 </then>\r
408 </if>\r
409\r
410 <OnDependency>\r
411 <sourcefiles>\r
412 <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
413 </sourcefiles>\r
414 <targetfiles>\r
415 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
416 </targetfiles>\r
417\r
418 <sequential>\r
0fd9e137 419\r
75d0c5b1 420 <cc userdefine="on">\r
421 <command type="ASM" includepathDelimiter="-I">\r
422 <EXTRA.INC/>\r
0fd9e137 423\r
75d0c5b1 424 <argument value="${ASM_FLAGS}"/>\r
425 <EXTRA.ARG/>\r
426 <!-- <argument value="-o ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> -->\r
427 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
0fd9e137 428\r
75d0c5b1 429 <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
430 </command>\r
431 </cc>\r
432 </sequential>\r
433 </OnDependency>\r
434 <!--\r
435 for library generation later\r
436 -->\r
437 <bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
438 </sequential>\r
439 </macrodef>\r
440\r
878ddf1f 441 <!--\r
442 IPF Assembly\r
443 -->\r
444 <macrodef name="Build_IPF_Assembly_Code">\r
445 <attribute name="FILEPATH"/>\r
446 <attribute name="FILENAME"/>\r
447 <attribute name="FILEEXT" default="s"/>\r
448\r
449 <element name="EXTRA.INC" optional="yes"/>\r
450 <element name="EXTRA.ARG" optional="yes"/>\r
451\r
452 <sequential>\r
0fd9e137 453 <mkdir dir="${DEST_DIR_DEBUG}/@{FILEPATH}"/>\r
22e0585c 454 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
878ddf1f 455\r
456 <if>\r
22e0585c 457 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 458 <then>\r
22e0585c 459 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">\r
460 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 461 <includepath path="${WORKSPACE_DIR}"/>\r
462 <includepath path="${MODULE_DIR}"/>\r
22e0585c 463 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 464 <EXTRA.INC/>\r
465 </makedeps>\r
466 </then>\r
467 </if>\r
468\r
469 <OnDependency>\r
470 <sourcefiles>\r
22e0585c 471 <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
878ddf1f 472 </sourcefiles>\r
473 <targetfiles>\r
22e0585c 474 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 475 </targetfiles>\r
476\r
477 <sequential>\r
878ddf1f 478 <cc userdefine="on">\r
0fd9e137 479 <command type="CC" workdir="${DEST_DIR_DEBUG}/@{FILEPATH}">\r
878ddf1f 480 <includepath path="${WORKSPACE_DIR}"/>\r
481 <includepath path="${MODULE_DIR}"/>\r
22e0585c 482 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 483 <EXTRA.INC/>\r
484 <argument value="${PP_FLAGS}"/>\r
0fd9e137 485 <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 486 </command>\r
487 </cc>\r
0fd9e137 488 <move file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"\r
22e0585c 489 tofile="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.pro"/>\r
878ddf1f 490 <cc userdefine="on">\r
491 <command type="ASM" includepathDelimiter="-I">\r
492 <includepath path="${WORKSPACE_DIR}"/>\r
493 <includepath path="${MODULE_DIR}"/>\r
22e0585c 494 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 495 <EXTRA.INC/>\r
0fd9e137 496\r
878ddf1f 497 <argument value="${ASM_FLAGS}"/>\r
498 <EXTRA.ARG/>\r
22e0585c 499 <!-- <argument value="-o ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> -->\r
500 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
0fd9e137 501\r
22e0585c 502 <fileset casesensitive="off" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.pro"/>\r
878ddf1f 503 </command>\r
504 </cc>\r
505 </sequential>\r
506 </OnDependency>\r
507 <!--\r
508 for library generation later\r
509 -->\r
22e0585c 510 <bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 511 </sequential>\r
512 </macrodef>\r
513\r
514\r
515 <macrodef name="Build_IPF_PP_Code">\r
516 <attribute name="FILEPATH"/>\r
517 <attribute name="FILENAME"/>\r
518 <attribute name="FILEEXT" default="i"/>\r
519\r
520 <element name="EXTRA.INC" optional="yes"/>\r
521 <element name="EXTRA.ARG" optional="yes"/>\r
522\r
523 <sequential>\r
22e0585c 524 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
0fd9e137 525\r
878ddf1f 526 <cc userdefine="on">\r
527 <command type="ASM" includepathDelimiter="-I">\r
528 <includepath path="${WORKSPACE_DIR}"/>\r
529 <includepath path="${MODULE_DIR}"/>\r
22e0585c 530 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 531 <EXTRA.INC/>\r
0fd9e137 532\r
878ddf1f 533 <argument value="${ASM_FLAGS}"/>\r
534 <EXTRA.ARG/>\r
22e0585c 535 <!-- <argument value="-o ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> -->\r
536 <OutputFile File="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
0fd9e137 537\r
22e0585c 538 <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 539 </command>\r
540 </cc>\r
0fd9e137 541\r
878ddf1f 542 <!--\r
543 for library generation later\r
544 -->\r
22e0585c 545 <bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 546 </sequential>\r
547 </macrodef>\r
0fd9e137 548\r
878ddf1f 549 <!--\r
550 [Build.Ia32.Makefile,Build.Ipf.Makefile,Build.Ebc.Makefile]\r
551 [Build.Ia32.Custom_Makefile,Build.Ipf.Custom_Makefile,Build.Ebc.Custom_Makefile]\r
552 -->\r
553 <macrodef name="Build_Custom_Build">\r
554 <attribute name="FILEPATH"/>\r
555 <attribute name="FILENAME"/>\r
556 <attribute name="FILEEXT" default="c"/>\r
557\r
558 <element name="EXTRA.INC" optional="yes"/>\r
559 <element name="EXTRA.ARG" optional="yes"/>\r
560\r
561 <sequential>\r
562\r
563 </sequential>\r
564 </macrodef>\r
565\r
566 <!--\r
567 Unicode -> .sdb\r
568 -->\r
569 <macrodef name="Build_Unicode">\r
570 <attribute name="FILEPATH"/>\r
571 <attribute name="FILENAME"/>\r
572 <attribute name="FILEEXT" default="uni"/>\r
573\r
574 <element name="EXTRA.INC" optional="yes"/>\r
575 <element name="EXTRA.ARG" optional="yes"/>\r
576\r
577 <sequential>\r
22e0585c 578 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
878ddf1f 579\r
580 <OnDependency>\r
581 <sourcefiles>\r
22e0585c 582 <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 583 </sourcefiles>\r
584 <targetfiles>\r
22e0585c 585 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 586 </targetfiles>\r
587\r
588 <sequential>\r
589 <strgather commandtype="parse" newdatabase="true">\r
22e0585c 590 <database name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 591 <includepath path="${WORKSPACE_DIR}"/>\r
592 <includepath path="${MODULE_DIR}"/>\r
22e0585c 593 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 594 <EXTRA.INC/>\r
595 <EXTRA.ARG/>\r
22e0585c 596 <inputfile name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 597 </strgather>\r
598 </sequential>\r
599 </OnDependency>\r
600\r
22e0585c 601 <bl name="SDB_FILES" value="${SDB_FILES}, ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 602 </sequential>\r
603 </macrodef>\r
604\r
605 <!--\r
606 .sdb(s) -> .c, .h -> .obj\r
607 -->\r
608 <macrodef name="Build_Unicode_Database">\r
609 <attribute name="FILEPATH"/>\r
610 <attribute name="FILENAME"/>\r
611 <attribute name="FILEEXT" default="sdb"/>\r
612\r
613 <element name="EXTRA.INC" optional="yes"/>\r
614 <element name="EXTRA.ARG" optional="yes"/>\r
615\r
616 <sequential>\r
617 <OnDependency>\r
618 <sourcefiles>\r
619 <file list="${SDB_FILES}"/>\r
620 <file list="${SOURCE_FILES}"/>\r
621 </sourcefiles>\r
622 <targetfiles>\r
22e0585c 623 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 624 </targetfiles>\r
0fd9e137 625\r
878ddf1f 626 <sequential>\r
22e0585c 627 <strgather commandtype="scan" outputdatabase="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb" verbose="read">\r
878ddf1f 628 <skipext name=".uni"/>\r
629 <skipext name=".h"/>\r
630 <database list="${SDB_FILES}"/>\r
631 <inputfile name="${SOURCE_FILES}"/>\r
632 </strgather>\r
633 </sequential>\r
634 </OnDependency>\r
635\r
636 <OnDependency>\r
637 <sourcefiles>\r
22e0585c 638 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 639 </sourcefiles>\r
640 <targetfiles>\r
22e0585c 641 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}StrDefs.h"/>\r
642 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.hpk"/>\r
643 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c"/>\r
878ddf1f 644 </targetfiles>\r
0fd9e137 645\r
878ddf1f 646 <sequential>\r
647 <strgather basename="@{FILENAME}Strings" commandtype="dump"\r
22e0585c 648 outputdefines="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}StrDefs.h"\r
649 outputhpk="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.hpk"\r
650 outputstring="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c">\r
651 <database name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 652 </strgather>\r
653 </sequential>\r
654 </OnDependency>\r
655\r
656 <OnDependency>\r
657 <sourcefiles>\r
22e0585c 658 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c"/>\r
878ddf1f 659 </sourcefiles>\r
660 <targetfiles>\r
22e0585c 661 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Strings.obj"/>\r
878ddf1f 662 </targetfiles>\r
0fd9e137 663\r
878ddf1f 664 <sequential>\r
665 <cc userdefine="on">\r
666 <command type="CC" workdir="${DEST_DIR_OUTPUT}" includepathDelimiter="-I">\r
667 <includepath path="${WORKSPACE_DIR}"/>\r
668 <includepath path="${MODULE_DIR}"/>\r
22e0585c 669 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 670\r
671 <argument value="${CC_FLAGS}"/>\r
22e0585c 672 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Strings.obj"/>\r
878ddf1f 673\r
22e0585c 674 <fileset casesensitive="off" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c"/>\r
878ddf1f 675 </command>\r
676 </cc>\r
677 </sequential>\r
678 </OnDependency>\r
679\r
22e0585c 680 <bl name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Strings.obj"/>\r
878ddf1f 681 </sequential>\r
682 </macrodef>\r
683\r
684 <!--\r
685 Vfr\r
686 -->\r
687 <macrodef name="Build_Vfr">\r
688 <attribute name="FILEPATH"/>\r
689 <attribute name="FILENAME"/>\r
690 <attribute name="FILEEXT" default="vfr"/>\r
691\r
692 <element name="EXTRA.INC" optional="yes"/>\r
693 <element name="EXTRA.ARG" optional="yes"/>\r
694\r
695 <sequential>\r
696 <mkdir dir="${DEST_DIR_DEBUG}/@{FILEPATH}"/>\r
697\r
698 <if>\r
22e0585c 699 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 700 <then>\r
22e0585c 701 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">\r
702 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
703 <!-- <input file="${DEST_DIR_DEBUG}/AutoGen.h"/> -->\r
878ddf1f 704 <includepath path="${WORKSPACE_DIR}"/>\r
705 <includepath path="${MODULE_DIR}"/>\r
22e0585c 706 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 707 <EXTRA.INC/>\r
708 </makedeps>\r
709 </then>\r
710 </if>\r
711\r
712 <OnDependency>\r
713 <sourcefiles>\r
22e0585c 714 <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
878ddf1f 715 </sourcefiles>\r
716 <targetfiles>\r
22e0585c 717 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 718 </targetfiles>\r
719\r
720 <sequential>\r
22e0585c 721 <vfrcompile createIfrBinFile="on" createListFile="on" outPutDir="${DEST_DIR_DEBUG}/@{FILEPATH}" vfrFile="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}">\r
878ddf1f 722 <includepath path="${WORKSPACE_DIR}"/>\r
723 <includepath path="${MODULE_DIR}"/>\r
22e0585c 724 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 725 <EXTRA.INC/>\r
726 </vfrcompile>\r
0fd9e137 727\r
878ddf1f 728 <cc userdefine="on">\r
729 <command type="CC" workdir="${DEST_DIR_OUTPUT}" includepathDelimiter="-I">\r
730 <includepath path="${WORKSPACE_DIR}"/>\r
731 <includepath path="${MODULE_DIR}"/>\r
22e0585c 732 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 733 <argument value="${CC_FLAGS}"/>\r
22e0585c 734 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 735 <EXTRA.ARG/>\r
0fd9e137 736\r
22e0585c 737 <fileset casesensitive="off" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.c"/>\r
878ddf1f 738 </command>\r
739 </cc>\r
0fd9e137 740\r
878ddf1f 741 <delete file="@{FILENAME}.i"/>\r
742 </sequential>\r
743 </OnDependency>\r
22e0585c 744 <bl name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 745 </sequential>\r
746 </macrodef>\r
747\r
748<!--############################################################################\r
749 Build Sections\r
750#############################################################################-->\r
751 <!--\r
752 DLL\r
753 -->\r
754 <macrodef name="GenDll">\r
755 <attribute name="FILEPATH"/>\r
756 <attribute name="FILENAME"/>\r
757 <attribute name="FILEEXT"/>\r
758\r
759 <element name="LIB.ARG" optional="yes"/>\r
760 <element name="LINK.ARG" optional="yes"/>\r
761\r
762 <sequential>\r
763 <OnDependency>\r
764 <sourcefiles>\r
765 <file list="${OBJECTS}"/>\r
766 <file list="${LIBS}"/>\r
767 </sourcefiles>\r
768 <targetfiles>\r
22e0585c 769 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll"/>\r
878ddf1f 770 </targetfiles>\r
771\r
772 <sequential>\r
8b41e66e 773 <cc userdefine="on">\r
774 <command type="LIB">\r
775 <argument value="${LIB_FLAGS}"/>\r
776 <FileList dir="" files="${OBJECTS}"/>\r
777 <LIB.ARG/>\r
f06ffac4 778 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib"/>\r
8b41e66e 779 </command>\r
780 </cc>\r
878ddf1f 781 <cc userdefine="on">\r
782 <command type="LINK">\r
783 <argument value="${LINK_FLAGS}"/>\r
f06ffac4 784 <libset libs="${LIBS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib"/>\r
878ddf1f 785 <LINK.ARG/>\r
878ddf1f 786 <EntryPoint value="_ModuleEntryPoint"/>\r
22e0585c 787 <map value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.map"/>\r
788 <pdb value="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.pdb"/>\r
789 <OutputFile value="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll"/>\r
8b41e66e 790 <!-- <FileList dir="" files="${OBJECTS}"/> -->\r
878ddf1f 791 </command>\r
792 </cc>\r
793 </sequential>\r
794 </OnDependency>\r
795 </sequential>\r
796 </macrodef>\r
797\r
798 <!--\r
799 EFI\r
800 -->\r
801 <macrodef name="GenEfi">\r
802 <attribute name="FILEPATH"/>\r
803 <attribute name="FILENAME"/>\r
804 <attribute name="FILEEXT" default="dll"/>\r
805\r
806 <sequential>\r
807 <OnDependency>\r
808 <sourcefiles>\r
22e0585c 809 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 810 </sourcefiles>\r
811 <targetfiles>\r
22e0585c 812 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
878ddf1f 813 </targetfiles>\r
814\r
815 <sequential>\r
fe3262a3 816 <if>\r
817 <equals arg1="${COMPONENT_TYPE}" arg2="SEC"/>\r
818 <then>\r
819 <var name="COMPONENT_TYPE" value="SECURITY_CORE"/>\r
820 </then>\r
821 </if>\r
0fd9e137 822 <fwimage componenttype="${COMPONENT_TYPE}" outImage="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"\r
22e0585c 823 peImage="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" time="0"/>\r
f06ffac4 824 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${DEST_DIR_DEBUG}/@{FILENAME}.efi" />\r
878ddf1f 825 </sequential>\r
826 </OnDependency>\r
827 </sequential>\r
828 </macrodef>\r
829\r
830<!--\r
831 EFI_SECTION_FREEFORM_SUBTYPE_GUID\r
832 EFI_SECTION_VERSION\r
833 EFI_SECTION_USER_INTERFACE\r
834 EFI_SECTION_DXE_DEPEX\r
835 EFI_SECTION_PEI_DEPEX\r
836 EFI_SECTION_PE32\r
837 EFI_SECTION_PIC\r
838 EFI_SECTION_TE\r
839 EFI_SECTION_RAW\r
840 EFI_SECTION_COMPRESSION\r
841 EFI_SECTION_GUID_DEFINED\r
842 EFI_SECTION_COMPATIBILITY16\r
843 EFI_SECTION_FIRMWARE_VOLUME_IMAGE\r
844 -->\r
845 <!--\r
846 EFI_SECTION_PE32\r
847 -->\r
848 <macrodef name="EFI_SECTION_PE32">\r
849 <attribute name="FILEPATH"/>\r
850 <attribute name="FILENAME"/>\r
851 <attribute name="FILEEXT" default="" />\r
852\r
853 <element name="PRE.PROCESS" optional="yes"/>\r
854 <element name="POST.PROCESS" optional="yes"/>\r
855\r
856 <sequential>\r
857 <PRE.PROCESS/>\r
858\r
859 <if>\r
860 <not>\r
861 <equals arg1="${OBJECTS}" arg2=""/>\r
862 </not>\r
863\r
864 <then>\r
865 <GenDll FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="">\r
866 <LIB.ARG></LIB.ARG>\r
867 <LINK.ARG></LINK.ARG>\r
868 </GenDll>\r
0fd9e137 869\r
878ddf1f 870 <GenEfi FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="dll"/>\r
871 </then>\r
872 </if>\r
873\r
874 <OnDependency>\r
875 <sourcefiles>\r
22e0585c 876 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
878ddf1f 877 </sourcefiles>\r
878 <targetfiles>\r
22e0585c 879 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32"/>\r
878ddf1f 880 </targetfiles>\r
881\r
882 <sequential>\r
22e0585c 883 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${BIN_DIR}/@{FILENAME}.efi" />\r
0fd9e137 884 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"\r
885 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32"\r
878ddf1f 886 sectiontype="EFI_SECTION_PE32"/>\r
0fd9e137 887\r
878ddf1f 888 <POST.PROCESS/>\r
889 </sequential>\r
890 </OnDependency>\r
891 </sequential>\r
892 </macrodef>\r
893\r
894 <!--\r
895 EFI_SECTION_VERSION\r
896 -->\r
897 <macrodef name="EFI_SECTION_VERSION">\r
898 <attribute name="FILEPATH"/>\r
899 <attribute name="FILENAME"/>\r
900 <attribute name="FILEEXT" default="" />\r
901 <attribute name="VERSION" default="0000"/>\r
902\r
903 <element name="PRE.PROCESS" optional="yes"/>\r
904 <element name="POST.PROCESS" optional="yes"/>\r
905\r
906 <sequential>\r
907 <if>\r
908 <not>\r
22e0585c 909 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver"/>\r
878ddf1f 910 </not>\r
911\r
912 <then>\r
913 <PRE.PROCESS/>\r
0fd9e137 914 <gensection outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver"\r
878ddf1f 915 versionnum="@{VERSION}"\r
916 sectiontype="EFI_SECTION_VERSION"/>\r
917 <POST.PROCESS/>\r
918 </then>\r
919 </if>\r
920 </sequential>\r
921 </macrodef>\r
922\r
923 <!--\r
924 EFI_SECTION_USER_INTERFACE\r
925 -->\r
926 <macrodef name="EFI_SECTION_USER_INTERFACE">\r
927 <attribute name="FILEPATH"/>\r
928 <attribute name="FILENAME"/>\r
929 <attribute name="FILEEXT" default="" />\r
930 <attribute name="UI" default="${BASE_NAME}"/>\r
931\r
932 <element name="PRE.PROCESS" optional="yes"/>\r
933 <element name="POST.PROCESS" optional="yes"/>\r
934\r
935 <sequential>\r
936 <if>\r
937 <not>\r
22e0585c 938 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui"/>\r
878ddf1f 939 </not>\r
940\r
941 <then>\r
942 <PRE.PROCESS/>\r
943 <gensection interfacestring="@{UI}"\r
0fd9e137 944 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui"\r
878ddf1f 945 sectiontype="EFI_SECTION_USER_INTERFACE"/>\r
946 <POST.PROCESS/>\r
947 </then>\r
948 </if>\r
949 </sequential>\r
950 </macrodef>\r
951\r
952 <!--\r
953 EFI_SECTION_FREEFORM_SUBTYPE_GUID\r
954 <macrodef name="EFI_SECTION_FREEFORM_SUBTYPE_GUID">\r
955 <attribute name="FILEPATH"/>\r
956 <attribute name="FILENAME"/>\r
957 <attribute name="FILEEXT" default=""/>\r
0fd9e137 958\r
878ddf1f 959 <element name="EXTRA.INC" optional="yes"/>\r
960 <element name="EXTRA.ARG" optional="yes"/>\r
0fd9e137 961\r
878ddf1f 962 <sequential>\r
0fd9e137 963 <gensection inputfile=""\r
964 outputfile=""\r
878ddf1f 965 sectiontype="EFI_SECTION_FREEFORM_SUBTYPE_GUID"/>\r
966 </sequential>\r
967 </macrodef>\r
968 -->\r
969\r
970 <!--\r
971 EFI_SECTION_DXE_DEPEX\r
972 -->\r
973 <macrodef name="EFI_SECTION_DXE_DEPEX">\r
974 <attribute name="FILEPATH"/>\r
975 <attribute name="FILENAME"/>\r
976 <attribute name="FILEEXT" default="dxs"/>\r
977\r
978 <element name="PRE.PROCESS" optional="yes"/>\r
979 <element name="POST.PROCESS" optional="yes"/>\r
980\r
981 <sequential>\r
982 <PRE.PROCESS/>\r
983\r
984 <if>\r
22e0585c 985 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"/>\r
878ddf1f 986 <then>\r
987 <OnDependency>\r
988 <sourcefiles>\r
22e0585c 989 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"/>\r
878ddf1f 990 </sourcefiles>\r
991 <targetfiles>\r
22e0585c 992 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 993 </targetfiles>\r
994 <sequential>\r
0fd9e137 995 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"\r
996 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"\r
878ddf1f 997 sectiontype="EFI_SECTION_DXE_DEPEX"/>\r
998 </sequential>\r
999 </OnDependency>\r
1000 </then>\r
1001 <else>\r
1002 <if>\r
1003 <not>\r
22e0585c 1004 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1005 </not>\r
1006 <then>\r
22e0585c 1007 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1008 </then>\r
1009 </if>\r
1010 </else>\r
1011 </if>\r
1012\r
1013 <POST.PROCESS/>\r
1014 </sequential>\r
1015 </macrodef>\r
1016\r
1017 <!--\r
1018 EFI_SECTION_PEI_DEPEX\r
1019 -->\r
1020 <macrodef name="EFI_SECTION_PEI_DEPEX">\r
1021 <attribute name="FILEPATH"/>\r
1022 <attribute name="FILENAME"/>\r
1023 <attribute name="FILEEXT" default="dxs"/>\r
1024\r
1025 <element name="PRE.PROCESS" optional="yes"/>\r
1026 <element name="POST.PROCESS" optional="yes"/>\r
1027 <sequential>\r
1028 <PRE.PROCESS/>\r
1029 <if>\r
22e0585c 1030 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"/>\r
878ddf1f 1031 <then>\r
1032 <OnDependency>\r
1033 <sourcefiles>\r
22e0585c 1034 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"/>\r
878ddf1f 1035 </sourcefiles>\r
1036 <targetfiles>\r
22e0585c 1037 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1038 </targetfiles>\r
1039\r
1040 <sequential>\r
0fd9e137 1041 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"\r
1042 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"\r
878ddf1f 1043 sectiontype="EFI_SECTION_PEI_DEPEX"/>\r
1044 </sequential>\r
1045 </OnDependency>\r
0fd9e137 1046\r
878ddf1f 1047 </then>\r
1048 <else>\r
1049 <if>\r
1050 <not>\r
22e0585c 1051 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1052 </not>\r
1053 <then>\r
22e0585c 1054 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1055 </then>\r
1056 </if>\r
1057 </else>\r
1058 </if>\r
1059 <POST.PROCESS/>\r
1060 </sequential>\r
1061 </macrodef>\r
1062\r
1063 <!--\r
1064 EFI_SECTION_PIC\r
1065 <macrodef name="EFI_SECTION_PIC">\r
1066 <attribute name="FILEPATH"/>\r
1067 <attribute name="FILENAME"/>\r
1068 <attribute name="FILEEXT" default=""/>\r
0fd9e137 1069\r
878ddf1f 1070 <element name="EXTRA.INC" optional="yes"/>\r
1071 <element name="EXTRA.ARG" optional="yes"/>\r
0fd9e137 1072\r
878ddf1f 1073 <sequential>\r
0fd9e137 1074 <gensection inputfile="${BIN_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
1075 outputfile="${BIN_DIR}/@{FILENAME}.pe32"\r
878ddf1f 1076 sectiontype="EFI_SECTION_PIC"/>\r
1077 </sequential>\r
1078 </macrodef>\r
1079 -->\r
1080\r
1081 <!--\r
1082 EFI_SECTION_TE\r
1083 <macrodef name="EFI_SECTION_TE">\r
1084 <attribute name="FILEPATH"/>\r
1085 <attribute name="FILENAME"/>\r
1086 <attribute name="FILEEXT" default=""/>\r
0fd9e137 1087\r
878ddf1f 1088 <element name="EXTRA.INC" optional="yes"/>\r
1089 <element name="EXTRA.ARG" optional="yes"/>\r
0fd9e137 1090\r
878ddf1f 1091 <sequential>\r
0fd9e137 1092 <gensection inputfile="${BIN_DIR}/@{FILENAME}.@{FILEEXT}"\r
1093 outputfile="${BIN_DIR}/@{FILENAME}.pe32"\r
878ddf1f 1094 sectiontype="EFI_SECTION_PE32"/>\r
1095 </sequential>\r
1096 </macrodef>\r
1097 -->\r
1098\r
1099 <!--\r
1100 EFI_SECTION_RAW\r
1101 -->\r
1102 <macrodef name="EFI_SECTION_RAW">\r
1103 <attribute name="FILEPATH"/>\r
1104 <attribute name="FILENAME"/>\r
1105 <attribute name="FILEEXT" default="bin"/>\r
1106\r
1107 <element name="PRE.PROCESS" optional="yes"/>\r
1108 <element name="POST.PROCESS" optional="yes"/>\r
1109\r
1110 <sequential>\r
1111 <OnDependency>\r
1112 <sourcefiles>\r
22e0585c 1113 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 1114 </sourcefiles>\r
1115 <targetfiles>\r
22e0585c 1116 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>\r
878ddf1f 1117 </targetfiles>\r
1118\r
1119 <sequential>\r
1120 <PRE.PROCESS/>\r
0fd9e137 1121 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}"\r
1122 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"\r
878ddf1f 1123 sectiontype="EFI_SECTION_RAW"/>\r
1124 <POST.PROCESS/>\r
1125 </sequential>\r
1126 </OnDependency>\r
1127 </sequential>\r
1128 </macrodef>\r
1129\r
1130 <!--\r
1131 EFI_SECTION_COMPRESSION\r
1132 <macrodef name="EFI_SECTION_COMPRESSION">\r
1133 <attribute name="FILEPATH"/>\r
1134 <attribute name="FILENAME"/>\r
1135 <attribute name="FILEEXT" default=""/>\r
0fd9e137 1136\r
878ddf1f 1137 <element name="EXTRA.INC" optional="yes"/>\r
1138 <element name="EXTRA.ARG" optional="yes"/>\r
0fd9e137 1139\r
878ddf1f 1140 <sequential>\r
0fd9e137 1141 <gensection inputfile="${BIN_DIR}/@{FILENAME}.@{FILEEXT}"\r
1142 outputfile="${BIN_DIR}/@{FILENAME}.pe32"\r
878ddf1f 1143 sectiontype="EFI_SECTION_PE32"/>\r
1144 </sequential>\r
1145 </macrodef>\r
1146 -->\r
1147\r
1148 <!--\r
1149 EFI_SECTION_GUID_DEFINED\r
1150 <macrodef name="EFI_SECTION_GUID_DEFINED">\r
1151 <attribute name="FILEPATH"/>\r
1152 <attribute name="FILENAME"/>\r
1153 <attribute name="FILEEXT" default=""/>\r
0fd9e137 1154\r
878ddf1f 1155 <element name="EXTRA.INC" optional="yes"/>\r
1156 <element name="EXTRA.ARG" optional="yes"/>\r
0fd9e137 1157\r
878ddf1f 1158 <sequential>\r
0fd9e137 1159 <gensection inputfile="${BIN_DIR}/@{FILENAME}.@{FILEEXT}"\r
1160 outputfile="${BIN_DIR}/@{FILENAME}.pe32"\r
878ddf1f 1161 sectiontype="EFI_SECTION_PE32"/>\r
1162 </sequential>\r
1163 </macrodef>\r
1164 -->\r
1165\r
1166 <!--\r
1167 EFI_SECTION_COMPATIBILITY16\r
1168 <macrodef name="EFI_SECTION_COMPATIBILITY16">\r
1169 <attribute name="FILEPATH"/>\r
1170 <attribute name="FILENAME"/>\r
1171 <attribute name="FILEEXT" default=""/>\r
0fd9e137 1172\r
878ddf1f 1173 <element name="EXTRA.INC" optional="yes"/>\r
1174 <element name="EXTRA.ARG" optional="yes"/>\r
0fd9e137 1175\r
878ddf1f 1176 <sequential>\r
0fd9e137 1177 <gensection inputfile="${BIN_DIR}/@{FILENAME}.@{FILEEXT}"\r
1178 outputfile="${BIN_DIR}/@{FILENAME}.pe32"\r
878ddf1f 1179 sectiontype="EFI_SECTION_PE32"/>\r
1180 </sequential>\r
1181 </macrodef>\r
0fd9e137 1182\r
878ddf1f 1183 -->\r
1184 <!--\r
1185 EFI_SECTION_FIRMWARE_VOLUME_IMAGE\r
1186 -->\r
1187 <macrodef name="EFI_SECTION_FIRMWARE_VOLUME_IMAGE">\r
1188 <attribute name="FILEPATH"/>\r
1189 <attribute name="FILENAME"/>\r
1190 <attribute name="FILEEXT" default="fv"/>\r
1191\r
1192 <element name="PRE.PROCESS" optional="yes"/>\r
1193 <element name="POST.PROCESS" optional="yes"/>\r
1194\r
1195 <sequential>\r
1196 <OnDependency>\r
1197 <sourcefiles>\r
22e0585c 1198 <file name="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 1199 </sourcefiles>\r
1200 <targetfiles>\r
22e0585c 1201 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec"/>\r
878ddf1f 1202 </targetfiles>\r
1203\r
1204 <sequential>\r
1205 <PRE.PROCESS/>\r
0fd9e137 1206\r
1207 <copy file="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
1208 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
878ddf1f 1209 overwrite="true"/>\r
0fd9e137 1210 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
1211 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec"\r
878ddf1f 1212 sectiontype="EFI_SECTION_FIRMWARE_VOLUME_IMAGE"/>\r
0fd9e137 1213\r
878ddf1f 1214 <POST.PROCESS/>\r
1215 </sequential>\r
1216 </OnDependency>\r
1217 </sequential>\r
1218 </macrodef>\r
1219\r
1220 <!--\r
1221 Binary\r
1222 -->\r
1223 <macrodef name="Build_Binary">\r
1224 <attribute name="FILEPATH"/>\r
1225 <attribute name="FILENAME"/>\r
1226 <attribute name="FILEEXT" default="bin"/>\r
1227\r
1228 <element name="EXTRA.INC" optional="yes"/>\r
1229 <element name="EXTRA.ARG" optional="yes"/>\r
1230\r
1231 <sequential>\r
0fd9e137 1232 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
22e0585c 1233 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.bin"/>\r
878ddf1f 1234 </sequential>\r
1235 </macrodef>\r
1236\r
1237 <!--\r
1238 Graphics (bmp, ...)\r
1239 -->\r
1240 <macrodef name="Build_Graphics">\r
1241 <attribute name="FILEPATH"/>\r
1242 <attribute name="FILENAME"/>\r
1243 <attribute name="FILEEXT" default="bmp"/>\r
1244\r
1245 <element name="EXTRA.INC" optional="yes"/>\r
1246 <element name="EXTRA.ARG" optional="yes"/>\r
1247\r
1248 <sequential>\r
0fd9e137 1249 <mkdir dir="${MODULE_DIR}/@{FILEPATH}" />\r
1250 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
22e0585c 1251 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.bin"/>\r
878ddf1f 1252 </sequential>\r
1253 </macrodef>\r
1254 <macrodef name="Build_EFI">\r
1255 <attribute name="FILEPATH"/>\r
1256 <attribute name="FILENAME"/>\r
1257 <attribute name="FILEEXT" default="efi"/>\r
1258\r
1259 <element name="EXTRA.INC" optional="yes"/>\r
1260 <element name="EXTRA.ARG" optional="yes"/>\r
1261\r
1262 <sequential>\r
0fd9e137 1263 <mkdir dir="${MODULE_DIR}/@{FILEPATH}" />\r
1264 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
22e0585c 1265 tofile="${DEST_DIR_OUTPUT}/${BASE_NAME}.efi"/>\r
878ddf1f 1266 </sequential>\r
1267 </macrodef>\r
1268</project>\r