Rename x64 to X64
[efi/edk2/.git] / edk2 / Tools / Source / TianoTools / GenFvImage / build.xml
1 <?xml version="1.0" ?>\r
2 <!--\r
3 Copyright (c) 2006, Intel Corporation\r
4 All rights reserved. This program and the accompanying materials\r
5 are licensed and made available under the terms and conditions of the BSD License\r
6 which accompanies this distribution.  The full text of the license may be found at\r
7 http://opensource.org/licenses/bsd-license.php\r
8 \r
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11 -->\r
12 <project default="GenTool" basedir=".">\r
13 <!--\r
14     EDK GenFvImage Tool\r
15   Copyright (c) 2006, Intel Corporation\r
16 -->\r
17   <property name="ToolName" value="GenFvImage"/>\r
18   <property name="FileSet" value="BasePeCoff.c GenFvImageLib.c GenFvImageExe.c"/>\r
19 \r
20   <taskdef resource="cpptasks.tasks"/>\r
21   <typedef resource="cpptasks.types"/>\r
22   <taskdef resource="net/sf/antcontrib/antlib.xml"/>\r
23 \r
24   <property environment="env"/>\r
25 \r
26   <property name="LINK_OUTPUT_TYPE" value="static"/>\r
27   <property name="BUILD_DIR_IA32" value="${PACKAGE_DIR}/${ToolName}/tmp/Ia32"/>\r
28   <property name="BUILD_DIR_X64" value="${PACKAGE_DIR}/${ToolName}/tmp/X64"/>\r
29   <property name="BUILD_DIR_IPF" value="${PACKAGE_DIR}/${ToolName}/tmp/Ipf"/>\r
30 \r
31   <target name="GenTool" depends="init, Tool">\r
32     <echo message="Building the EDK Tool: ${ToolName}"/>\r
33   </target>\r
34 \r
35   <target name="init">\r
36     <echo message="The EDK Tool: ${ToolName}"/>\r
37     <mkdir dir="${BUILD_DIR_IA32}"/>\r
38     <mkdir dir="${BUILD_DIR_X64}"/>\r
39     <mkdir dir="${BUILD_DIR_IPF}"/>\r
40     <if>\r
41       <equals arg1="${GCC}" arg2="cygwin"/>\r
42       <then>\r
43         <echo message="Cygwin Family"/>\r
44         <property name="ToolChain" value="gcc"/>\r
45       </then>\r
46     <elseif>\r
47       <os family="dos"/>\r
48       <then>\r
49         <echo message="Windows Family"/>\r
50         <property name="ToolChain" value="msvc"/>\r
51       </then>\r
52     </elseif>\r
53     <elseif>\r
54       <os family="unix"/>\r
55       <then>\r
56         <echo message="UNIX Family"/>\r
57         <property name="ToolChain" value="gcc"/>\r
58       </then>\r
59     </elseif>\r
60 \r
61     <else>\r
62       <echo>\r
63         Unsupported Operating System\r
64         Please Contact Intel Corporation\r
65       </echo>\r
66     </else>\r
67     </if>\r
68                 <if>\r
69                   <equals arg1="${ToolChain}" arg2="msvc"/>\r
70                         <then>\r
71         <property name="ext_static" value=".lib"/>\r
72         <property name="ext_dynamic" value=".dll"/>\r
73         <property name="ext_exe" value=".exe"/>\r
74                         </then>\r
75                         <elseif>\r
76                           <equals arg1="${ToolChain}" arg2="gcc"/>\r
77                                 <then>\r
78           <property name="ext_static" value=".a"/>\r
79           <property name="ext_dynamic" value=".so"/>\r
80           <property name="ext_exe" value=""/>\r
81                                 </then>\r
82                         </elseif>\r
83                 </if>\r
84   </target>\r
85 \r
86   <target name="Tool" depends="init, GenFvImage, GenFvImage_IA32, GenFvImage_X64, GenFvImage_IPF"/>\r
87 \r
88   <target name="GenFvImage">\r
89     <cc name="${ToolChain}" objdir="${BUILD_DIR_IA32}" \r
90         outfile="${BIN_DIR}/${ToolName}"\r
91         outtype="executable"\r
92         libtool="${haveLibtool}"\r
93         optimize="speed">\r
94 \r
95       <defineset>\r
96         <define name="BUILDING_TOOLS"/>\r
97         <define name="TOOL_BUILD_IA32_TARGET"/>\r
98       </defineset>\r
99     \r
100       <fileset dir="${basedir}/${ToolName}" \r
101         includes="${FileSet} Ia32/PeCoffLoaderEx.c" \r
102         defaultexcludes="TRUE" \r
103         excludes="*.xml *.inf"/>\r
104 \r
105       <includepath path="${PACKAGE_DIR}/${ToolName}"/>\r
106       <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
107       <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
108       <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
109       <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
110       <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
111       <includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>\r
112       <includepath path="${env.WORKSPACE}/MdePkg/Include/ToBeRemoved"/>\r
113       <includepath path="${PACKAGE_DIR}/Common"/>\r
114 \r
115                         <linkerarg value="${LIB_DIR}/CommonTools.lib"/>\r
116                         <linkerarg value="${LIB_DIR}/CustomizedCompress.lib"/>\r
117                         <linkerarg value="/nodefaultlib:libc.lib"/>\r
118                         <linkerarg value="RpcRT4.Lib"/>\r
119 \r
120     </cc>\r
121   </target>\r
122 \r
123   <target name="GenFvImage_IA32">\r
124     <cc name="${ToolChain}" objdir="${BUILD_DIR_IA32}" \r
125         outfile="${BIN_DIR}/${ToolName}_IA32"\r
126         outtype="executable"\r
127         libtool="${haveLibtool}"\r
128         optimize="speed">\r
129 \r
130       <defineset>\r
131         <define name="BUILDING_TOOLS"/>\r
132         <define name="TOOL_BUILD_IA32_TARGET"/>\r
133       </defineset>\r
134     \r
135       <fileset dir="${basedir}/${ToolName}" \r
136         includes="${FileSet} Ia32/PeCoffLoaderEx.c" \r
137         defaultexcludes="TRUE" \r
138         excludes="*.xml *.inf"/>\r
139 \r
140       <includepath path="${PACKAGE_DIR}/${ToolName}"/>\r
141       <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
142       <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
143       <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
144       <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
145       <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
146       <includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>\r
147       <includepath path="${env.WORKSPACE}/MdePkg/Include/ToBeRemoved"/>\r
148       <includepath path="${PACKAGE_DIR}/Common"/>\r
149 \r
150                         <linkerarg value="${LIB_DIR}/CommonTools.lib"/>\r
151                         <linkerarg value="${LIB_DIR}/CustomizedCompress.lib"/>\r
152                         <linkerarg value="/nodefaultlib:libc.lib"/>\r
153                         <linkerarg value="RpcRT4.Lib"/>\r
154 \r
155     </cc>\r
156   </target>\r
157 \r
158   <target name="GenFvImage_X64">\r
159     <cc name="${ToolChain}" objdir="${BUILD_DIR_X64}" \r
160         outfile="${BIN_DIR}/${ToolName}_X64"\r
161         outtype="executable"\r
162         libtool="${haveLibtool}"\r
163         optimize="speed">\r
164 \r
165       <defineset>\r
166         <define name="BUILDING_TOOLS"/>\r
167         <define name="TOOL_BUILD_X64_TARGET"/>\r
168       </defineset>\r
169     \r
170       <fileset dir="${basedir}/${ToolName}" \r
171         includes="${FileSet} X64/PeCoffLoaderEx.c"  \r
172         defaultexcludes="TRUE" \r
173         excludes="*.xml *.inf"/>\r
174 \r
175       <includepath path="${PACKAGE_DIR}/${ToolName}"/>\r
176       <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
177       <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
178       <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
179       <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
180       <includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>\r
181       <includepath path="${env.WORKSPACE}/MdePkg/Include/ToBeRemoved"/>\r
182       <includepath path="${PACKAGE_DIR}/Common"/>\r
183 \r
184                         <linkerarg value="${LIB_DIR}/CommonTools.lib"/>\r
185                         <linkerarg value="${LIB_DIR}/CustomizedCompress.lib"/>\r
186                         <linkerarg value="/nodefaultlib:libc.lib"/>\r
187                         <linkerarg value="RpcRT4.Lib"/>\r
188 \r
189     </cc>\r
190   </target>\r
191 \r
192   <target name="GenFvImage_IPF">\r
193     <cc name="${ToolChain}" objdir="${BUILD_DIR_IPF}" \r
194         outfile="${BIN_DIR}/${ToolName}_IPF"\r
195         outtype="executable"\r
196         libtool="${haveLibtool}"\r
197         optimize="speed">\r
198 \r
199       <defineset>\r
200         <define name="BUILDING_TOOLS"/>\r
201         <define name="TOOL_BUILD_IPF_TARGET"/>\r
202       </defineset>\r
203     \r
204       <fileset dir="${basedir}/${ToolName}" \r
205         includes="${FileSet} Ipf/PeCoffLoaderEx.c"  \r
206         defaultexcludes="TRUE" \r
207         excludes="*.xml *.inf"/>\r
208 \r
209       <includepath path="${PACKAGE_DIR}/${ToolName}"/>\r
210       <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
211       <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
212       <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
213       <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
214       <includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>\r
215       <includepath path="${env.WORKSPACE}/MdePkg/Include/ToBeRemoved"/>\r
216       <includepath path="${PACKAGE_DIR}/Common"/>\r
217 \r
218                         <linkerarg value="${LIB_DIR}/CommonTools.lib"/>\r
219                         <linkerarg value="${LIB_DIR}/CustomizedCompress.lib"/>\r
220                         <linkerarg value="/nodefaultlib:libc.lib"/>\r
221                         <linkerarg value="RpcRT4.Lib"/>\r
222 \r
223     </cc>\r
224   </target>\r
225 \r
226   <target name="clean" depends="init">\r
227     <echo message="Removing Intermediate Files Only"/>  \r
228     <delete>\r
229       <fileset dir="${BUILD_DIR_IA32}" includes="*.obj"/>\r
230       <fileset dir="${BUILD_DIR_X64}" includes="*.obj"/>\r
231       <fileset dir="${BUILD_DIR_IPF}" includes="*.obj"/>\r
232     </delete>\r
233   </target>\r
234 \r
235   <target name="cleanall" depends="init">\r
236     <echo message="Removing Object Files and the Executable: ${ToolName}${ext_exe}"/>  \r
237     <delete dir="${PACKAGE_DIR}/${ToolName}/tmp">\r
238             \r
239       <fileset dir="${BIN_DIR}" includes="${ToolName}_IA32${ext_exe}"/>\r
240       <fileset dir="${BIN_DIR}" includes="${ToolName}_X64${ext_exe}"/>\r
241       <fileset dir="${BIN_DIR}" includes="${ToolName}${ext_exe}"/>\r
242       <fileset dir="${BIN_DIR}" includes="${ToolName}_IPF${ext_exe}"/>\r
243     </delete>\r
244   </target>\r
245 \r
246 </project>\r