- Fixed EDKT513 by adding existing section files into the dependency check of genffsf...
authorjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 24 Jan 2007 09:05:56 +0000 (09:05 +0000)
committerjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 24 Jan 2007 09:05:56 +0000 (09:05 +0000)
- Fixed EDKT514 by removing the generation and build of AutoGen.c for library

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2295 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Java/Source/GenBuild/org/tianocore/build/FfsProcess.java
Tools/Java/Source/GenBuild/org/tianocore/build/ModuleBuildFileGenerator.java
Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java

index baa9eab9a591b5ea7b365bfba9a78bac70fa35f0..884a0d7453fcf1e9e518f02de42ed8f2569583af 100644 (file)
@@ -186,14 +186,18 @@ public class FfsProcess {
         //\r
         Element outofdateEle = document.createElement("OnDependency");\r
         Element sourceEle = document.createElement("sourcefiles");\r
-        String[] result = new String[sectionList.size()];\r
+        Vector<String> sections = new Vector<String>();\r
         for (int i = 0; i < sectionList.size(); i++) {\r
-            result[i] = (String) sectionList.get(i);\r
+            String section = (String) sectionList.get(i);\r
+            if (isSectionType(section)) {\r
+                sections.addElement(section);\r
+            }\r
             Element pathEle = document.createElement("file");\r
-            pathEle.setAttribute("name", "${DEST_DIR_OUTPUT}" + File.separatorChar + basename\r
-                                         + getSectionExt(result[i]));\r
+            pathEle.setAttribute("name", getSectionFile(basename, section));\r
             sourceEle.appendChild(pathEle);\r
         }\r
+        String[] result = sections.toArray(new String[sections.size()]);\r
+\r
         outofdateEle.appendChild(sourceEle);\r
         Element targetEle = document.createElement("targetfiles");\r
         Element fileEle = document.createElement("file");\r
@@ -370,14 +374,17 @@ public class FfsProcess {
         \r
         if (fileName == null) {\r
             list.addElement(type);\r
+        } else {\r
+            list.addElement(fileName);\r
         }\r
+\r
         if (mode == MODE_GUID_DEFINED) {\r
             //\r
             // <input file="${DEST_DIR_OUTPUT}\Bds.pe32"/>\r
             //\r
             Element ele = doc.createElement("input");\r
             if (fileName == null) {\r
-                ele.setAttribute("file", "${DEST_DIR_OUTPUT}" + File.separatorChar + basename + getSectionExt(type));\r
+                ele.setAttribute("file", getSectionFile(basename, type));\r
             } else {\r
                 ele.setAttribute("file", fileName);\r
             }\r
@@ -388,7 +395,7 @@ public class FfsProcess {
             //\r
             Element ele = doc.createElement("sectFile");\r
             if (fileName == null) {\r
-                ele.setAttribute("fileName", "${DEST_DIR_OUTPUT}" + File.separatorChar + basename + getSectionExt(type));\r
+                ele.setAttribute("fileName", getSectionFile(basename, type));\r
             } else {\r
                 ele.setAttribute("fileName", fileName);\r
             }\r
@@ -402,13 +409,22 @@ public class FfsProcess {
       @param type Section type\r
       @return Corresponding section file extension\r
     **/\r
-    private String getSectionExt(String type) {\r
+    private String getSectionFile(String basename, String type) {\r
+        for (int i = 0; i < sectionExt.length; i++) {\r
+            if (sectionExt[i][0].equalsIgnoreCase(type)) {\r
+                return "${DEST_DIR_OUTPUT}" + File.separatorChar + basename + sectionExt[i][1];\r
+            }\r
+        }\r
+        return type;\r
+    }\r
+\r
+    private boolean isSectionType(String type) {\r
         for (int i = 0; i < sectionExt.length; i++) {\r
             if (sectionExt[i][0].equalsIgnoreCase(type)) {\r
-                return sectionExt[i][1];\r
+                return true;\r
             }\r
         }\r
-        return ".sec";\r
+        return false;\r
     }\r
 \r
     /**\r
index da6847d9da9686755d3bdc6597c3a4089401d1b5..9c65d673d966dcbbd59d9dde0bc20ad0f843ecf3 100644 (file)
@@ -423,7 +423,8 @@ public class ModuleBuildFileGenerator {
         //\r
         // Parse AutoGen.c & AutoGen.h\r
         //\r
-        if ( ! fpdModuleId.getModule().getName().equalsIgnoreCase("Shell")) {\r
+        if (!fpdModuleId.getModule().isLibrary()\r
+            && !fpdModuleId.getModule().getName().equalsIgnoreCase("Shell")) {\r
             fileProcess.parseFile(project.getProperty("DEST_DIR_DEBUG") + File.separatorChar + "AutoGen.c", null, root, false);\r
         }\r
         \r
index ce6ff6184221a37cb793dd21b9eee2feb51234c0..b7d6ec4e395511997acd6692d79cbeee8dbbcab5 100644 (file)
@@ -673,10 +673,6 @@ public class AutoGen {
             fileBuffer.append(ToolDefinitions.LINE_SEPARATOR);\r
             fileBuffer.append(this.myPcdAutogen.getCAutoGenString());\r
         }\r
-\r
-        if (!saveFile(outputPath + File.separatorChar + "AutoGen.c", fileBuffer)) {\r
-            throw new AutoGenException("Failed to generate AutoGen.c !!!");\r
-        }\r
     }\r
 \r
     /**\r