]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/CCode/Source/VfrCompile/build.xml
51770d8f77917bb7be8c263146e26d282298da10
[mirror_edk2.git] / Tools / CCode / Source / 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="." name="VfrCompile">
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="net/sf/antcontrib/antlib.xml"/>
21
22 <property name="LINK_OUTPUT_TYPE" value="static"/>
23 <property name="BUILD_DIR" value="${PACKAGE_DIR}/${ToolName}/tmp"/>
24
25 <target name="GenTool" depends="init, Antlr, Dlg, Tool">
26 <echo message="The EDK Tool: ${ToolName} build has completed"/>
27 </target>
28
29 <target name="init">
30
31 <echo message="Building the EDK Tool: ${ToolName}"/>
32 <mkdir dir="${BUILD_DIR}"/>
33
34 <condition property="AntlrDepends">
35 <uptodate targetfile="${PACKAGE_DIR}/VfrCompile/parser.dlg" srcfile="${PACKAGE_DIR}/VfrCompile/VfrCompile.g" value="true"/>
36 </condition>
37
38 <condition property="DlgDepends">
39 <uptodate targetfile="${PACKAGE_DIR}/VfrCompile/DLGLexer.cpp" srcfile="${PACKAGE_DIR}/VfrCompile/parser.dlg" value="true"/>
40 </condition>
41
42 <condition property="CheckDepends">
43 <or>
44 <isset property="AntlrDepends"/>
45 <isset property="DlgDepends"/>
46 </or>
47 </condition>
48
49 <condition property="gxx_extra_libs" value="stdc++ System gcc_s.10.4 gcc">
50 <os family="mac"/>
51 </condition>
52
53 <condition property="gxx_extra_libs" value="stdc++">
54 <os name="linux"/>
55 </condition>
56
57 <condition property="gxx_extra_libs" value="stdc++">
58 <os family="windows"/>
59 </condition>
60
61 </target>
62
63 <target name="Antlr" depends="init" unless="AntlrDepends">
64 <echo message="Executing ANTLR"/>
65 <exec dir="${basedir}/${ToolName}" executable="${env.FRAMEWORK_TOOLS_PATH}/antlr" failonerror="TRUE">
66 <arg line="-CC -e3 -ck 3 -o . VfrCompile.g"/>
67 </exec>
68 </target>
69
70 <target name="Dlg" depends="Antlr" unless="DlgDepends">
71 <echo message="Executing DLG"/>
72 <exec dir="${basedir}/${ToolName}" executable="${env.FRAMEWORK_TOOLS_PATH}/dlg" failonerror="TRUE">
73 <arg line="-C2 -i -CC -o . parser.dlg"/>
74 </exec>
75 </target>
76
77 <target name="Tool" depends="init">
78 <cc name="${ToolChain}" objdir="${BUILD_DIR}"
79 outfile="${BIN_DIR}/${ToolName}"
80 outtype="executable"
81 debug="true"
82 optimize="speed">
83
84 <fileset dir="${basedir}/${ToolName}"
85 includes="${FileSet}" />
86
87 <fileset dir="${basedir}/Pccts/h"
88 includes="${FileSetPccts}" />
89
90 <includepath path="${PACKAGE_DIR}/Pccts/h"/>
91 <includepath path="${PACKAGE_DIR}/Include"/>
92 <includepath path="${PACKAGE_DIR}/Include/${HostArch}"/>
93 <includepath path="${PACKAGE_DIR}/Common"/>
94 <libset dir="${LIB_DIR}" libs="CommonTools"/>
95 <syslibset libs="${gxx_extra_libs}" if="gcc"/>
96 </cc>
97 </target>
98
99 <target name="clean">
100 <echo message="Removing Intermediate Files Only"/>
101 <delete>
102 <fileset dir="${BUILD_DIR}" includes="*.obj"/>
103 </delete>
104 </target>
105
106 <target name="cleanall">
107 <echo message="Removing Object Files and the Executable: ${ToolName}${ext_exe}"/>
108 <delete failonerror="false" quiet="true" includeEmptyDirs="true">
109 <fileset dir="${BUILD_DIR}"/>
110 <fileset file="${basedir}/${ToolName}/DLGLexer.cpp"/>
111 <fileset file="${basedir}/${ToolName}/DLGLexer.h"/>
112 <fileset file="${basedir}/${ToolName}/EfiVfrParser.cpp"/>
113 <fileset file="${basedir}/${ToolName}/EfiVfrParser.h"/>
114 <fileset file="${basedir}/${ToolName}/parser.dlg"/>
115 <fileset file="${basedir}/${ToolName}/tokens.h"/>
116 <fileset file="${basedir}/${ToolName}/VfrCompile.cpp"/>
117 <fileset file="${BIN_DIR}/${ToolName}${ext_exe}"/>
118 <fileset file="${BIN_DIR}/${ToolName}.pdb"/>
119 </delete>
120 </target>
121
122 </project>