]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/TianoTools/VfrCompile/build.xml
Updated to handle cygwin/gcc and moved msvc,gcc property settings to the TianoTools...
[mirror_edk2.git] / Tools / Source / TianoTools / VfrCompile / build.xml
index f6a08c83b2db0d0da4ba9542e552f69269bd140b..995cf7d6a5012d3f2fc9bc1348e6a61da389da2d 100644 (file)
@@ -9,7 +9,7 @@ http://opensource.org/licenses/bsd-license.php
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 -->\r
-<project default="GenTool" basedir=".">\r
+<project default="GenTool" basedir="." name="VfrCompile">\r
 <!--\r
     EDK VfrCompile Tool\r
   Copyright (c) 2006, Intel Corporation\r
@@ -21,83 +21,62 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   <typedef resource="cpptasks.types"/>\r
   <taskdef resource="net/sf/antcontrib/antlib.xml"/>\r
 \r
-  <property environment="env"/>\r
-\r
   <property name="LINK_OUTPUT_TYPE" value="static"/>\r
   <property name="BUILD_DIR" value="${PACKAGE_DIR}/${ToolName}/tmp"/>\r
 \r
   <target name="GenTool" depends="init, Antlr, Dlg, Tool">\r
-    <echo message="Building the EDK Tool: ${ToolName}"/>\r
+    <echo message="The EDK Tool: ${ToolName} build has completed"/>\r
   </target>\r
 \r
   <target name="init">\r
-    <echo message="The EDK Tool: ${ToolName}"/>\r
+\r
+    <echo message="Building the EDK Tool: ${ToolName}"/>\r
     <mkdir dir="${BUILD_DIR}"/>\r
-    <if>\r
-      <equals arg1="${GCC}" arg2="cygwin"/>\r
-      <then>\r
-        <echo message="Cygwin Family"/>\r
-        <property name="ToolChain" value="gcc"/>\r
-      </then>\r
-    <elseif>\r
-      <os family="dos"/>\r
-      <then>\r
-        <echo message="Windows Family"/>\r
-        <property name="ToolChain" value="msvc"/>\r
-      </then>\r
-    </elseif>\r
-    <elseif>\r
-      <os family="unix"/>\r
-      <then>\r
-        <echo message="UNIX Family"/>\r
-        <property name="ToolChain" value="gcc"/>\r
-      </then>\r
-    </elseif>\r
-\r
-    <else>\r
-      <echo>\r
-        Unsupported Operating System\r
-        Please Contact Intel Corporation\r
-      </echo>\r
-    </else>\r
-    </if>\r
-    <if>\r
-      <equals arg1="${ToolChain}" arg2="msvc"/>\r
-      <then>\r
-        <property name="ext_static" value=".lib"/>\r
-        <property name="ext_dynamic" value=".dll"/>\r
-        <property name="ext_exe" value=".exe"/>\r
-      </then>\r
-      <elseif>\r
-        <equals arg1="${ToolChain}" arg2="gcc"/>\r
-        <then>\r
-          <property name="ext_static" value=".a"/>\r
-          <property name="ext_dynamic" value=".so"/>\r
-          <property name="ext_exe" value=""/>\r
-        </then>\r
-      </elseif>\r
-    </if>\r
-               <condition property="CheckDepends">\r
-                 <uptodate targetfile="${WORKSPACE}/Tools/bin/VfrCompile${ext_exe}">\r
-                         <srcfiles dir="${WORKSPACE}/Tools/Source/TianoTools/VfrCompile" \r
-        includes="EfiVfrParser.cpp DLGLexer.cpp VfrCompile.cpp VfrCompile.g VfrServices.cpp parser.dlg"/>\r
-                       </uptodate>\r
-               </condition>\r
+\r
+    <condition property="AntlrDepends">\r
+      <uptodate targetfile="${PACKAGE_DIR}/VfrCompile/parser.dlg" srcfile="${PACKAGE_DIR}/VfrCompile/VfrCompile.g" value="true"/>\r
+    </condition>\r
+\r
+    <condition property="DlgDepends">\r
+      <uptodate targetfile="${PACKAGE_DIR}/VfrCompile/DLGLexer.cpp" srcfile="${PACKAGE_DIR}/VfrCompile/parser.dlg" value="true"/>\r
+    </condition>\r
+\r
+    <condition property="CheckDepends">\r
+      <or>\r
+        <isset property="AntlrDepends"/>\r
+        <isset property="DlgDepends"/>\r
+      </or>\r
+    </condition>\r
+\r
+    <condition property="gxx_extra_libs" value="stdc++ System gcc_s.10.4 gcc">\r
+      <os family="mac"/>\r
+    </condition>\r
+    \r
+    <condition property="gxx_extra_libs" value="stdc++">\r
+      <os name="linux"/>\r
+    </condition>\r
+    \r
+    <condition property="gxx_extra_libs" value="stdc++">\r
+      <os family="windows"/>\r
+    </condition>\r
+    \r
   </target>\r
 \r
-  <target name="Antlr" depends="init" unless="CheckDepends">\r
-    <exec dir="${basedir}/${ToolName}" executable="antlr" failonerror="TRUE">\r
+  <target name="Antlr" depends="init" unless="AntlrDepends">\r
+    <echo message="Executing ANTLR"/>\r
+    <exec dir="${basedir}/${ToolName}" executable="${env.FRAMEWORK_TOOLS_PATH}/antlr" failonerror="TRUE">\r
       <arg line="-CC -e3 -ck 3 -o . VfrCompile.g"/>\r
     </exec>\r
   </target>\r
 \r
-  <target name="Dlg" depends="Antlr" unless="CheckDepends">\r
-    <exec dir="${basedir}/${ToolName}" executable="dlg" failonerror="TRUE">\r
-      <arg line="-C2 -i -CC -o . Parser.dlg"/>\r
+  <target name="Dlg" depends="Antlr" unless="DlgDepends">\r
+    <echo message="Executing DLG"/>\r
+    <exec dir="${basedir}/${ToolName}" executable="${env.FRAMEWORK_TOOLS_PATH}/dlg" failonerror="TRUE">\r
+      <arg line="-C2 -i -CC -o . parser.dlg"/>\r
     </exec>\r
   </target>\r
 \r
-  <target name="Tool" depends="init, Dlg">\r
+  <target name="Tool" depends="init">\r
     <cc name="${ToolChain}" objdir="${BUILD_DIR}" \r
         outfile="${BIN_DIR}/${ToolName}"\r
         outtype="executable"\r
@@ -109,28 +88,34 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
       <fileset dir="${basedir}/Pccts/h" \r
         includes="${FileSetPccts}" />\r
 \r
-      <includepath path="${env.WORKSPACE}/Tools/Source/TianoTools/Pccts/h"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Pccts/h"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/${HostArch}"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools"/>\r
-      <syslibset libs="stdc++" if="gcc"/>\r
+      <syslibset libs="${gxx_extra_libs}" if="gcc"/>\r
     </cc>\r
   </target>\r
 \r
-  <target name="clean" depends="init">\r
+  <target name="clean">\r
     <echo message="Removing Intermediate Files Only"/>\r
     <delete>\r
       <fileset dir="${BUILD_DIR}" includes="*.obj"/>\r
     </delete>\r
   </target>\r
 \r
-  <target name="cleanall" depends="init">\r
+  <target name="cleanall">\r
     <echo message="Removing Object Files and the Executable: ${ToolName}${ext_exe}"/>\r
-    <delete dir="${BUILD_DIR}">\r
-      <fileset dir="${BIN_DIR}" includes="${ToolName}${ext_exe}"/>\r
+    <delete failonerror="false" quiet="true" includeEmptyDirs="true">\r
+      <fileset dir="${BUILD_DIR}"/>\r
+      <fileset file="${basedir}/${ToolName}/DLGLexer.cpp"/>\r
+      <fileset file="${basedir}/${ToolName}/DLGLexer.h"/>\r
+      <fileset file="${basedir}/${ToolName}/EfiVfrParser.cpp"/>\r
+      <fileset file="${basedir}/${ToolName}/EfiVfrParser.h"/>\r
+      <fileset file="${basedir}/${ToolName}/parser.dlg"/>\r
+      <fileset file="${basedir}/${ToolName}/tokens.h"/>\r
+      <fileset file="${basedir}/${ToolName}/VfrCompile.cpp"/>\r
+      <fileset file="${BIN_DIR}/${ToolName}${ext_exe}"/>\r
     </delete>\r
   </target>\r
 \r