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