Fix some cleanall issues
[mirror_edk2.git] / Tools / Source / TianoTools / Pccts / antlr / 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 antlr Tool\r
15 Copyright (c) 2006, Intel Corporation\r
16-->\r
17 <property name="ToolName" value="antlr"/>\r
18\r
19 <taskdef resource="cpptasks.tasks"/>\r
20 <typedef resource="cpptasks.types"/>\r
21 <taskdef resource="net/sf/antcontrib/antlib.xml"/>\r
22\r
23 <property environment="env"/>\r
24\r
25 <target name="init">\r
26 <echo message="The EDK Tool: ${ToolName}"/>\r
27 <if>\r
28 <equals arg1="${GCC}" arg2="cygwin"/>\r
29 <then>\r
30 <echo message="Cygwin Family"/>\r
31 <property name="ToolChain" value="gcc"/>\r
32 </then>\r
33 <elseif>\r
34 <os family="dos"/>\r
35 <then>\r
36 <echo message="Windows Family"/>\r
37 <property name="ToolChain" value="msvc"/>\r
38 </then>\r
39 </elseif>\r
40 <elseif>\r
41 <os family="unix"/>\r
42 <then>\r
43 <echo message="UNIX Family"/>\r
44 <property name="ToolChain" value="gcc"/>\r
45 </then>\r
46 </elseif>\r
47\r
48 <else>\r
49 <echo>\r
50 Unsupported Operating System\r
51 Please Contact Intel Corporation\r
52 </echo>\r
53 </else>\r
54 </if>\r
55 <if>\r
56 <equals arg1="${ToolChain}" arg2="msvc"/>\r
57 <then>\r
58 <property name="ext_static" value=".lib"/>\r
59 <property name="ext_dynamic" value=".dll"/>\r
60 <property name="ext_exe" value=".exe"/>\r
61 </then>\r
62 <elseif>\r
63 <equals arg1="${ToolChain}" arg2="gcc"/>\r
64 <then>\r
65 <property name="ext_static" value=".a"/>\r
66 <property name="ext_dynamic" value=".so"/>\r
67 <property name="ext_exe" value=""/>\r
68 </then>\r
69 </elseif>\r
70 </if>\r
71 <condition property="CheckDepends">\r
72 <uptodate targetfile="${WORKSPACE}/Tools/bin/antlr.exe">\r
73 <srcfiles dir="." includes="*.c *.h *.g"/>\r
74 </uptodate>\r
75 </condition>\r
76 <if>\r
77 <equals arg1="${CheckDepends}" arg2="true"/>\r
78 <then>\r
79 <echo message="Executable, antlr.exe, is up to date."/>\r
80 </then>\r
81 </if>\r
82 </target>\r
83\r
84 <target name="GenTool" depends="init" unless="CheckDepends">\r
85 <echo message="Building the EDK Tool: ${ToolName}"/>\r
86 <if>\r
87 <equals arg1="${ToolChain}" arg2="msvc"/>\r
88 <then>\r
89 <exec dir="${basedir}" executable="nmake" failonerror="TRUE">\r
90 <arg line="-f AntlrMS.mak"/>\r
91 </exec>\r
92 </then>\r
93 <elseif>\r
94 <equals arg1="${ToolChain}" arg2="gcc"/>\r
95 <then>\r
96 <exec dir="${basedir}" executable="make" failonerror="TRUE">\r
97 <arg line="-f makefile"/>\r
98 </exec>\r
99 </then>\r
100 </elseif>\r
101 </if>\r
102 </target>\r
103\r
104 <target name="clean" depends="init">\r
105 <echo message="Removing Intermediate Files Only"/> \r
106 <if>\r
107 <equals arg1="${ToolChain}" arg2="msvc"/>\r
108 <then>\r
109 <exec dir="${basedir}" executable="nmake" failonerror="TRUE">\r
110 <arg line="-f AntlrMS.mak clean"/>\r
111 </exec>\r
112 </then>\r
113 <elseif>\r
114 <equals arg1="${ToolChain}" arg2="gcc"/>\r
115 <then>\r
116 <exec dir="${basedir}" executable="make" failonerror="TRUE">\r
117 <arg line="-f makefile clean"/>\r
118 </exec>\r
119 </then>\r
120 </elseif>\r
121 </if>\r
122 </target>\r
123\r
124 <target name="cleanall" depends="init">\r
125 <echo message="Removing Object Files and the Executable: ${ToolName}${ext_exe}"/> \r
126 <if>\r
127 <equals arg1="${ToolChain}" arg2="msvc"/>\r
128 <then>\r
9e792382 129 <exec dir="${basedir}" executable="nmake" failonerror="FALSE">\r
878ddf1f 130 <arg line="-f AntlrMS.mak distclean"/>\r
131 </exec>\r
132 </then>\r
133 <elseif>\r
134 <equals arg1="${ToolChain}" arg2="gcc"/>\r
135 <then>\r
9e792382 136 <exec dir="${basedir}" executable="make" failonerror="FALSE">\r
878ddf1f 137 <arg line="-f makefile distclean"/>\r
138 </exec>\r
139 </then>\r
140 </elseif>\r
141 </if>\r
142 </target>\r
143\r
144</project>\r