]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/TianoTools/Pccts/antlr/build.xml
4c432c1f222ebb0ab7dc3ab2455547cba6680137
[mirror_edk2.git] / Tools / Source / TianoTools / Pccts / antlr / build.xml
1 <?xml version="1.0" ?>
2 <!--
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 -->
12 <project default="GenTool" basedir=".">
13 <!--
14 EDK antlr Tool
15 Copyright (c) 2006, Intel Corporation
16 -->
17 <property name="ToolName" value="antlr"/>
18
19 <taskdef resource="cpptasks.tasks"/>
20 <typedef resource="cpptasks.types"/>
21 <taskdef resource="net/sf/antcontrib/antlib.xml"/>
22
23 <target name="init">
24 <echo message="The EDK Tool: ${ToolName}"/>
25 <if>
26 <equals arg1="${GCC}" arg2="cygwin"/>
27 <then>
28 <echo message="Cygwin Family"/>
29 <property name="ToolChain" value="gcc"/>
30 </then>
31 <elseif>
32 <os family="dos"/>
33 <then>
34 <echo message="Windows Family"/>
35 <property name="ToolChain" value="msvc"/>
36 </then>
37 </elseif>
38 <elseif>
39 <os family="unix"/>
40 <then>
41 <echo message="UNIX Family"/>
42 <property name="ToolChain" value="gcc"/>
43 </then>
44 </elseif>
45
46 <else>
47 <echo>
48 Unsupported Operating System
49 Please Contact Intel Corporation
50 </echo>
51 </else>
52 </if>
53 <if>
54 <equals arg1="${ToolChain}" arg2="msvc"/>
55 <then>
56 <property name="ext_static" value=".lib"/>
57 <property name="ext_dynamic" value=".dll"/>
58 <property name="ext_exe" value=".exe"/>
59 </then>
60 <elseif>
61 <equals arg1="${ToolChain}" arg2="gcc"/>
62 <then>
63 <property name="ext_static" value=".a"/>
64 <property name="ext_dynamic" value=".so"/>
65 <property name="ext_exe" value=""/>
66 </then>
67 </elseif>
68 </if>
69 <condition property="CheckDepends">
70 <uptodate targetfile="${WORKSPACE}/Tools/bin/antlr.exe">
71 <srcfiles dir="." includes="*.c *.h *.g"/>
72 </uptodate>
73 </condition>
74 <if>
75 <equals arg1="${CheckDepends}" arg2="true"/>
76 <then>
77 <echo message="Executable, antlr.exe, is up to date."/>
78 </then>
79 </if>
80 </target>
81
82 <target name="GenTool" depends="init" unless="CheckDepends">
83 <echo message="Building the EDK Tool: ${ToolName}"/>
84 <if>
85 <equals arg1="${ToolChain}" arg2="msvc"/>
86 <then>
87 <exec dir="${basedir}" executable="nmake" failonerror="TRUE">
88 <arg line="-f AntlrMS.mak"/>
89 </exec>
90 </then>
91 <elseif>
92 <equals arg1="${ToolChain}" arg2="gcc"/>
93 <then>
94 <exec dir="${basedir}" executable="make" failonerror="TRUE">
95 <arg line="-f makefile"/>
96 </exec>
97 </then>
98 </elseif>
99 </if>
100 </target>
101
102 <target name="clean" depends="init">
103 <echo message="Removing Intermediate Files Only"/>
104 <if>
105 <equals arg1="${ToolChain}" arg2="msvc"/>
106 <then>
107 <exec dir="${basedir}" executable="nmake" failonerror="TRUE">
108 <arg line="-f AntlrMS.mak clean"/>
109 </exec>
110 </then>
111 <elseif>
112 <equals arg1="${ToolChain}" arg2="gcc"/>
113 <then>
114 <exec dir="${basedir}" executable="make" failonerror="TRUE">
115 <arg line="-f makefile clean"/>
116 </exec>
117 </then>
118 </elseif>
119 </if>
120 </target>
121
122 <target name="cleanall" depends="init">
123 <echo message="Removing Object Files and the Executable: ${ToolName}${ext_exe}"/>
124 <if>
125 <equals arg1="${ToolChain}" arg2="msvc"/>
126 <then>
127 <exec dir="${basedir}" executable="nmake" failonerror="FALSE">
128 <arg line="-f AntlrMS.mak clean"/>
129 </exec>
130 </then>
131 <elseif>
132 <equals arg1="${ToolChain}" arg2="gcc"/>
133 <then>
134 <exec dir="${basedir}" executable="make" failonerror="FALSE">
135 <arg line="-f makefile clean"/>
136 </exec>
137 </then>
138 </elseif>
139 </if>
140 </target>
141
142 </project>