Add build rules for asl files of acpi tables.
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 31 Oct 2006 01:58:39 +0000 (01:58 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 31 Oct 2006 01:58:39 +0000 (01:58 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1867 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Conf/BuildMacro.xml

index 115680c..209bcb4 100644 (file)
@@ -761,7 +761,111 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
       </concat>\r
     </sequential>\r
   </macrodef>\r
-  \r
+\r
+  <!--\r
+      Build Asl table file\r
+    -->\r
+  <macrodef name="Build_ASL">\r
+    <attribute name="FILEPATH"/>\r
+    <attribute name="FILENAME"/>\r
+    <attribute name="FILEEXT" default="asl"/>\r
+\r
+    <element name="EXTRA.INC" optional="yes"/>\r
+    <element name="EXTRA.ARG" optional="yes"/>\r
+    \r
+    <sequential>\r
+      <mkdir dir="${DEST_DIR_OUTPUT}"/>\r
+\r
+      <OnDependency>\r
+        <sourcefiles>\r
+          <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
+        </sourcefiles>\r
+        <targetfiles>\r
+          <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>\r
+        </targetfiles>\r
+\r
+        <sequential>\r
+          <cc userdefine="on">\r
+            <command type="PP" cmd="${PP}" workdir="${DEST_DIR_OUTPUT}" family="${PP_FAMILY}" \r
+                dpath="${PP_DPATH}" libpath="${PP_LIBPATH}" include="${PP_INCLUDEPATH}">\r
+              <argument value="${APP_FLAGS}"/>\r
+              <EXTRA.INC/>              \r
+              <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
+            </command>\r
+          </cc>\r
+\r
+          <exec dir="${DEST_DIR_OUTPUT}" executable="${ASL}" failonerror="true" outputproperty="ASL_OUTPUT">\r
+            <arg line="${DEST_DIR_OUTPUT}/@{FILENAME}.i"/>\r
+          </exec>\r
+\r
+          <if>\r
+            <or>\r
+              <contains string="${ASL_OUTPUT}" substring="Supports ACPI Specification Revision 2.0"/>\r
+              <contains string="${ASL_OUTPUT}" substring="Supports ACPI Specification Revision 1.0"/>\r
+            </or>\r
+            <then>\r
+              <fail message="Current Asl tool not support Acpi Spec 3.0. Pls update your Asl compiler."/>\r
+            </then>\r
+          </if>\r
+\r
+          <EFI_SECTION_RAW FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="aml"/>\r
+          \r
+        </sequential>\r
+      </OnDependency>\r
+    </sequential>\r
+  </macrodef>  \r
+\r
+  <!--\r
+      Build Asl table c file\r
+    -->\r
+  <macrodef name="Build_CCASL">\r
+    <attribute name="FILEPATH"/>\r
+    <attribute name="FILENAME"/>\r
+    <attribute name="FILEEXT" default="c"/>\r
+\r
+    <element name="EXTRA.INC" optional="yes"/>\r
+    <element name="EXTRA.ARG" optional="yes"/>\r
+    \r
+    <sequential>\r
+      <mkdir dir="${DEST_DIR_OUTPUT}"/>\r
+\r
+      <OnDependency>\r
+        <sourcefiles>\r
+          <file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
+        </sourcefiles>\r
+        <targetfiles>\r
+          <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>\r
+        </targetfiles>\r
+\r
+        <sequential>\r
+\r
+          <cc userdefine="on">\r
+            <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}" family="${CC_FAMILY}"\r
+                outputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.obj" dpath="${CC_DPATH}" \r
+                libpath="${CC_LIBPATH}" include="${CC_INCLUDEPATH}">\r
+              <EXTRA.INC/>\r
+              <argument value="${CC_FLAGS}"/>\r
+              <EXTRA.ARG/>\r
+              <fileset casesensitive="on" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
+            </command>\r
+          </cc>\r
+\r
+          <cc userdefine="on">\r
+            <command type="DLINK" cmd="${DLINK}" family="${DLINK_FAMILY}" \r
+                     outputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.exe" dpath="${DLINK_DPATH}" >\r
+              <argument value="${SLINK_FLAGS}"/>\r
+              <fileset casesensitive="on" file="${DEST_DIR_OUTPUT}/@{FILENAME}.obj"/>\r
+            </command>\r
+          </cc>\r
+          \r
+          <genacpitable inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.exe" outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.acpi" />     \r
+     \r
+          <EFI_SECTION_RAW FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="acpi"/>\r
+        </sequential>\r
+      </OnDependency>\r
+    </sequential>\r
+  </macrodef> \r
+\r
   <!--\r
     DUMMY\r
     -->\r
@@ -1131,7 +1235,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <sequential>\r
       <OnDependency>\r
         <sourcefiles>\r
-          <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}"/>\r
+          <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
         </sourcefiles>\r
         <targetfiles>\r
           <file name="${DEST_DIR_OUTPUT}/@{FILENAME}.sec"/>\r
@@ -1139,7 +1243,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
         <sequential>\r
           <PRE.PROCESS/>\r
-          <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.@{FILEEXT}" \r
+          <gensection inputfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}" \r
                       outputfile="${DEST_DIR_OUTPUT}/@{FILENAME}.sec" \r
                       sectiontype="EFI_SECTION_RAW"/>\r
           <POST.PROCESS/>\r