added asm file preprocess in <Build_Assembly> macro
[mirror_edk2.git] / Tools / Conf / BuildMacro.xml
index cbf35c94c904138f8d895b30b9e71d9dad5f82e4..8baeab9375260f4e2b0941a4f6e1460ecaecb918 100644 (file)
@@ -210,6 +210,28 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         </targetfiles>\r
 \r
         <sequential>\r
+          <cc userdefine="on">\r
+            <command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}/@{FILEPATH}" family="${CC_FAMILY}">\r
+              <EXTRA.INC.1/>\r
+              <argument value="${PP_FLAGS}"/>\r
+              <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
+            </command>\r
+          </cc>\r
+\r
+          <replaceregexp file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"\r
+                         match="^(#line +1 +.*@{FILEPATH}/@{FILENAME}\.@{FILEEXT}&quot;).+\1"\r
+                         replace=";"\r
+                         flags="gs"/>\r
+          <replaceregexp file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"\r
+                         match="^(#line .*)$"\r
+                         replace="; \1"\r
+                         byline="true"/>\r
+          <replaceregexp file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"\r
+                         match="([^_a-zA-Z])0x([0-9a-fA-F]+)"\r
+                         replace="\10\2h"\r
+                         flags="g"\r
+                         byline="true"/>\r
+\r
           <cc userdefine="on">\r
             <command type="ASM" cmd="${ASM}" workdir="${DEST_DIR_OUTPUT}" family="${ASM_FAMILY}"\r
                 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">\r
@@ -218,7 +240,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
               <argument value="${ASM_FLAGS}"/>\r
               <EXTRA.ARG.1/>\r
       \r
-              <fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>\r
+              <!-- fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/ -->\r
+              <fileset casesensitive="off" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"/>\r
             </command>\r
           </cc>\r
         </sequential>\r