Support building on x64 hosts.
[mirror_edk2.git] / Tools / Source / TianoTools / Common / build.xml
CommitLineData
878ddf1f 1<?xml version="1.0" ?>\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="CommonTools.lib" basedir=".">\r
13<!--\r
14 EDK Common Tools Library\r
15 Copyright (c) 2006, Intel Corporation\r
16-->\r
17\r
18 <taskdef resource="cpptasks.tasks"/>\r
19 <typedef resource="cpptasks.types"/>\r
20 <taskdef resource="net/sf/antcontrib/antlib.xml"/>\r
21\r
22 <property environment="env"/>\r
23 <property name="tmp" value="tmp"/>\r
24\r
25 <property name="LINK_OUTPUT_TYPE" value="static"/>\r
26 <property name="BUILD_DIR" value="${PACKAGE_DIR}/Common/tmp"/>\r
27\r
28 <target name="CommonTools.lib" depends="init, ToolsLibrary">\r
29 <echo message="Building the EDK CommonTools Library"/>\r
30 </target>\r
31\r
32 <target name="init">\r
33 <echo message="The EDK CommonTools Library"/>\r
34 <mkdir dir="${BUILD_DIR}"/>\r
35 <if>\r
36 <equals arg1="${GCC}" arg2="cygwin"/>\r
37 <then>\r
38 <echo message="Cygwin Family"/>\r
39 <property name="ToolChain" value="gcc"/>\r
40 </then>\r
41 <elseif>\r
42 <os family="dos"/>\r
43 <then>\r
44 <echo message="Windows Family"/>\r
45 <property name="ToolChain" value="msvc"/>\r
46 </then>\r
47 </elseif>\r
48 <elseif>\r
49 <os family="unix"/>\r
50 <then>\r
51 <echo message="UNIX Family"/>\r
52 <property name="ToolChain" value="gcc"/>\r
53 </then>\r
54 </elseif>\r
55\r
56 <else>\r
57 <echo>\r
58 Unsupported Operating System\r
59 Please Contact Intel Corporation\r
60 </echo>\r
61 </else>\r
62 </if>\r
ce53a8c3 63 <if>\r
64 <equals arg1="${ToolChain}" arg2="msvc"/>\r
65 <then>\r
878ddf1f 66 <property name="ext_static" value=".lib"/>\r
67 <property name="ext_dynamic" value=".dll"/>\r
ce53a8c3 68 </then>\r
69 <elseif>\r
70 <equals arg1="${ToolChain}" arg2="gcc"/>\r
71 <then>\r
878ddf1f 72 <property name="ext_static" value=".a"/>\r
73 <property name="ext_dynamic" value=".so"/>\r
ce53a8c3 74 </then>\r
75 </elseif>\r
76 </if>\r
878ddf1f 77 </target>\r
78\r
79 <target name="ToolsLibrary" depends="init">\r
80 <cc name="${ToolChain}" objdir="${BUILD_DIR}" \r
81 outfile="${LIB_DIR}/CommonTools"\r
82 outtype="static"\r
878ddf1f 83 optimize="speed">\r
84\r
c7c42e40 85 <compilerarg value="-fPIC" if="x86_64_linux"/>\r
86\r
21b50a27 87 <includepath path="${PACKAGE_DIR}/Include"/>\r
c7c42e40 88 <includepath path="${PACKAGE_DIR}/Include/${HostArch}"/>\r
878ddf1f 89\r
90 <fileset dir="${basedir}/Common" \r
dce914c0 91 includes="*.c" />\r
878ddf1f 92 </cc>\r
878ddf1f 93 </target>\r
94\r
95 <target name="clean" depends="init">\r
96 <echo message="Removing Intermediate Files Only from ${BUILD_DIR}"/> \r
97 <delete>\r
98 <fileset dir="${BUILD_DIR}" includes="*.obj"/>\r
99 </delete>\r
100 </target>\r
101\r
102 <target name="cleanall" depends="init">\r
103 <echo message="Removing Object Files and the Library: CommonTools${ext_static}"/> \r
9e792382 104 <delete dir="${BUILD_DIR}" failonerror="false">\r
878ddf1f 105 <fileset dir="${LIB_DIR}" includes="CommonTools${ext_static}"/>\r
106 </delete>\r
107 </target>\r
108\r
109</project>\r