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