]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/TianoTools/build.xml
Updated to handle cygwin/gcc and moved msvc,gcc property settings to the TianoTools...
[mirror_edk2.git] / Tools / Source / TianoTools / build.xml
index 065cb6c33c552d8fc88f147b17077c321220ab04..d304f0a014c93cab67a3d106252189dca21eaf0b 100644 (file)
@@ -9,21 +9,15 @@ 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="all" basedir=".">\r
+<project default="all" basedir="." name="C_Code">\r
 <!-- Copyright (c) 2006, Intel Corporation -->\r
 <!-- Filename: Tools/Source/build.xml -->\r
 \r
   <taskdef resource="net/sf/antcontrib/antlib.xml"/>\r
+\r
+  <property name="ReallyVerbose" value="false"/>\r
   <property environment="env" />\r
-  <condition property="HostArch" value="x64">\r
-    <os arch="amd64"/>\r
-  </condition>\r
-  <condition property="HostArch" value="Ia32">\r
-    <os arch="x86"/>\r
-  </condition>\r
-  <condition property="HostArch" value="Ia32">\r
-    <os arch="i386"/>\r
-  </condition>\r
+\r
   <property name="WORKSPACE" value="${env.WORKSPACE}" />\r
   <property name="WORKSPACE_DIR" value="${WORKSPACE}" />\r
   <property name="PACKAGE" value="Tools" />\r
@@ -32,7 +26,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   <property name="BIN_DIR" value="${WORKSPACE}/Tools/bin" />\r
   <property name="BUILD_MODE" value="PACKAGE" />\r
   <property name="Libs" \r
-    value="String/build.xml Common/build.xml CustomizedCompress/build.xml PeCoffLoader/build.xml"/>\r
+    value="Common/build.xml CustomizedCompress/build.xml PeCoffLoader/build.xml String/build.xml"/>\r
 \r
   <import file="${WORKSPACE_DIR}/Tools/Conf/BuildMacro.xml" />\r
 \r
@@ -41,46 +35,71 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <fileset dir="${env.XMLBEANS_HOME}/lib" includes="*.jar"/>\r
   </path>\r
 \r
-  <target name="all" depends="init, Tools" />\r
-  \r
-  <target name="init">\r
-    <taskdef classpathref="classpath" resource="GenBuild.tasks" />\r
-    <taskdef classpathref="classpath" resource="net/sf/antcontrib/antlib.xml" />\r
+  <taskdef classpathref="classpath" resource="GenBuild.tasks" />\r
+  <taskdef classpathref="classpath" resource="net/sf/antcontrib/antlib.xml" />\r
 \r
-    <taskdef classpathref="classpath" resource="cpptasks.tasks"/>\r
-    <typedef classpathref="classpath" resource="cpptasks.types"/>\r
+  <taskdef classpathref="classpath" resource="cpptasks.tasks"/>\r
+  <typedef classpathref="classpath" resource="cpptasks.types"/>\r
 \r
+  <target name="all" depends="init, Tools">\r
+    <echo message="The EDK II C Tools build complete!"/>\r
+  </target>\r
+  \r
+  <target name="init">\r
+    <echo message="EDK C Code Tools, build initialization"/>\r
     <mkdir dir="${BIN_DIR}" />\r
     <mkdir dir="${LIB_DIR}" />\r
+\r
+    <condition property="HostArch" value="X64">\r
+      <os arch="amd64"/>\r
+    </condition>\r
+    <condition property="HostArch" value="Ia32">\r
+      <or>\r
+        <os arch="x86"/>\r
+        <os arch="i386"/>\r
+      </or>\r
+    </condition>\r
+    <condition property="HostArch" value="Ia32">\r
+      <os arch="i386"/>\r
+    </condition> \r
+\r
     <if>\r
       <os family="unix" />\r
       <then>\r
-        <echo message="OS Family UNIX" />\r
+        <echo message="OS Family UNIX, ${HostArch}" />\r
       </then>\r
       <elseif>\r
         <os family="dos" />\r
         <then>\r
-          <echo message="OS Family DOS" />\r
+          <echo message="OS Family DOS, ${HostArch}" />\r
         </then>\r
       </elseif>\r
       <elseif>\r
         <os family="mac" />\r
         <then>\r
-          <echo message="OS Family OS X" />\r
+          <echo message="OS Family OS X, ${HostArch}" />\r
         </then>\r
       </elseif>\r
       <else>\r
-        <echo message="OS Family Unsupported" />\r
+        <fail message="OS Family Unsupported, ${HostArch}" />\r
       </else>\r
     </if>\r
 \r
     <if>\r
-        <isset property="env.TOOL_CHAIN" />\r
+      <not>\r
+        <isset property="ToolChain" />\r
+      </not>\r
       <then>\r
-        <property name="ToolChain" value="${env.TOOL_CHAIN}"/>\r
-        <condition property="gcc">\r
-          <equals arg1="${ToolChain}" arg2="gcc"/>\r
-        </condition>\r
+        <if>\r
+          <isset property="env.TOOL_CHAIN" />\r
+          <then>\r
+            <property name="ToolChain" value="${env.TOOL_CHAIN}"/>\r
+          </then>\r
+          <else>\r
+            <!-- Default Tool Chain is Microsoft Visual Studio -->\r
+            <property name="ToolChain" value="msvc"/>\r
+          </else>\r
+        </if>\r
       </then>\r
     </if>\r
 \r
@@ -88,10 +107,37 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
       <os name="Linux"/>\r
     </condition>\r
     \r
+    <condition property="intel_win">\r
+      <and>\r
+        <os family="dos"/>\r
+        <equals arg1="${ToolChain}" arg2="intel"/>\r
+      </and>\r
+    </condition>\r
+    \r
+    <condition property="intel_linux">\r
+      <and>\r
+        <os name="Linux"/>\r
+        <equals arg1="${ToolChain}" arg2="intel"/>\r
+      </and>\r
+    </condition>\r
+    \r
+    <condition property="intel_mac">\r
+      <and>\r
+        <os family="mac"/>\r
+        <equals arg1="${ToolChain}" arg2="intel"/>\r
+      </and>\r
+    </condition>\r
+    \r
+    <condition property="gcc">\r
+      <and>\r
+        <equals arg1="${ToolChain}" arg2="gcc"/>\r
+      </and>\r
+    </condition>\r
+\r
     <condition property="cygwin">\r
       <and>\r
         <os family="dos"/>\r
-        <istrue value="${gcc}"/>\r
+        <equals arg1="${ToolChain}" arg2="gcc"/>\r
       </and>\r
     </condition>\r
     \r
@@ -109,10 +155,74 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <condition property="OSX" value="true">\r
       <os family="Mac"/>\r
     </condition>\r
-    \r
+\r
+    <condition property="cyglinux">\r
+      <or>\r
+        <istrue value="linux"/>\r
+        <istrue value="${cygwin}"/>\r
+      </or>\r
+    </condition>\r
+\r
+    <!-- msft is a family, used by both Microsoft and Intel Windows compiler tool chains -->\r
+    <condition property="msft">\r
+      <isfalse value="${gcc}"/>\r
+    </condition>\r
+\r
+    <if>\r
+      <istrue value="${ReallyVerbose}"/>\r
+      <then>\r
+        <echo message="Test property msvc:         ${msvc}"/> \r
+        <echo message="Test property gcc:          ${gcc}"/> \r
+        <echo message="Test property intel_win:    ${intel_win}"/> \r
+        <echo message="Test property intel_linux:  ${intel_linux}"/> \r
+        <echo message="Test property intel_mac:    ${intel_mac}"/> \r
+        <echo message="Test property msft:         ${msft}"/> \r
+        <echo message="Test property cygwin:       ${cygwin}"/> \r
+        <echo message="Test property cyglinux:     ${cyglinux}"/> \r
+        <echo message="Test property windows:      ${windows}"/> \r
+        <echo message="Test property linux:        ${linux}"/> \r
+        <echo message="Test property OSX:          ${OSX}"/> \r
+        <echo message="Test property x86_64_linux: ${x86_64_linux}"/> \r
+       </then>\r
+    </if>\r
+\r
+    <property name="haveLibtool" value="false"/>\r
+    <if>\r
+      <and>\r
+        <not>\r
+          <isset property="env.CYGWIN_HOME"/>\r
+        </not>\r
+          <isset property="cygwin"/>\r
+      </and>\r
+      <then>\r
+        <fail message="You must set the environment variable: CYGWIN_HOME"/>\r
+      </then>\r
+    </if>\r
+\r
+    <if>\r
+        <istrue value="${gcc}"/>\r
+      <then>\r
+        <property name="ext_static" value=".a"/>\r
+        <property name="ext_dynamic" value=".so"/>\r
+        <if>\r
+          <istrue value="${cygwin}"/>\r
+          <then>\r
+            <property name="ext_exe" value=".exe"/>\r
+          </then>\r
+          <else>\r
+            <property name="ext_exe" value=""/>\r
+          </else>\r
+        </if>\r
+      </then>\r
+      <else>\r
+        <property name="ext_static" value=".lib"/>\r
+        <property name="ext_dynamic" value=".dll"/>\r
+        <property name="ext_exe" value=".exe"/>\r
+      </else>\r
+    </if>\r
   </target>\r
-  \r
-  <target name="Libraries">\r
+\r
+  <target name="Libraries" depends="init">\r
     <subant target="" inheritall="true">\r
       <fileset dir="${PACKAGE_DIR}" \r
         includes="${Libs}"/>\r
@@ -126,13 +236,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     </subant>\r
   </target>\r
 \r
-  <target name="clean">\r
+  <target name="clean" depends="init">\r
     <subant target="clean" inheritall="true">\r
       <fileset dir="${PACKAGE_DIR}" includes="*/build.xml"/>\r
     </subant>\r
   </target>\r
 \r
-  <target name="cleanall">\r
+  <target name="cleanall" depends="init">\r
     <subant target="cleanall" inheritall="true">\r
       <fileset dir="${PACKAGE_DIR}" includes="*/build.xml"/>\r
     </subant>\r