Add build macro to generate section type TE. 

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@719 6f19259b-4bc3-4df7-8a09-765794883524
diff --git a/Tools/Conf/BuildMacro.xml b/Tools/Conf/BuildMacro.xml
index 3c20e60..cbf35c9 100644
--- a/Tools/Conf/BuildMacro.xml
+++ b/Tools/Conf/BuildMacro.xml
@@ -842,23 +842,63 @@
     </macrodef>

     -->

 

-  <!--

+  <!-- 

     EFI_SECTION_TE

-    <macrodef name="EFI_SECTION_TE">

-      <attribute name="FILEPATH"/>

-      <attribute name="FILENAME"/>

-      <attribute name="FILEEXT" default=""/>

-  

-      <element name="EXTRA.INC" optional="yes"/>

-      <element name="EXTRA.ARG" optional="yes"/>

-  

-      <sequential>

-        <gensection inputfile="${BIN_DIR}/@{FILENAME}.@{FILEEXT}" 

-                    outputfile="${BIN_DIR}/@{FILENAME}.pe32" 

-                    sectiontype="EFI_SECTION_PE32"/>

-      </sequential>

-    </macrodef>

-    -->

+  -->

+  <macrodef name="EFI_SECTION_TE">

+    <attribute name="FILEPATH"/>

+    <attribute name="FILENAME"/>

+    <attribute name="FILEEXT" default="" />

+

+    <element name="PRE.PROCESS" optional="yes"/>

+    <element name="POST.PROCESS" optional="yes"/>

+

+    <sequential>

+      <PRE.PROCESS/>

+

+      <if>

+        <not>

+          <!-- TBD ${OBJECTS} -->

+          <equals arg1="${LIBS}" arg2=""/>

+        </not>

+

+        <then>

+          <GenDll FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="">

+            <LIB.ARG></LIB.ARG>

+            <LINK.ARG></LINK.ARG>

+          </GenDll>

+    

+          <GenEfi FILEPATH="." FILENAME="@{FILENAME}" FILEEXT="dll"/>

+        </then>

+      </if>

+

+      <OnDependency>

+        <sourcefiles>

+          <file name="${DEST_DIR_OUTPUT}\@{FILENAME}.efi"/>

+        </sourcefiles>

+        <targetfiles>

+          <file name="${DEST_DIR_OUTPUT}\@{FILENAME}.tes"/>

+        </targetfiles>

+

+        <sequential>

+          <copy file="${DEST_DIR_OUTPUT}\@{FILENAME}.efi" tofile="${BIN_DIR}\@{FILENAME}.efi" />

+          <copy file="${DEST_DIR_OUTPUT}\@{FILENAME}.efi" tofile="${DEST_DIR_DEBUG}\@{FILENAME}.efi" />

+          

+          <exec executable="${GENTEIMAGE}">

+            <arg line="-o ${DEST_DIR_OUTPUT}\@{FILENAME}.te ${DEST_DIR_OUTPUT}\@{FILENAME}.efi" />

+          </exec>

+          

+          <copy file="${DEST_DIR_OUTPUT}\@{FILENAME}.te" tofile="${BIN_DIR}\@{FILENAME}.te" />

+          

+          <gensection inputfile="${DEST_DIR_OUTPUT}\@{FILENAME}.te" 

+                      outputfile="${DEST_DIR_OUTPUT}\@{FILENAME}.tes" 

+                      sectiontype="EFI_SECTION_TE"/>

+          <POST.PROCESS/>

+        </sequential>

+      </OnDependency>

+    </sequential>

+  </macrodef>

+

 

   <!--

     EFI_SECTION_RAW