]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - Tools/CCode/Source/build.xml
Fix building issue for VC compiler. And enable GenFvMap in building CCode package.
[mirror_edk2.git] / Tools / CCode / Source / build.xml
... / ...
CommitLineData
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 default="all" basedir="." name="C_Code">\r
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
17\r
18 <property name="ReallyVerbose" value="false"/>\r
19 <property environment="env" />\r
20\r
21 <property name="WORKSPACE" value="${env.WORKSPACE}" />\r
22 <property name="WORKSPACE_DIR" value="${WORKSPACE}" />\r
23 <property name="PACKAGE" value="Tools" />\r
24 <property name="PACKAGE_DIR" value="${WORKSPACE}/Tools/CCode/Source" />\r
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
28 <property name="Libs" \r
29 value="Common/build.xml CustomizedCompress/build.xml PeCoffLoader/build.xml String/build.xml"/>\r
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
35 <fileset dir="${env.XMLBEANS_HOME}/lib" includes="*.jar"/>\r
36 </path>\r
37\r
38 <taskdef classpathref="classpath" resource="net/sf/antcontrib/antlib.xml" />\r
39\r
40\r
41 <target name="all" depends="initArch, init, Tools">\r
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
47 <taskdef classpathref="classpath" resource="GenBuild.tasks" />\r
48 <taskdef classpathref="classpath" resource="cpptasks.tasks"/>\r
49 <typedef classpathref="classpath" resource="cpptasks.types"/>\r
50 <mkdir dir="${BIN_DIR}" />\r
51 <mkdir dir="${LIB_DIR}" />\r
52\r
53 </target>\r
54\r
55 <target name="initArch">\r
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
69 <if>\r
70 <os family="unix" />\r
71 <then>\r
72 <echo message="OS Family UNIX, ${HostArch}" />\r
73 </then>\r
74 <elseif>\r
75 <os family="dos" />\r
76 <then>\r
77 <echo message="OS Family DOS, ${HostArch}" />\r
78 </then>\r
79 </elseif>\r
80 <elseif>\r
81 <os family="mac" />\r
82 <then>\r
83 <echo message="OS Family OS X, ${HostArch}" />\r
84 </then>\r
85 </elseif>\r
86 <else>\r
87 <fail message="OS Family Unsupported, ${HostArch}" />\r
88 </else>\r
89 </if>\r
90\r
91 <if>\r
92 <not>\r
93 <isset property="ToolChain" />\r
94 </not>\r
95 <then>\r
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
106 </then>\r
107 </if>\r
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
126\r
127 <condition property="linux" value="true">\r
128 <os name="Linux"/>\r
129 </condition>\r
130 \r
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
158 <condition property="cygwin">\r
159 <and>\r
160 <os family="dos"/>\r
161 <equals arg1="${ToolChain}" arg2="gcc"/>\r
162 </and>\r
163 </condition>\r
164 \r
165 <condition property="x86_64_linux">\r
166 <and>\r
167 <os name="Linux"/>\r
168 <equals arg1="${HostArch}" arg2="X64"/>\r
169 </and>\r
170 </condition>\r
171 \r
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
179\r
180 <condition property="cyglinux">\r
181 <or>\r
182 <istrue value="${linux}"/>\r
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
244 </target>\r
245\r
246 <target name="Libraries" depends="initArch, init">\r
247 <subant target="" inheritall="true">\r
248 <fileset dir="${PACKAGE_DIR}" \r
249 includes="${Libs}"/>\r
250 </subant>\r
251 </target>\r
252\r
253 <target name="Tools" depends="Libraries">\r
254 <subant target="" inheritall="true">\r
255 <fileset dir="${PACKAGE_DIR}" includes="*/build.xml" \r
256 excludes="${Libs}"/>\r
257 </subant>\r
258 </target>\r
259\r
260 <target name="clean" depends="initArch">\r
261 <subant target="clean" inheritall="true">\r
262 <fileset dir="${PACKAGE_DIR}" includes="*/build.xml"/>\r
263 </subant>\r
264 </target>\r
265\r
266 <target name="cleanall" depends="initArch">\r
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