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