Initial import.
[mirror_edk2.git] / Tools / Source / TianoTools / GenDepex / 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="GenTool" basedir=".">\r
13<!--\r
14 EDK GenDepex Tool\r
15 Copyright (c) 2006, Intel Corporation\r
16-->\r
17 <property name="ToolName" value="GenDepex"/>\r
18 <property name="LibName" value="DepexParser"/>\r
19 <property name="FileSet" value="GenDepex.c GenDepex.h"/>\r
20 <property name="LibFileSet" value="DepexParser.c DepexParser.h" />\r
21\r
22 <taskdef resource="cpptasks.tasks"/>\r
23 <typedef resource="cpptasks.types"/>\r
24 <taskdef resource="net/sf/antcontrib/antlib.xml"/>\r
25\r
26 <property environment="env"/>\r
27\r
28 <property name="LINK_OUTPUT_TYPE" value="static"/>\r
29 <property name="BUILD_DIR" value="${PACKAGE_DIR}/${ToolName}/tmp"/>\r
30\r
31 <target name="GenTool" depends="init, Lib, Tool">\r
32 <echo message="Building the EDK Tool: ${ToolName}"/>\r
33 </target>\r
34\r
35 <target name="init">\r
36 <echo message="The EDK Tool: ${ToolName}"/>\r
37 <mkdir dir="${BUILD_DIR}"/>\r
38 <if>\r
39 <equals arg1="${GCC}" arg2="cygwin"/>\r
40 <then>\r
41 <echo message="Cygwin Family"/>\r
42 <property name="ToolChain" value="gcc"/>\r
43 </then>\r
44 <elseif>\r
45 <os family="dos"/>\r
46 <then>\r
47 <echo message="Windows Family"/>\r
48 <property name="ToolChain" value="msvc"/>\r
49 </then>\r
50 </elseif>\r
51 <elseif>\r
52 <os family="unix"/>\r
53 <then>\r
54 <echo message="UNIX Family"/>\r
55 <property name="ToolChain" value="gcc"/>\r
56 </then>\r
57 </elseif>\r
58\r
59 <else>\r
60 <echo>\r
61 Unsupported Operating System\r
62 Please Contact Intel Corporation\r
63 </echo>\r
64 </else>\r
65 </if>\r
66 <if>\r
67 <equals arg1="${ToolChain}" arg2="msvc"/>\r
68 <then>\r
69 <property name="ext_static" value=".lib"/>\r
70 <property name="ext_dynamic" value=".dll"/>\r
71 <property name="ext_exe" value=".exe"/>\r
72 </then>\r
73 <elseif>\r
74 <equals arg1="${ToolChain}" arg2="gcc"/>\r
75 <then>\r
76 <property name="ext_static" value=".a"/>\r
77 <property name="ext_dynamic" value=".so"/>\r
78 <property name="ext_exe" value=""/>\r
79 </then>\r
80 </elseif>\r
81 </if>\r
82 </target>\r
83\r
84 <target name="Tool" depends="init, Lib">\r
85 <cc name="${ToolChain}" objdir="${BUILD_DIR}" \r
86 outfile="${BIN_DIR}/${ToolName}"\r
87 outtype="executable"\r
88 libtool="${haveLibtool}"\r
89 optimize="speed">\r
90\r
91 <fileset dir="${basedir}/${ToolName}" \r
92 includes="${FileSet}" \r
93 defaultexcludes="TRUE" \r
94 excludes="*.xml *.inf"/>\r
95\r
96 <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
97 <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
98 <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
99 <includepath path="${PACKAGE_DIR}/Common"/>\r
100 <linkerarg value="${LIB_DIR}/CommonTools${ext_static}"/>\r
101 <linkerarg value="${LIB_DIR}/${LibName}${ext_static}"/>\r
102 </cc>\r
103 </target>\r
104\r
105 <target name="Lib" depends="init">\r
106 <cc name="${ToolChain}" objdir="${BUILD_DIR}" \r
107 outfile="${LIB_DIR}/${LibName}"\r
108 outtype="static"\r
109 libtool="${haveLibtool}"\r
110 optimize="speed">\r
111\r
112 <fileset dir="${basedir}/${ToolName}" \r
113 includes="${LibFileSet}" \r
114 defaultexcludes="TRUE" \r
115 excludes="*.xml *.inf"/>\r
116\r
117 <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
118 <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
119 <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
120 <includepath path="${PACKAGE_DIR}/Common"/>\r
121 </cc>\r
122 <if>\r
123 <os family="dos"/>\r
124 <then>\r
125 <exec dir="${BUILD_DIR}" executable="lib" failonerror="false">\r
126 <arg line="/NOLOGO *.lib /OUT:${LIB_DIR}/${LibName}${ext_static}"/>\r
127 </exec>\r
128 </then>\r
129 </if>\r
130 </target>\r
131 \r
132 <target name="clean" depends="init">\r
133 <echo message="Removing Intermediate Files Only"/> \r
134 <delete>\r
135 <fileset dir="${BUILD_DIR}" includes="*.obj"/>\r
136 </delete>\r
137 </target>\r
138\r
139 <target name="cleanall" depends="init">\r
140 <echo message="Removing Object Files and the Executable: ${ToolName}${ext_exe}"/> \r
141 <delete dir="${BUILD_DIR}">\r
142 <fileset dir="${BIN_DIR}" includes="${ToolName}${ext_exe}"/>\r
143 </delete>\r
144 </target>\r
145\r
146</project>\r