Using ${OBJECTS} instead of fileset to trace all obj files. Add a new Macro named...
authorwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 14 Aug 2006 07:00:48 +0000 (07:00 +0000)
committerwuyizhong <wuyizhong@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 14 Aug 2006 07:00:48 +0000 (07:00 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1252 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Conf/BuildMacro.xml
Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java
Tools/Source/GenBuild/org/tianocore/build/ModuleBuildFileGenerator.java

index cd9b805..41e2163 100644 (file)
@@ -10,6 +10,17 @@ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 -->\r
 <project name="common">\r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 -->\r
 <project name="common">\r
+  <!--\r
+    Macro for intialize some properties. This Macro build will be called before source file build.  \r
+    -->\r
+  <macrodef name="Build_Init">\r
+    <sequential>\r
+      <var name="OBJECTS" value="" />\r
+      <var name="SDB_FILES" value="" />\r
+    </sequential>\r
+  </macrodef>\r
+\r
+\r
   <!--\r
     macro definitions for building files with different types\r
     -->\r
   <!--\r
     macro definitions for building files with different types\r
     -->\r
@@ -60,6 +71,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
           </cc>\r
         </sequential>\r
       </OnDependency>\r
           </cc>\r
         </sequential>\r
       </OnDependency>\r
+      <var name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" />\r
     </sequential>\r
   </macrodef>\r
 \r
     </sequential>\r
   </macrodef>\r
 \r
@@ -108,6 +120,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
           </cc>\r
         </sequential>\r
       </OnDependency>\r
           </cc>\r
         </sequential>\r
       </OnDependency>\r
+      <var name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" />\r
     </sequential>\r
   </macrodef>\r
 \r
     </sequential>\r
   </macrodef>\r
 \r
@@ -252,6 +265,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
           </cc>\r
         </sequential>\r
       </OnDependency>\r
           </cc>\r
         </sequential>\r
       </OnDependency>\r
+      <var name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" />\r
     </sequential>\r
   </macrodef>\r
 \r
     </sequential>\r
   </macrodef>\r
 \r
@@ -293,6 +307,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
           </cc>\r
         </sequential>\r
       </OnDependency>\r
           </cc>\r
         </sequential>\r
       </OnDependency>\r
+      <var name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" />\r
     </sequential>\r
   </macrodef>\r
 \r
     </sequential>\r
   </macrodef>\r
 \r
@@ -349,6 +364,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
           </cc>\r
         </sequential>\r
       </OnDependency>\r
           </cc>\r
         </sequential>\r
       </OnDependency>\r
+      <var name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" />\r
     </sequential>\r
   </macrodef>\r
 \r
     </sequential>\r
   </macrodef>\r
 \r
@@ -396,7 +412,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
       <OnDependency>\r
         <sourcefiles>\r
 \r
       <OnDependency>\r
         <sourcefiles>\r
-          <fileset casesensitive="on" dir="${DEST_DIR_OUTPUT}" includes="**/*.obj"/>\r
+          <file list="${OBJECTS}" />\r
         </sourcefiles>\r
         <targetfiles>\r
           <file name="${BIN_DIR}/@{FILENAME}.lib"/>\r
         </sourcefiles>\r
         <targetfiles>\r
           <file name="${BIN_DIR}/@{FILENAME}.lib"/>\r
@@ -408,7 +424,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                 outputFile="${BIN_DIR}/@{FILENAME}.lib">\r
               <argument value="${SLINK_FLAGS}"/>\r
 \r
                 outputFile="${BIN_DIR}/@{FILENAME}.lib">\r
               <argument value="${SLINK_FLAGS}"/>\r
 \r
-              <fileset casesensitive="on" dir="${DEST_DIR_OUTPUT}" includes="**/*.obj"/>\r
+              <argument value="${OBJECTS}"/>\r
             </command>\r
           </cc>\r
         </sequential>\r
             </command>\r
           </cc>\r
         </sequential>\r
@@ -525,7 +541,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
           </cc>\r
         </sequential>\r
       </OnDependency>\r
           </cc>\r
         </sequential>\r
       </OnDependency>\r
-\r
+      <var name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Strings.obj" />\r
     </sequential>\r
   </macrodef>\r
 \r
     </sequential>\r
   </macrodef>\r
 \r
@@ -579,6 +595,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
           <delete file="${PLATFORM_DIR}/@{FILENAME}.i" />\r
         </sequential>\r
       </OnDependency>\r
           <delete file="${PLATFORM_DIR}/@{FILENAME}.i" />\r
         </sequential>\r
       </OnDependency>\r
+      <var name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" />\r
     </sequential>\r
   </macrodef>\r
 \r
     </sequential>\r
   </macrodef>\r
 \r
@@ -618,7 +635,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
       <OnDependency>\r
         <sourcefiles>\r
           <file list="${LIBS}"/>\r
       <OnDependency>\r
         <sourcefiles>\r
           <file list="${LIBS}"/>\r
-          <fileset casesensitive="on" dir="${DEST_DIR_OUTPUT}" includes="**/*.obj"/>\r
+          <file list="${OBJECTS}"/>\r
         </sourcefiles>\r
         <targetfiles>\r
           <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll"/>\r
         </sourcefiles>\r
         <targetfiles>\r
           <file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll"/>\r
@@ -630,7 +647,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib">\r
               <argument value="${SLINK_FLAGS}"/>\r
 \r
                 outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib">\r
               <argument value="${SLINK_FLAGS}"/>\r
 \r
-              <fileset casesensitive="on" dir="${DEST_DIR_OUTPUT}" includes="**/*.obj"/>\r
+              <argument value="${OBJECTS}"/>\r
             </command>\r
           </cc>\r
           <cc userdefine="on">\r
             </command>\r
           </cc>\r
           <cc userdefine="on">\r
index 72870e0..7a9d7c4 100644 (file)
@@ -285,7 +285,6 @@ public class GenBuildTask extends Ant {
                     // MODULE or BASE_NAME, GUID or FILE_GUID, VERSION, MODULE_TYPE\r
                     // MODULE_DIR, MODULE_RELATIVE_DIR\r
                     // SUBSYSTEM, ENTRYPOINT, EBC_TOOL_LIB_PATH\r
                     // MODULE or BASE_NAME, GUID or FILE_GUID, VERSION, MODULE_TYPE\r
                     // MODULE_DIR, MODULE_RELATIVE_DIR\r
                     // SUBSYSTEM, ENTRYPOINT, EBC_TOOL_LIB_PATH\r
-                    // LIBS, OBJECTS, SDB_FILES\r
                     //\r
                     setModuleCommonProperties(archList[k]);\r
                     \r
                     //\r
                     setModuleCommonProperties(archList[k]);\r
                     \r
@@ -429,12 +428,7 @@ public class GenBuildTask extends Ant {
             getProject().setProperty("ENTRYPOINT", "_ModuleEntryPoint");\r
         }\r
         \r
             getProject().setProperty("ENTRYPOINT", "_ModuleEntryPoint");\r
         }\r
         \r
-        //\r
-        // LIBS, OBJECTS, SDB_FILES\r
-        //\r
         getProject().setProperty("OBJECTS", "");\r
         getProject().setProperty("OBJECTS", "");\r
-        getProject().setProperty("SDB_FILES", "");\r
-        getProject().setProperty("LIBS", "");\r
     }\r
 \r
     private void getCompilerFlags(String target, String toolchain, FpdModuleIdentification fpdModuleId) throws EdkException {\r
     }\r
 \r
     private void getCompilerFlags(String target, String toolchain, FpdModuleIdentification fpdModuleId) throws EdkException {\r
index 49628af..cdd8814 100644 (file)
@@ -414,6 +414,12 @@ public class ModuleBuildFileGenerator {
 \r
         FileProcess fileProcess = new FileProcess();\r
         fileProcess.init(project, includes, document);\r
 \r
         FileProcess fileProcess = new FileProcess();\r
         fileProcess.init(project, includes, document);\r
+        \r
+        //\r
+        // Initialize some properties by user\r
+        //\r
+        Element initEle = document.createElement("Build_Init");\r
+        root.appendChild(initEle);\r
 \r
         String moduleDir = project.getProperty("MODULE_DIR");\r
         //\r
 \r
         String moduleDir = project.getProperty("MODULE_DIR");\r
         //\r