rollback to rev.273, merged new updates as well
[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
286 <cc userdefine="on">\r
287 <command type="CC" workdir="${DEST_DIR_DEBUG}/@{FILEPATH}">\r
288 <includepath path="${WORKSPACE_DIR}"/>\r
289 <includepath path="${MODULE_DIR}"/>\r
290 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
291 <EXTRA.INC/>\r
292 <argument value="${PP_FLAGS}"/>\r
293 <argument value="/FI${DEST_DIR_DEBUG}/AutoGen.h"/>\r
294 <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
295 </command>\r
296 </cc>\r
297 <replaceregexp file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"\r
298 match="^(#line\ +1\ +.*@{FILEPATH}/@{FILENAME}\.@{FILEEXT}&quot;).+\1"\r
299 replace="; Source: ${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
300 flags="gs"/>\r
301 <replaceregexp file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"\r
302 match="([^_a-zA-Z])0x([0-9a-fA-F]+)"\r
303 replace="\10\2h"\r
304 flags="g"\r
305 byline="true"/>\r
306 <move file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"\r
307 tofile="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
308 <cc userdefine="on">\r
309 <command type="ASM">\r
310 <includepath path="${WORKSPACE_DIR}"/>\r
311 <includepath path="${MODULE_DIR}"/>\r
312 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
313 <EXTRA.INC/>\r
314\r
315 <argument value="${ASM_FLAGS}"/>\r
316 <EXTRA.ARG/>\r
317 <argument value="/Fl${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.lst"/>\r
318 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
319\r
320 <fileset casesensitive="off" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
321 </command>\r
322 </cc>\r
323 </sequential>\r
324 </OnDependency>\r
325 <!--\r
326 for library generation later\r
327 -->\r
328 <bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
329 </sequential>\r
330 </macrodef>\r
331\r
878ddf1f 332 <!--\r
333 Library private HashMap map = new HashMap();\r
334 -->\r
335 <macrodef name="Build_Library">\r
336 <attribute name="FILENAME" />\r
337 <attribute name="FILEEXT" default="obj"/>\r
338\r
339 <element name="EXTRA.INC" optional="yes"/>\r
340 <element name="EXTRA.ARG" optional="yes"/>\r
341\r
342 <sequential>\r
343 <mkdir dir="${BIN_DIR}"/>\r
344\r
345 <OnDependency>\r
346 <sourcefiles>\r
347 <file list="${OBJECTS}"/>\r
348 </sourcefiles>\r
349 <targetfiles>\r
22e0585c 350 <file name="${BIN_DIR}/@{FILENAME}.lib"/>\r
878ddf1f 351 </targetfiles>\r
352\r
353 <sequential>\r
354 <!-- <echo>re-generate library</echo> -->\r
355 <cc userdefine="on">\r
356 <command type="LIB">\r
357 <argument value="${LIB_FLAGS}"/>\r
358 <!--<argument value="${OBJECTS}"/>-->\r
359 <FileList dir="" files="${OBJECTS}"/>\r
22e0585c 360 <!-- <argument value="/out:${BIN_DIR}/@{FILENAME}.lib"/> -->\r
361 <OutputFile value="${BIN_DIR}/@{FILENAME}.lib"/>\r
878ddf1f 362 </command>\r
363 </cc>\r
364 </sequential>\r
365 </OnDependency>\r
366 </sequential>\r
367 </macrodef>\r
368\r
75d0c5b1 369 <!--\r
370 GCC Assembly\r
371 -->\r
372 <macrodef name="Build_GCC_Assembly_Code">\r
373 <attribute name="FILEPATH"/>\r
374 <attribute name="FILENAME"/>\r
375 <attribute name="FILEEXT" default="s"/>\r
376\r
377 <element name="EXTRA.INC" optional="yes"/>\r
378 <element name="EXTRA.ARG" optional="yes"/>\r
379\r
380 <sequential>\r
381 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
382\r
383 <if>\r
384 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
385 <then>\r
386 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">\r
387 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
388 <includepath path="${WORKSPACE_DIR}"/>\r
389 <includepath path="${MODULE_DIR}"/>\r
390 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
391 <EXTRA.INC/>\r
392 </makedeps>\r
393 </then>\r
394 </if>\r
395\r
396 <OnDependency>\r
397 <sourcefiles>\r
398 <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
399 </sourcefiles>\r
400 <targetfiles>\r
401 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
402 </targetfiles>\r
403\r
404 <sequential>\r
0fd9e137 405\r
75d0c5b1 406 <cc userdefine="on">\r
407 <command type="ASM" includepathDelimiter="-I">\r
408 <EXTRA.INC/>\r
0fd9e137 409\r
75d0c5b1 410 <argument value="${ASM_FLAGS}"/>\r
411 <EXTRA.ARG/>\r
412 <!-- <argument value="-o ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> -->\r
413 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
0fd9e137 414\r
75d0c5b1 415 <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
416 </command>\r
417 </cc>\r
418 </sequential>\r
419 </OnDependency>\r
420 <!--\r
421 for library generation later\r
422 -->\r
423 <bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
424 </sequential>\r
425 </macrodef>\r
426\r
878ddf1f 427 <!--\r
428 IPF Assembly\r
429 -->\r
430 <macrodef name="Build_IPF_Assembly_Code">\r
431 <attribute name="FILEPATH"/>\r
432 <attribute name="FILENAME"/>\r
433 <attribute name="FILEEXT" default="s"/>\r
434\r
435 <element name="EXTRA.INC" optional="yes"/>\r
436 <element name="EXTRA.ARG" optional="yes"/>\r
437\r
438 <sequential>\r
0fd9e137 439 <mkdir dir="${DEST_DIR_DEBUG}/@{FILEPATH}"/>\r
22e0585c 440 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
878ddf1f 441\r
442 <if>\r
22e0585c 443 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 444 <then>\r
22e0585c 445 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">\r
446 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 447 <includepath path="${WORKSPACE_DIR}"/>\r
448 <includepath path="${MODULE_DIR}"/>\r
22e0585c 449 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 450 <EXTRA.INC/>\r
451 </makedeps>\r
452 </then>\r
453 </if>\r
454\r
455 <OnDependency>\r
456 <sourcefiles>\r
22e0585c 457 <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
878ddf1f 458 </sourcefiles>\r
459 <targetfiles>\r
22e0585c 460 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 461 </targetfiles>\r
462\r
463 <sequential>\r
878ddf1f 464 <cc userdefine="on">\r
0fd9e137 465 <command type="CC" workdir="${DEST_DIR_DEBUG}/@{FILEPATH}">\r
878ddf1f 466 <includepath path="${WORKSPACE_DIR}"/>\r
467 <includepath path="${MODULE_DIR}"/>\r
22e0585c 468 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 469 <EXTRA.INC/>\r
470 <argument value="${PP_FLAGS}"/>\r
0fd9e137 471 <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 472 </command>\r
473 </cc>\r
0fd9e137 474 <move file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"\r
22e0585c 475 tofile="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.pro"/>\r
878ddf1f 476 <cc userdefine="on">\r
477 <command type="ASM" includepathDelimiter="-I">\r
478 <includepath path="${WORKSPACE_DIR}"/>\r
479 <includepath path="${MODULE_DIR}"/>\r
22e0585c 480 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 481 <EXTRA.INC/>\r
0fd9e137 482\r
878ddf1f 483 <argument value="${ASM_FLAGS}"/>\r
484 <EXTRA.ARG/>\r
22e0585c 485 <!-- <argument value="-o ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> -->\r
486 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
0fd9e137 487\r
22e0585c 488 <fileset casesensitive="off" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.pro"/>\r
878ddf1f 489 </command>\r
490 </cc>\r
491 </sequential>\r
492 </OnDependency>\r
493 <!--\r
494 for library generation later\r
495 -->\r
22e0585c 496 <bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 497 </sequential>\r
498 </macrodef>\r
499\r
500\r
501 <macrodef name="Build_IPF_PP_Code">\r
502 <attribute name="FILEPATH"/>\r
503 <attribute name="FILENAME"/>\r
504 <attribute name="FILEEXT" default="i"/>\r
505\r
506 <element name="EXTRA.INC" optional="yes"/>\r
507 <element name="EXTRA.ARG" optional="yes"/>\r
508\r
509 <sequential>\r
22e0585c 510 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
0fd9e137 511\r
878ddf1f 512 <cc userdefine="on">\r
513 <command type="ASM" includepathDelimiter="-I">\r
514 <includepath path="${WORKSPACE_DIR}"/>\r
515 <includepath path="${MODULE_DIR}"/>\r
22e0585c 516 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 517 <EXTRA.INC/>\r
0fd9e137 518\r
878ddf1f 519 <argument value="${ASM_FLAGS}"/>\r
520 <EXTRA.ARG/>\r
22e0585c 521 <!-- <argument value="-o ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> -->\r
522 <OutputFile File="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
0fd9e137 523\r
22e0585c 524 <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 525 </command>\r
526 </cc>\r
0fd9e137 527\r
878ddf1f 528 <!--\r
529 for library generation later\r
530 -->\r
22e0585c 531 <bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 532 </sequential>\r
533 </macrodef>\r
0fd9e137 534\r
878ddf1f 535 <!--\r
536 [Build.Ia32.Makefile,Build.Ipf.Makefile,Build.Ebc.Makefile]\r
537 [Build.Ia32.Custom_Makefile,Build.Ipf.Custom_Makefile,Build.Ebc.Custom_Makefile]\r
538 -->\r
539 <macrodef name="Build_Custom_Build">\r
540 <attribute name="FILEPATH"/>\r
541 <attribute name="FILENAME"/>\r
542 <attribute name="FILEEXT" default="c"/>\r
543\r
544 <element name="EXTRA.INC" optional="yes"/>\r
545 <element name="EXTRA.ARG" optional="yes"/>\r
546\r
547 <sequential>\r
548\r
549 </sequential>\r
550 </macrodef>\r
551\r
552 <!--\r
553 Unicode -> .sdb\r
554 -->\r
555 <macrodef name="Build_Unicode">\r
556 <attribute name="FILEPATH"/>\r
557 <attribute name="FILENAME"/>\r
558 <attribute name="FILEEXT" default="uni"/>\r
559\r
560 <element name="EXTRA.INC" optional="yes"/>\r
561 <element name="EXTRA.ARG" optional="yes"/>\r
562\r
563 <sequential>\r
22e0585c 564 <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>\r
878ddf1f 565\r
566 <OnDependency>\r
567 <sourcefiles>\r
22e0585c 568 <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 569 </sourcefiles>\r
570 <targetfiles>\r
22e0585c 571 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 572 </targetfiles>\r
573\r
574 <sequential>\r
575 <strgather commandtype="parse" newdatabase="true">\r
22e0585c 576 <database name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 577 <includepath path="${WORKSPACE_DIR}"/>\r
578 <includepath path="${MODULE_DIR}"/>\r
22e0585c 579 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 580 <EXTRA.INC/>\r
581 <EXTRA.ARG/>\r
22e0585c 582 <inputfile name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 583 </strgather>\r
584 </sequential>\r
585 </OnDependency>\r
586\r
22e0585c 587 <bl name="SDB_FILES" value="${SDB_FILES}, ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 588 </sequential>\r
589 </macrodef>\r
590\r
591 <!--\r
592 .sdb(s) -> .c, .h -> .obj\r
593 -->\r
594 <macrodef name="Build_Unicode_Database">\r
595 <attribute name="FILEPATH"/>\r
596 <attribute name="FILENAME"/>\r
597 <attribute name="FILEEXT" default="sdb"/>\r
598\r
599 <element name="EXTRA.INC" optional="yes"/>\r
600 <element name="EXTRA.ARG" optional="yes"/>\r
601\r
602 <sequential>\r
603 <OnDependency>\r
604 <sourcefiles>\r
605 <file list="${SDB_FILES}"/>\r
606 <file list="${SOURCE_FILES}"/>\r
607 </sourcefiles>\r
608 <targetfiles>\r
22e0585c 609 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 610 </targetfiles>\r
0fd9e137 611\r
878ddf1f 612 <sequential>\r
22e0585c 613 <strgather commandtype="scan" outputdatabase="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb" verbose="read">\r
878ddf1f 614 <skipext name=".uni"/>\r
615 <skipext name=".h"/>\r
616 <database list="${SDB_FILES}"/>\r
617 <inputfile name="${SOURCE_FILES}"/>\r
618 </strgather>\r
619 </sequential>\r
620 </OnDependency>\r
621\r
622 <OnDependency>\r
623 <sourcefiles>\r
22e0585c 624 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 625 </sourcefiles>\r
626 <targetfiles>\r
22e0585c 627 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}StrDefs.h"/>\r
628 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.hpk"/>\r
629 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c"/>\r
878ddf1f 630 </targetfiles>\r
0fd9e137 631\r
878ddf1f 632 <sequential>\r
633 <strgather basename="@{FILENAME}Strings" commandtype="dump"\r
22e0585c 634 outputdefines="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}StrDefs.h"\r
635 outputhpk="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.hpk"\r
636 outputstring="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c">\r
637 <database name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>\r
878ddf1f 638 </strgather>\r
639 </sequential>\r
640 </OnDependency>\r
641\r
642 <OnDependency>\r
643 <sourcefiles>\r
22e0585c 644 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c"/>\r
878ddf1f 645 </sourcefiles>\r
646 <targetfiles>\r
22e0585c 647 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Strings.obj"/>\r
878ddf1f 648 </targetfiles>\r
0fd9e137 649\r
878ddf1f 650 <sequential>\r
651 <cc userdefine="on">\r
652 <command type="CC" workdir="${DEST_DIR_OUTPUT}" includepathDelimiter="-I">\r
653 <includepath path="${WORKSPACE_DIR}"/>\r
654 <includepath path="${MODULE_DIR}"/>\r
22e0585c 655 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 656\r
657 <argument value="${CC_FLAGS}"/>\r
22e0585c 658 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Strings.obj"/>\r
878ddf1f 659\r
22e0585c 660 <fileset casesensitive="off" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}Strings.c"/>\r
878ddf1f 661 </command>\r
662 </cc>\r
663 </sequential>\r
664 </OnDependency>\r
665\r
22e0585c 666 <bl name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Strings.obj"/>\r
878ddf1f 667 </sequential>\r
668 </macrodef>\r
669\r
670 <!--\r
671 Vfr\r
672 -->\r
673 <macrodef name="Build_Vfr">\r
674 <attribute name="FILEPATH"/>\r
675 <attribute name="FILENAME"/>\r
676 <attribute name="FILEEXT" default="vfr"/>\r
677\r
678 <element name="EXTRA.INC" optional="yes"/>\r
679 <element name="EXTRA.ARG" optional="yes"/>\r
680\r
681 <sequential>\r
682 <mkdir dir="${DEST_DIR_DEBUG}/@{FILEPATH}"/>\r
683\r
684 <if>\r
22e0585c 685 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 686 <then>\r
22e0585c 687 <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">\r
688 <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
689 <!-- <input file="${DEST_DIR_DEBUG}/AutoGen.h"/> -->\r
878ddf1f 690 <includepath path="${WORKSPACE_DIR}"/>\r
691 <includepath path="${MODULE_DIR}"/>\r
22e0585c 692 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 693 <EXTRA.INC/>\r
694 </makedeps>\r
695 </then>\r
696 </if>\r
697\r
698 <OnDependency>\r
699 <sourcefiles>\r
22e0585c 700 <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>\r
878ddf1f 701 </sourcefiles>\r
702 <targetfiles>\r
22e0585c 703 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 704 </targetfiles>\r
705\r
706 <sequential>\r
22e0585c 707 <vfrcompile createIfrBinFile="on" createListFile="on" outPutDir="${DEST_DIR_DEBUG}/@{FILEPATH}" vfrFile="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}">\r
878ddf1f 708 <includepath path="${WORKSPACE_DIR}"/>\r
709 <includepath path="${MODULE_DIR}"/>\r
22e0585c 710 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 711 <EXTRA.INC/>\r
712 </vfrcompile>\r
0fd9e137 713\r
878ddf1f 714 <cc userdefine="on">\r
715 <command type="CC" workdir="${DEST_DIR_OUTPUT}" includepathDelimiter="-I">\r
716 <includepath path="${WORKSPACE_DIR}"/>\r
717 <includepath path="${MODULE_DIR}"/>\r
22e0585c 718 <includepath path="${MODULE_DIR}/${ARCH}"/>\r
878ddf1f 719 <argument value="${CC_FLAGS}"/>\r
22e0585c 720 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 721 <EXTRA.ARG/>\r
0fd9e137 722\r
22e0585c 723 <fileset casesensitive="off" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.c"/>\r
878ddf1f 724 </command>\r
725 </cc>\r
0fd9e137 726\r
878ddf1f 727 <delete file="@{FILENAME}.i"/>\r
728 </sequential>\r
729 </OnDependency>\r
22e0585c 730 <bl name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>\r
878ddf1f 731 </sequential>\r
732 </macrodef>\r
733\r
734<!--############################################################################\r
735 Build Sections\r
736#############################################################################-->\r
737 <!--\r
738 DLL\r
739 -->\r
740 <macrodef name="GenDll">\r
741 <attribute name="FILEPATH"/>\r
742 <attribute name="FILENAME"/>\r
743 <attribute name="FILEEXT"/>\r
744\r
745 <element name="LIB.ARG" optional="yes"/>\r
746 <element name="LINK.ARG" optional="yes"/>\r
747\r
748 <sequential>\r
749 <OnDependency>\r
750 <sourcefiles>\r
751 <file list="${OBJECTS}"/>\r
752 <file list="${LIBS}"/>\r
753 </sourcefiles>\r
754 <targetfiles>\r
22e0585c 755 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll"/>\r
878ddf1f 756 </targetfiles>\r
757\r
758 <sequential>\r
8b41e66e 759 <cc userdefine="on">\r
760 <command type="LIB">\r
761 <argument value="${LIB_FLAGS}"/>\r
762 <FileList dir="" files="${OBJECTS}"/>\r
763 <LIB.ARG/>\r
f06ffac4 764 <OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib"/>\r
8b41e66e 765 </command>\r
766 </cc>\r
878ddf1f 767 <cc userdefine="on">\r
768 <command type="LINK">\r
769 <argument value="${LINK_FLAGS}"/>\r
f06ffac4 770 <libset libs="${LIBS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib"/>\r
878ddf1f 771 <LINK.ARG/>\r
878ddf1f 772 <EntryPoint value="_ModuleEntryPoint"/>\r
22e0585c 773 <map value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.map"/>\r
774 <pdb value="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.pdb"/>\r
775 <OutputFile value="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll"/>\r
8b41e66e 776 <!-- <FileList dir="" files="${OBJECTS}"/> -->\r
878ddf1f 777 </command>\r
778 </cc>\r
779 </sequential>\r
780 </OnDependency>\r
781 </sequential>\r
782 </macrodef>\r
783\r
784 <!--\r
785 EFI\r
786 -->\r
787 <macrodef name="GenEfi">\r
788 <attribute name="FILEPATH"/>\r
789 <attribute name="FILENAME"/>\r
790 <attribute name="FILEEXT" default="dll"/>\r
791\r
792 <sequential>\r
793 <OnDependency>\r
794 <sourcefiles>\r
22e0585c 795 <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 796 </sourcefiles>\r
797 <targetfiles>\r
22e0585c 798 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
878ddf1f 799 </targetfiles>\r
800\r
801 <sequential>\r
0fd9e137 802 <fwimage componenttype="${COMPONENT_TYPE}" outImage="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"\r
22e0585c 803 peImage="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" time="0"/>\r
f06ffac4 804 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${DEST_DIR_DEBUG}/@{FILENAME}.efi" />\r
878ddf1f 805 </sequential>\r
806 </OnDependency>\r
807 </sequential>\r
808 </macrodef>\r
809\r
810<!--\r
811 EFI_SECTION_FREEFORM_SUBTYPE_GUID\r
812 EFI_SECTION_VERSION\r
813 EFI_SECTION_USER_INTERFACE\r
814 EFI_SECTION_DXE_DEPEX\r
815 EFI_SECTION_PEI_DEPEX\r
816 EFI_SECTION_PE32\r
817 EFI_SECTION_PIC\r
818 EFI_SECTION_TE\r
819 EFI_SECTION_RAW\r
820 EFI_SECTION_COMPRESSION\r
821 EFI_SECTION_GUID_DEFINED\r
822 EFI_SECTION_COMPATIBILITY16\r
823 EFI_SECTION_FIRMWARE_VOLUME_IMAGE\r
824 -->\r
825 <!--\r
826 EFI_SECTION_PE32\r
827 -->\r
828 <macrodef name="EFI_SECTION_PE32">\r
829 <attribute name="FILEPATH"/>\r
830 <attribute name="FILENAME"/>\r
831 <attribute name="FILEEXT" default="" />\r
832\r
833 <element name="PRE.PROCESS" optional="yes"/>\r
834 <element name="POST.PROCESS" optional="yes"/>\r
835\r
836 <sequential>\r
837 <PRE.PROCESS/>\r
838\r
839 <if>\r
840 <not>\r
841 <equals arg1="${OBJECTS}" arg2=""/>\r
842 </not>\r
843\r
844 <then>\r
845 <GenDll FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="">\r
846 <LIB.ARG></LIB.ARG>\r
847 <LINK.ARG></LINK.ARG>\r
848 </GenDll>\r
0fd9e137 849\r
878ddf1f 850 <GenEfi FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="dll"/>\r
851 </then>\r
852 </if>\r
853\r
854 <OnDependency>\r
855 <sourcefiles>\r
22e0585c 856 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"/>\r
878ddf1f 857 </sourcefiles>\r
858 <targetfiles>\r
22e0585c 859 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32"/>\r
878ddf1f 860 </targetfiles>\r
861\r
862 <sequential>\r
22e0585c 863 <copy file="${DEST_DIR_OUTPUT}/@{FILENAME}.efi" tofile="${BIN_DIR}/@{FILENAME}.efi" />\r
0fd9e137 864 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.efi"\r
865 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.pe32"\r
878ddf1f 866 sectiontype="EFI_SECTION_PE32"/>\r
0fd9e137 867\r
878ddf1f 868 <POST.PROCESS/>\r
869 </sequential>\r
870 </OnDependency>\r
871 </sequential>\r
872 </macrodef>\r
873\r
874 <!--\r
875 EFI_SECTION_VERSION\r
876 -->\r
877 <macrodef name="EFI_SECTION_VERSION">\r
878 <attribute name="FILEPATH"/>\r
879 <attribute name="FILENAME"/>\r
880 <attribute name="FILEEXT" default="" />\r
881 <attribute name="VERSION" default="0000"/>\r
882\r
883 <element name="PRE.PROCESS" optional="yes"/>\r
884 <element name="POST.PROCESS" optional="yes"/>\r
885\r
886 <sequential>\r
887 <if>\r
888 <not>\r
22e0585c 889 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver"/>\r
878ddf1f 890 </not>\r
891\r
892 <then>\r
893 <PRE.PROCESS/>\r
0fd9e137 894 <gensection outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ver"\r
878ddf1f 895 versionnum="@{VERSION}"\r
896 sectiontype="EFI_SECTION_VERSION"/>\r
897 <POST.PROCESS/>\r
898 </then>\r
899 </if>\r
900 </sequential>\r
901 </macrodef>\r
902\r
903 <!--\r
904 EFI_SECTION_USER_INTERFACE\r
905 -->\r
906 <macrodef name="EFI_SECTION_USER_INTERFACE">\r
907 <attribute name="FILEPATH"/>\r
908 <attribute name="FILENAME"/>\r
909 <attribute name="FILEEXT" default="" />\r
910 <attribute name="UI" default="${BASE_NAME}"/>\r
911\r
912 <element name="PRE.PROCESS" optional="yes"/>\r
913 <element name="POST.PROCESS" optional="yes"/>\r
914\r
915 <sequential>\r
916 <if>\r
917 <not>\r
22e0585c 918 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui"/>\r
878ddf1f 919 </not>\r
920\r
921 <then>\r
922 <PRE.PROCESS/>\r
923 <gensection interfacestring="@{UI}"\r
0fd9e137 924 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.ui"\r
878ddf1f 925 sectiontype="EFI_SECTION_USER_INTERFACE"/>\r
926 <POST.PROCESS/>\r
927 </then>\r
928 </if>\r
929 </sequential>\r
930 </macrodef>\r
931\r
932 <!--\r
933 EFI_SECTION_FREEFORM_SUBTYPE_GUID\r
934 <macrodef name="EFI_SECTION_FREEFORM_SUBTYPE_GUID">\r
935 <attribute name="FILEPATH"/>\r
936 <attribute name="FILENAME"/>\r
937 <attribute name="FILEEXT" default=""/>\r
0fd9e137 938\r
878ddf1f 939 <element name="EXTRA.INC" optional="yes"/>\r
940 <element name="EXTRA.ARG" optional="yes"/>\r
0fd9e137 941\r
878ddf1f 942 <sequential>\r
0fd9e137 943 <gensection inputfile=""\r
944 outputfile=""\r
878ddf1f 945 sectiontype="EFI_SECTION_FREEFORM_SUBTYPE_GUID"/>\r
946 </sequential>\r
947 </macrodef>\r
948 -->\r
949\r
950 <!--\r
951 EFI_SECTION_DXE_DEPEX\r
952 -->\r
953 <macrodef name="EFI_SECTION_DXE_DEPEX">\r
954 <attribute name="FILEPATH"/>\r
955 <attribute name="FILENAME"/>\r
956 <attribute name="FILEEXT" default="dxs"/>\r
957\r
958 <element name="PRE.PROCESS" optional="yes"/>\r
959 <element name="POST.PROCESS" optional="yes"/>\r
960\r
961 <sequential>\r
962 <PRE.PROCESS/>\r
963\r
964 <if>\r
22e0585c 965 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"/>\r
878ddf1f 966 <then>\r
967 <OnDependency>\r
968 <sourcefiles>\r
22e0585c 969 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"/>\r
878ddf1f 970 </sourcefiles>\r
971 <targetfiles>\r
22e0585c 972 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 973 </targetfiles>\r
974 <sequential>\r
0fd9e137 975 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"\r
976 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"\r
878ddf1f 977 sectiontype="EFI_SECTION_DXE_DEPEX"/>\r
978 </sequential>\r
979 </OnDependency>\r
980 </then>\r
981 <else>\r
982 <if>\r
983 <not>\r
22e0585c 984 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 985 </not>\r
986 <then>\r
22e0585c 987 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 988 </then>\r
989 </if>\r
990 </else>\r
991 </if>\r
992\r
993 <POST.PROCESS/>\r
994 </sequential>\r
995 </macrodef>\r
996\r
997 <!--\r
998 EFI_SECTION_PEI_DEPEX\r
999 -->\r
1000 <macrodef name="EFI_SECTION_PEI_DEPEX">\r
1001 <attribute name="FILEPATH"/>\r
1002 <attribute name="FILENAME"/>\r
1003 <attribute name="FILEEXT" default="dxs"/>\r
1004\r
1005 <element name="PRE.PROCESS" optional="yes"/>\r
1006 <element name="POST.PROCESS" optional="yes"/>\r
1007 <sequential>\r
1008 <PRE.PROCESS/>\r
1009 <if>\r
22e0585c 1010 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"/>\r
878ddf1f 1011 <then>\r
1012 <OnDependency>\r
1013 <sourcefiles>\r
22e0585c 1014 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"/>\r
878ddf1f 1015 </sourcefiles>\r
1016 <targetfiles>\r
22e0585c 1017 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1018 </targetfiles>\r
1019\r
1020 <sequential>\r
0fd9e137 1021 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}.depex"\r
1022 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"\r
878ddf1f 1023 sectiontype="EFI_SECTION_PEI_DEPEX"/>\r
1024 </sequential>\r
1025 </OnDependency>\r
0fd9e137 1026\r
878ddf1f 1027 </then>\r
1028 <else>\r
1029 <if>\r
1030 <not>\r
22e0585c 1031 <available type="file" file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1032 </not>\r
1033 <then>\r
22e0585c 1034 <touch file="${DEST_DIR_OUTPUT}/@{FILENAME}.dpx"/>\r
878ddf1f 1035 </then>\r
1036 </if>\r
1037 </else>\r
1038 </if>\r
1039 <POST.PROCESS/>\r
1040 </sequential>\r
1041 </macrodef>\r
1042\r
1043 <!--\r
1044 EFI_SECTION_PIC\r
1045 <macrodef name="EFI_SECTION_PIC">\r
1046 <attribute name="FILEPATH"/>\r
1047 <attribute name="FILENAME"/>\r
1048 <attribute name="FILEEXT" default=""/>\r
0fd9e137 1049\r
878ddf1f 1050 <element name="EXTRA.INC" optional="yes"/>\r
1051 <element name="EXTRA.ARG" optional="yes"/>\r
0fd9e137 1052\r
878ddf1f 1053 <sequential>\r
0fd9e137 1054 <gensection inputfile="${BIN_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
1055 outputfile="${BIN_DIR}/@{FILENAME}.pe32"\r
878ddf1f 1056 sectiontype="EFI_SECTION_PIC"/>\r
1057 </sequential>\r
1058 </macrodef>\r
1059 -->\r
1060\r
1061 <!--\r
1062 EFI_SECTION_TE\r
1063 <macrodef name="EFI_SECTION_TE">\r
1064 <attribute name="FILEPATH"/>\r
1065 <attribute name="FILENAME"/>\r
1066 <attribute name="FILEEXT" default=""/>\r
0fd9e137 1067\r
878ddf1f 1068 <element name="EXTRA.INC" optional="yes"/>\r
1069 <element name="EXTRA.ARG" optional="yes"/>\r
0fd9e137 1070\r
878ddf1f 1071 <sequential>\r
0fd9e137 1072 <gensection inputfile="${BIN_DIR}/@{FILENAME}.@{FILEEXT}"\r
1073 outputfile="${BIN_DIR}/@{FILENAME}.pe32"\r
878ddf1f 1074 sectiontype="EFI_SECTION_PE32"/>\r
1075 </sequential>\r
1076 </macrodef>\r
1077 -->\r
1078\r
1079 <!--\r
1080 EFI_SECTION_RAW\r
1081 -->\r
1082 <macrodef name="EFI_SECTION_RAW">\r
1083 <attribute name="FILEPATH"/>\r
1084 <attribute name="FILENAME"/>\r
1085 <attribute name="FILEEXT" default="bin"/>\r
1086\r
1087 <element name="PRE.PROCESS" optional="yes"/>\r
1088 <element name="POST.PROCESS" optional="yes"/>\r
1089\r
1090 <sequential>\r
1091 <OnDependency>\r
1092 <sourcefiles>\r
22e0585c 1093 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 1094 </sourcefiles>\r
1095 <targetfiles>\r
22e0585c 1096 <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>\r
878ddf1f 1097 </targetfiles>\r
1098\r
1099 <sequential>\r
1100 <PRE.PROCESS/>\r
0fd9e137 1101 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}"\r
1102 outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"\r
878ddf1f 1103 sectiontype="EFI_SECTION_RAW"/>\r
1104 <POST.PROCESS/>\r
1105 </sequential>\r
1106 </OnDependency>\r
1107 </sequential>\r
1108 </macrodef>\r
1109\r
1110 <!--\r
1111 EFI_SECTION_COMPRESSION\r
1112 <macrodef name="EFI_SECTION_COMPRESSION">\r
1113 <attribute name="FILEPATH"/>\r
1114 <attribute name="FILENAME"/>\r
1115 <attribute name="FILEEXT" default=""/>\r
0fd9e137 1116\r
878ddf1f 1117 <element name="EXTRA.INC" optional="yes"/>\r
1118 <element name="EXTRA.ARG" optional="yes"/>\r
0fd9e137 1119\r
878ddf1f 1120 <sequential>\r
0fd9e137 1121 <gensection inputfile="${BIN_DIR}/@{FILENAME}.@{FILEEXT}"\r
1122 outputfile="${BIN_DIR}/@{FILENAME}.pe32"\r
878ddf1f 1123 sectiontype="EFI_SECTION_PE32"/>\r
1124 </sequential>\r
1125 </macrodef>\r
1126 -->\r
1127\r
1128 <!--\r
1129 EFI_SECTION_GUID_DEFINED\r
1130 <macrodef name="EFI_SECTION_GUID_DEFINED">\r
1131 <attribute name="FILEPATH"/>\r
1132 <attribute name="FILENAME"/>\r
1133 <attribute name="FILEEXT" default=""/>\r
0fd9e137 1134\r
878ddf1f 1135 <element name="EXTRA.INC" optional="yes"/>\r
1136 <element name="EXTRA.ARG" optional="yes"/>\r
0fd9e137 1137\r
878ddf1f 1138 <sequential>\r
0fd9e137 1139 <gensection inputfile="${BIN_DIR}/@{FILENAME}.@{FILEEXT}"\r
1140 outputfile="${BIN_DIR}/@{FILENAME}.pe32"\r
878ddf1f 1141 sectiontype="EFI_SECTION_PE32"/>\r
1142 </sequential>\r
1143 </macrodef>\r
1144 -->\r
1145\r
1146 <!--\r
1147 EFI_SECTION_COMPATIBILITY16\r
1148 <macrodef name="EFI_SECTION_COMPATIBILITY16">\r
1149 <attribute name="FILEPATH"/>\r
1150 <attribute name="FILENAME"/>\r
1151 <attribute name="FILEEXT" default=""/>\r
0fd9e137 1152\r
878ddf1f 1153 <element name="EXTRA.INC" optional="yes"/>\r
1154 <element name="EXTRA.ARG" optional="yes"/>\r
0fd9e137 1155\r
878ddf1f 1156 <sequential>\r
0fd9e137 1157 <gensection inputfile="${BIN_DIR}/@{FILENAME}.@{FILEEXT}"\r
1158 outputfile="${BIN_DIR}/@{FILENAME}.pe32"\r
878ddf1f 1159 sectiontype="EFI_SECTION_PE32"/>\r
1160 </sequential>\r
1161 </macrodef>\r
0fd9e137 1162\r
878ddf1f 1163 -->\r
1164 <!--\r
1165 EFI_SECTION_FIRMWARE_VOLUME_IMAGE\r
1166 -->\r
1167 <macrodef name="EFI_SECTION_FIRMWARE_VOLUME_IMAGE">\r
1168 <attribute name="FILEPATH"/>\r
1169 <attribute name="FILENAME"/>\r
1170 <attribute name="FILEEXT" default="fv"/>\r
1171\r
1172 <element name="PRE.PROCESS" optional="yes"/>\r
1173 <element name="POST.PROCESS" optional="yes"/>\r
1174\r
1175 <sequential>\r
1176 <OnDependency>\r
1177 <sourcefiles>\r
22e0585c 1178 <file name="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
878ddf1f 1179 </sourcefiles>\r
1180 <targetfiles>\r
22e0585c 1181 <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec"/>\r
878ddf1f 1182 </targetfiles>\r
1183\r
1184 <sequential>\r
1185 <PRE.PROCESS/>\r
0fd9e137 1186\r
1187 <copy file="${FV_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
1188 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
878ddf1f 1189 overwrite="true"/>\r
0fd9e137 1190 <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
1191 outputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}fv.sec"\r
878ddf1f 1192 sectiontype="EFI_SECTION_FIRMWARE_VOLUME_IMAGE"/>\r
0fd9e137 1193\r
878ddf1f 1194 <POST.PROCESS/>\r
1195 </sequential>\r
1196 </OnDependency>\r
1197 </sequential>\r
1198 </macrodef>\r
1199\r
1200 <!--\r
1201 Binary\r
1202 -->\r
1203 <macrodef name="Build_Binary">\r
1204 <attribute name="FILEPATH"/>\r
1205 <attribute name="FILENAME"/>\r
1206 <attribute name="FILEEXT" default="bin"/>\r
1207\r
1208 <element name="EXTRA.INC" optional="yes"/>\r
1209 <element name="EXTRA.ARG" optional="yes"/>\r
1210\r
1211 <sequential>\r
0fd9e137 1212 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
22e0585c 1213 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.bin"/>\r
878ddf1f 1214 </sequential>\r
1215 </macrodef>\r
1216\r
1217 <!--\r
1218 Graphics (bmp, ...)\r
1219 -->\r
1220 <macrodef name="Build_Graphics">\r
1221 <attribute name="FILEPATH"/>\r
1222 <attribute name="FILENAME"/>\r
1223 <attribute name="FILEEXT" default="bmp"/>\r
1224\r
1225 <element name="EXTRA.INC" optional="yes"/>\r
1226 <element name="EXTRA.ARG" optional="yes"/>\r
1227\r
1228 <sequential>\r
0fd9e137 1229 <mkdir dir="${MODULE_DIR}/@{FILEPATH}" />\r
1230 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
22e0585c 1231 tofile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.bin"/>\r
878ddf1f 1232 </sequential>\r
1233 </macrodef>\r
1234 <macrodef name="Build_EFI">\r
1235 <attribute name="FILEPATH"/>\r
1236 <attribute name="FILENAME"/>\r
1237 <attribute name="FILEEXT" default="efi"/>\r
1238\r
1239 <element name="EXTRA.INC" optional="yes"/>\r
1240 <element name="EXTRA.ARG" optional="yes"/>\r
1241\r
1242 <sequential>\r
0fd9e137 1243 <mkdir dir="${MODULE_DIR}/@{FILEPATH}" />\r
1244 <copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"\r
22e0585c 1245 tofile="${DEST_DIR_OUTPUT}/${BASE_NAME}.efi"/>\r
878ddf1f 1246 </sequential>\r
1247 </macrodef>\r
1248</project>\r