7c48298484ae5622e0b3601ca97107616916badb
[mirror_edk2.git] / Tools / Source / TianoTools / VfrCompile / 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 VfrCompile Tool
15 Copyright (c) 2006, Intel Corporation
16 -->
17 <property name="ToolName" value="VfrCompile"/>
18 <property name="FileSet" value="*.cpp"/>
19 <property name="FileSetPccts" value="ATokenBuffer.cpp DLexerBase.cpp AParser.cpp"/>
20 <taskdef resource="cpptasks.tasks"/>
21 <typedef resource="cpptasks.types"/>
22 <taskdef resource="net/sf/antcontrib/antlib.xml"/>
23
24 <property environment="env"/>
25
26 <property name="LINK_OUTPUT_TYPE" value="static"/>
27 <property name="BUILD_DIR" value="${PACKAGE_DIR}/${ToolName}/tmp"/>
28
29 <target name="GenTool" depends="init, Antlr, Dlg, Tool">
30 <echo message="Building the EDK Tool: ${ToolName}"/>
31 </target>
32
33 <target name="init">
34 <echo message="The EDK Tool: ${ToolName}"/>
35 <mkdir dir="${BUILD_DIR}"/>
36 <if>
37 <equals arg1="${GCC}" arg2="cygwin"/>
38 <then>
39 <echo message="Cygwin Family"/>
40 <property name="ToolChain" value="gcc"/>
41 </then>
42 <elseif>
43 <os family="dos"/>
44 <then>
45 <echo message="Windows Family"/>
46 <property name="ToolChain" value="msvc"/>
47 </then>
48 </elseif>
49 <elseif>
50 <os family="unix"/>
51 <then>
52 <echo message="UNIX Family"/>
53 <property name="ToolChain" value="gcc"/>
54 </then>
55 </elseif>
56
57 <else>
58 <echo>
59 Unsupported Operating System
60 Please Contact Intel Corporation
61 </echo>
62 </else>
63 </if>
64 <if>
65 <equals arg1="${ToolChain}" arg2="msvc"/>
66 <then>
67 <property name="ext_static" value=".lib"/>
68 <property name="ext_dynamic" value=".dll"/>
69 <property name="ext_exe" value=".exe"/>
70 </then>
71 <elseif>
72 <equals arg1="${ToolChain}" arg2="gcc"/>
73 <then>
74 <property name="ext_static" value=".a"/>
75 <property name="ext_dynamic" value=".so"/>
76 <property name="ext_exe" value=""/>
77 </then>
78 </elseif>
79 </if>
80 <condition property="CheckDepends">
81 <uptodate targetfile="${WORKSPACE}/Tools/bin/VfrCompile${ext_exe}">
82 <srcfiles dir="${WORKSPACE}/Tools/Source/TianoTools/VfrCompile"
83 includes="EfiVfrParser.cpp DLGLexer.cpp VfrCompile.cpp VfrCompile.g VfrServices.cpp parser.dlg"/>
84 </uptodate>
85 </condition>
86 </target>
87
88 <target name="Antlr" depends="init" unless="CheckDepends">
89 <exec dir="${basedir}/${ToolName}" executable="antlr" failonerror="TRUE">
90 <arg line="-CC -e3 -ck 3 -o . VfrCompile.g"/>
91 </exec>
92 </target>
93
94 <target name="Dlg" depends="Antlr" unless="CheckDepends">
95 <exec dir="${basedir}/${ToolName}" executable="dlg" failonerror="TRUE">
96 <arg line="-C2 -i -CC -o . parser.dlg"/>
97 </exec>
98 </target>
99
100 <target name="Tool" depends="init, Dlg">
101 <cc name="${ToolChain}" objdir="${BUILD_DIR}"
102 outfile="${BIN_DIR}/${ToolName}"
103 outtype="executable"
104 optimize="speed">
105
106 <fileset dir="${basedir}/${ToolName}"
107 includes="${FileSet}" />
108
109 <fileset dir="${basedir}/Pccts/h"
110 includes="${FileSetPccts}" />
111
112 <includepath path="${env.WORKSPACE}/Tools/Source/TianoTools/Pccts/h"/>
113 <includepath path="${env.WORKSPACE}/MdePkg/Include"/>
114 <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>
115 <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>
116 <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>
117 <includepath path="${PACKAGE_DIR}/Common"/>
118 <libset dir="${LIB_DIR}" libs="CommonTools"/>
119 <syslibset libs="stdc++" if="gcc"/>
120 </cc>
121 </target>
122
123 <target name="clean" depends="init">
124 <echo message="Removing Intermediate Files Only"/>
125 <delete>
126 <fileset dir="${BUILD_DIR}" includes="*.obj"/>
127 </delete>
128 </target>
129
130 <target name="cleanall" depends="init">
131 <echo message="Removing Object Files and the Executable: ${ToolName}${ext_exe}"/>
132 <delete dir="${BUILD_DIR}">
133 <fileset dir="${BIN_DIR}" includes="${ToolName}${ext_exe}"/>
134 </delete>
135 </target>
136
137 </project>