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