2fe1342b57ea06e1f6de77fca7a4ad28298718e8
[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 <if>
69 <equals arg1="${ToolChain}" arg2="msvc"/>
70 <then>
71 <property name="ext_static" value=".lib"/>
72 <property name="ext_dynamic" value=".dll"/>
73 <property name="ext_exe" value=".exe"/>
74 </then>
75 <elseif>
76 <equals arg1="${ToolChain}" arg2="gcc"/>
77 <then>
78 <property name="ext_static" value=".a"/>
79 <property name="ext_dynamic" value=".so"/>
80 <property name="ext_exe" value=""/>
81 </then>
82 </elseif>
83 </if>
84
85 </target>
86
87 <target name="Tool" depends="init, GenFvImage, GenFvImage_Ia32, GenFvImage_X64, GenFvImage_Ipf"/>
88
89 <target name="GenFvImage" >
90 <cc name="${ToolChain}" objdir="${BUILD_DIR_IA32}"
91 outfile="${BIN_DIR}/${ToolName}"
92 outtype="executable"
93 optimize="speed">
94
95 <defineset>
96 <define name="BUILDING_TOOLS"/>
97 <define name="TOOL_BUILD_IA32_TARGET"/>
98 </defineset>
99
100 <fileset dir="${basedir}/${ToolName}"
101 includes="${FileSet} Ia32/PeCoffLoaderEx.c" />
102
103 <includepath path="${PACKAGE_DIR}/${ToolName}"/>
104 <includepath path="${env.WORKSPACE}/MdePkg/Include"/>
105 <includepath path="${env.WORKSPACE}/MdePkg/Include"/>
106 <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>
107 <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>
108 <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>
109 <includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>
110 <includepath path="${env.WORKSPACE}/MdePkg/Include/ToBeRemoved"/>
111 <includepath path="${PACKAGE_DIR}/Common"/>
112 <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>
113 <linkerarg value="/nodefaultlib:libc.lib" unless="gcc"/>
114 <!-- <syslibset dir="${env.CYGWIN_HOME}/lib/e2fsprogs" libs="uuid" if="gcc"/> -->
115 <syslibset libs="RpcRT4" unless="gcc"/>
116 </cc>
117 </target>
118
119 <target name="GenFvImage_Ia32">
120 <cc name="${ToolChain}" objdir="${BUILD_DIR_IA32}"
121 outfile="${BIN_DIR}/${ToolName}_Ia32"
122 outtype="executable"
123 optimize="speed">
124
125 <defineset>
126 <define name="BUILDING_TOOLS"/>
127 <define name="TOOL_BUILD_IA32_TARGET"/>
128 </defineset>
129
130 <fileset dir="${basedir}/${ToolName}"
131 includes="${FileSet} Ia32/PeCoffLoaderEx.c"
132 defaultexcludes="TRUE"
133 excludes="*.xml *.inf"/>
134
135 <includepath path="${PACKAGE_DIR}/${ToolName}"/>
136 <includepath path="${env.WORKSPACE}/MdePkg/Include"/>
137 <includepath path="${env.WORKSPACE}/MdePkg/Include"/>
138 <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>
139 <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>
140 <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>
141 <includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>
142 <includepath path="${env.WORKSPACE}/MdePkg/Include/ToBeRemoved"/>
143 <includepath path="${PACKAGE_DIR}/Common"/>
144 <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>
145 <linkerarg value="/nodefaultlib:libc.lib" unless="gcc"/>
146 <!-- <syslibset dir="${env.CYGWIN_HOME}/lib/e2fsprogs" libs="uuid" if="gcc"/> -->
147 <syslibset libs="RpcRT4" unless="gcc"/>
148 </cc>
149 </target>
150
151 <target name="GenFvImage_X64">
152 <cc name="${ToolChain}" objdir="${BUILD_DIR_X64}"
153 outfile="${BIN_DIR}/${ToolName}_X64"
154 outtype="executable"
155 libtool="${haveLibtool}"
156 optimize="speed">
157
158 <defineset>
159 <define name="BUILDING_TOOLS"/>
160 <define name="TOOL_BUILD_X64_TARGET"/>
161 </defineset>
162
163 <fileset dir="${basedir}/${ToolName}"
164 includes="${FileSet} X64/PeCoffLoaderEx.c"
165 defaultexcludes="TRUE"
166 excludes="*.xml *.inf"/>
167
168 <includepath path="${PACKAGE_DIR}/${ToolName}"/>
169 <includepath path="${env.WORKSPACE}/MdePkg/Include"/>
170 <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>
171 <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>
172 <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>
173 <includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>
174 <includepath path="${env.WORKSPACE}/MdePkg/Include/ToBeRemoved"/>
175 <includepath path="${PACKAGE_DIR}/Common"/>
176 <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>
177 <linkerarg value="/nodefaultlib:libc.lib" unless="gcc"/>
178 <!-- <syslibset dir="${env.CYGWIN_HOME}/lib/e2fsprogs" libs="uuid" if="gcc"/> -->
179 <syslibset libs="RpcRT4" unless="gcc"/>
180 </cc>
181 </target>
182
183 <target name="GenFvImage_Ipf">
184 <cc name="${ToolChain}" objdir="${BUILD_DIR_IPF}"
185 outfile="${BIN_DIR}/${ToolName}_Ipf"
186 outtype="executable"
187 libtool="${haveLibtool}"
188 optimize="speed">
189
190 <defineset>
191 <define name="BUILDING_TOOLS"/>
192 <define name="TOOL_BUILD_IPF_TARGET"/>
193 </defineset>
194
195 <fileset dir="${basedir}/${ToolName}"
196 includes="${FileSet} Ipf/PeCoffLoaderEx.c"
197 defaultexcludes="TRUE"
198 excludes="*.xml *.inf"/>
199
200 <includepath path="${PACKAGE_DIR}/${ToolName}"/>
201 <includepath path="${env.WORKSPACE}/MdePkg/Include"/>
202 <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>
203 <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>
204 <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>
205 <includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>
206 <includepath path="${env.WORKSPACE}/MdePkg/Include/ToBeRemoved"/>
207 <includepath path="${PACKAGE_DIR}/Common"/>
208 <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>
209 <linkerarg value="/nodefaultlib:libc.lib" unless="gcc"/>
210 <!-- <syslibset dir="${env.CYGWIN_HOME}/lib/e2fsprogs" libs="uuid" if="gcc"/> -->
211 <syslibset libs="RpcRT4" unless="gcc"/>
212 </cc>
213 </target>
214
215 <target name="clean" depends="init">
216 <echo message="Removing Intermediate Files Only"/>
217 <delete>
218 <fileset dir="${BUILD_DIR_IA32}" includes="*.obj"/>
219 <fileset dir="${BUILD_DIR_X64}" includes="*.obj"/>
220 <fileset dir="${BUILD_DIR_IPF}" includes="*.obj"/>
221 </delete>
222 </target>
223
224 <target name="cleanall" depends="init">
225 <echo message="Removing Object Files and the Executable: ${ToolName}${ext_exe}"/>
226 <delete dir="${PACKAGE_DIR}/${ToolName}/tmp">
227
228 <fileset dir="${BIN_DIR}" includes="${ToolName}_Ia32${ext_exe}"/>
229 <fileset dir="${BIN_DIR}" includes="${ToolName}_X64${ext_exe}"/>
230 <fileset dir="${BIN_DIR}" includes="${ToolName}${ext_exe}"/>
231 <fileset dir="${BIN_DIR}" includes="${ToolName}_Ipf${ext_exe}"/>
232 </delete>
233 </target>
234
235 </project>