Fix building issue for VC compiler. And enable GenFvMap in building CCode package.
[mirror_edk2.git] / Tools / CCode / Source / build.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
af1dd46d 12<project default="all" basedir="." name="C_Code">\r
878ddf1f 13<!-- Copyright (c) 2006, Intel Corporation -->\r
14<!-- Filename: Tools/Source/build.xml -->\r
15\r
16 <taskdef resource="net/sf/antcontrib/antlib.xml"/>\r
af1dd46d 17\r
18 <property name="ReallyVerbose" value="false"/>\r
878ddf1f 19 <property environment="env" />\r
af1dd46d 20\r
878ddf1f 21 <property name="WORKSPACE" value="${env.WORKSPACE}" />\r
22 <property name="WORKSPACE_DIR" value="${WORKSPACE}" />\r
23 <property name="PACKAGE" value="Tools" />\r
ecb33821 24 <property name="PACKAGE_DIR" value="${WORKSPACE}/Tools/CCode/Source" />\r
878ddf1f 25 <property name="LIB_DIR" value="${PACKAGE_DIR}/Library" />\r
26 <property name="BIN_DIR" value="${WORKSPACE}/Tools/bin" />\r
27 <property name="BUILD_MODE" value="PACKAGE" />\r
4df60ea5 28 <property name="Libs" \r
af1dd46d 29 value="Common/build.xml CustomizedCompress/build.xml PeCoffLoader/build.xml String/build.xml"/>\r
878ddf1f 30\r
31 <import file="${WORKSPACE_DIR}/Tools/Conf/BuildMacro.xml" />\r
32\r
33 <path id="classpath">\r
34 <fileset dir="${WORKSPACE}/Tools/Jars" includes="*.jar"/>\r
19924945 35 <fileset dir="${env.XMLBEANS_HOME}/lib" includes="*.jar"/>\r
878ddf1f 36 </path>\r
37\r
af1dd46d 38 <taskdef classpathref="classpath" resource="net/sf/antcontrib/antlib.xml" />\r
878ddf1f 39\r
878ddf1f 40\r
55ab23ae 41 <target name="all" depends="initArch, init, Tools">\r
af1dd46d 42 <echo message="The EDK II C Tools build complete!"/>\r
43 </target>\r
44 \r
45 <target name="init">\r
46 <echo message="EDK C Code Tools, build initialization"/>\r
55ab23ae 47 <taskdef classpathref="classpath" resource="GenBuild.tasks" />\r
48 <taskdef classpathref="classpath" resource="cpptasks.tasks"/>\r
49 <typedef classpathref="classpath" resource="cpptasks.types"/>\r
878ddf1f 50 <mkdir dir="${BIN_DIR}" />\r
51 <mkdir dir="${LIB_DIR}" />\r
af1dd46d 52\r
55ab23ae 53 </target>\r
54\r
55 <target name="initArch">\r
af1dd46d 56 <condition property="HostArch" value="X64">\r
57 <os arch="amd64"/>\r
58 </condition>\r
59 <condition property="HostArch" value="Ia32">\r
60 <or>\r
61 <os arch="x86"/>\r
62 <os arch="i386"/>\r
63 </or>\r
64 </condition>\r
65 <condition property="HostArch" value="Ia32">\r
66 <os arch="i386"/>\r
67 </condition> \r
68\r
878ddf1f 69 <if>\r
70 <os family="unix" />\r
71 <then>\r
af1dd46d 72 <echo message="OS Family UNIX, ${HostArch}" />\r
878ddf1f 73 </then>\r
74 <elseif>\r
75 <os family="dos" />\r
76 <then>\r
af1dd46d 77 <echo message="OS Family DOS, ${HostArch}" />\r
878ddf1f 78 </then>\r
79 </elseif>\r
80 <elseif>\r
81 <os family="mac" />\r
82 <then>\r
af1dd46d 83 <echo message="OS Family OS X, ${HostArch}" />\r
878ddf1f 84 </then>\r
85 </elseif>\r
86 <else>\r
af1dd46d 87 <fail message="OS Family Unsupported, ${HostArch}" />\r
878ddf1f 88 </else>\r
89 </if>\r
90\r
dce914c0 91 <if>\r
af1dd46d 92 <not>\r
93 <isset property="ToolChain" />\r
94 </not>\r
dce914c0 95 <then>\r
af1dd46d 96 <if>\r
97 <isset property="env.TOOL_CHAIN" />\r
98 <then>\r
99 <property name="ToolChain" value="${env.TOOL_CHAIN}"/>\r
100 </then>\r
101 <else>\r
102 <!-- Default Tool Chain is Microsoft Visual Studio -->\r
103 <property name="ToolChain" value="msvc"/>\r
104 </else>\r
105 </if>\r
dce914c0 106 </then>\r
107 </if>\r
20543777 108 \r
109 <if>\r
110 <equals arg1="${ToolChain}" arg2="gcc" />\r
111 <then>\r
112 <exec executable="gcc" outputproperty="host.gcc.ver">\r
113 <arg line="-E" />\r
114 <arg line="-P" />\r
115 <arg line="-x c" />\r
116 <arg line="gcc.ver" />\r
117 </exec>\r
118 <if>\r
119 <contains string="${host.gcc.ver}" substring="4" />\r
120 <then>\r
121 <property name="ExtraArgus" value="-Wno-pointer-sign" />\r
122 </then>\r
123 </if>\r
124 </then>\r
125 </if>\r
dce914c0 126\r
5225ad33 127 <condition property="linux" value="true">\r
128 <os name="Linux"/>\r
129 </condition>\r
130 \r
af1dd46d 131 <condition property="intel_win">\r
132 <and>\r
133 <os family="dos"/>\r
134 <equals arg1="${ToolChain}" arg2="intel"/>\r
135 </and>\r
136 </condition>\r
137 \r
138 <condition property="intel_linux">\r
139 <and>\r
140 <os name="Linux"/>\r
141 <equals arg1="${ToolChain}" arg2="intel"/>\r
142 </and>\r
143 </condition>\r
144 \r
145 <condition property="intel_mac">\r
146 <and>\r
147 <os family="mac"/>\r
148 <equals arg1="${ToolChain}" arg2="intel"/>\r
149 </and>\r
150 </condition>\r
151 \r
152 <condition property="gcc">\r
153 <and>\r
154 <equals arg1="${ToolChain}" arg2="gcc"/>\r
155 </and>\r
156 </condition>\r
157\r
460fa4a2 158 <condition property="cygwin">\r
159 <and>\r
160 <os family="dos"/>\r
af1dd46d 161 <equals arg1="${ToolChain}" arg2="gcc"/>\r
460fa4a2 162 </and>\r
163 </condition>\r
164 \r
c7c42e40 165 <condition property="x86_64_linux">\r
166 <and>\r
167 <os name="Linux"/>\r
11c6f37e 168 <equals arg1="${HostArch}" arg2="X64"/>\r
c7c42e40 169 </and>\r
170 </condition>\r
171 \r
5225ad33 172 <condition property="windows" value="true">\r
173 <os family="Windows"/>\r
174 </condition>\r
175 \r
176 <condition property="OSX" value="true">\r
177 <os family="Mac"/>\r
178 </condition>\r
af1dd46d 179\r
180 <condition property="cyglinux">\r
181 <or>\r
8f7f05d5 182 <istrue value="${linux}"/>\r
af1dd46d 183 <istrue value="${cygwin}"/>\r
184 </or>\r
185 </condition>\r
186\r
187 <!-- msft is a family, used by both Microsoft and Intel Windows compiler tool chains -->\r
188 <condition property="msft">\r
189 <isfalse value="${gcc}"/>\r
190 </condition>\r
191\r
192 <if>\r
193 <istrue value="${ReallyVerbose}"/>\r
194 <then>\r
195 <echo message="Test property msvc: ${msvc}"/> \r
196 <echo message="Test property gcc: ${gcc}"/> \r
197 <echo message="Test property intel_win: ${intel_win}"/> \r
198 <echo message="Test property intel_linux: ${intel_linux}"/> \r
199 <echo message="Test property intel_mac: ${intel_mac}"/> \r
200 <echo message="Test property msft: ${msft}"/> \r
201 <echo message="Test property cygwin: ${cygwin}"/> \r
202 <echo message="Test property cyglinux: ${cyglinux}"/> \r
203 <echo message="Test property windows: ${windows}"/> \r
204 <echo message="Test property linux: ${linux}"/> \r
205 <echo message="Test property OSX: ${OSX}"/> \r
206 <echo message="Test property x86_64_linux: ${x86_64_linux}"/> \r
207 </then>\r
208 </if>\r
209\r
210 <property name="haveLibtool" value="false"/>\r
211 <if>\r
212 <and>\r
213 <not>\r
214 <isset property="env.CYGWIN_HOME"/>\r
215 </not>\r
216 <isset property="cygwin"/>\r
217 </and>\r
218 <then>\r
219 <fail message="You must set the environment variable: CYGWIN_HOME"/>\r
220 </then>\r
221 </if>\r
222\r
223 <if>\r
224 <istrue value="${gcc}"/>\r
225 <then>\r
226 <property name="ext_static" value=".a"/>\r
227 <property name="ext_dynamic" value=".so"/>\r
228 <if>\r
229 <istrue value="${cygwin}"/>\r
230 <then>\r
231 <property name="ext_exe" value=".exe"/>\r
232 </then>\r
233 <else>\r
234 <property name="ext_exe" value=""/>\r
235 </else>\r
236 </if>\r
237 </then>\r
238 <else>\r
239 <property name="ext_static" value=".lib"/>\r
240 <property name="ext_dynamic" value=".dll"/>\r
241 <property name="ext_exe" value=".exe"/>\r
242 </else>\r
243 </if>\r
878ddf1f 244 </target>\r
af1dd46d 245\r
55ab23ae 246 <target name="Libraries" depends="initArch, init">\r
878ddf1f 247 <subant target="" inheritall="true">\r
248 <fileset dir="${PACKAGE_DIR}" \r
4df60ea5 249 includes="${Libs}"/>\r
878ddf1f 250 </subant>\r
251 </target>\r
252\r
253 <target name="Tools" depends="Libraries">\r
254 <subant target="" inheritall="true">\r
64bbd2e3 255 <fileset dir="${PACKAGE_DIR}" includes="*/build.xml" \r
9fae0373 256 excludes="${Libs}"/>\r
878ddf1f 257 </subant>\r
258 </target>\r
259\r
55ab23ae 260 <target name="clean" depends="initArch">\r
878ddf1f 261 <subant target="clean" inheritall="true">\r
262 <fileset dir="${PACKAGE_DIR}" includes="*/build.xml"/>\r
263 </subant>\r
264 </target>\r
265\r
55ab23ae 266 <target name="cleanall" depends="initArch">\r
878ddf1f 267 <subant target="cleanall" inheritall="true">\r
268 <fileset dir="${PACKAGE_DIR}" includes="*/build.xml"/>\r
269 </subant>\r
270 <delete dir="${LIB_DIR}"/>\r
271 </target>\r
272</project>\r