From: jwang36 Date: Wed, 24 Jan 2007 09:05:56 +0000 (+0000) Subject: - Fixed EDKT513 by adding existing section files into the dependency check of genffsf... X-Git-Tag: edk2-stable201903~23582 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=66a9a6f8e99c1bf744e012448afcbd62bda7034d;ds=sidebyside - Fixed EDKT513 by adding existing section files into the dependency check of genffsfile tool; - 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 --- diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/FfsProcess.java b/Tools/Java/Source/GenBuild/org/tianocore/build/FfsProcess.java index baa9eab9a5..884a0d7453 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/FfsProcess.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/FfsProcess.java @@ -186,14 +186,18 @@ public class FfsProcess { // Element outofdateEle = document.createElement("OnDependency"); Element sourceEle = document.createElement("sourcefiles"); - String[] result = new String[sectionList.size()]; + Vector sections = new Vector(); for (int i = 0; i < sectionList.size(); i++) { - result[i] = (String) sectionList.get(i); + String section = (String) sectionList.get(i); + if (isSectionType(section)) { + sections.addElement(section); + } Element pathEle = document.createElement("file"); - pathEle.setAttribute("name", "${DEST_DIR_OUTPUT}" + File.separatorChar + basename - + getSectionExt(result[i])); + pathEle.setAttribute("name", getSectionFile(basename, section)); sourceEle.appendChild(pathEle); } + String[] result = sections.toArray(new String[sections.size()]); + outofdateEle.appendChild(sourceEle); Element targetEle = document.createElement("targetfiles"); Element fileEle = document.createElement("file"); @@ -370,14 +374,17 @@ public class FfsProcess { if (fileName == null) { list.addElement(type); + } else { + list.addElement(fileName); } + if (mode == MODE_GUID_DEFINED) { // // // Element ele = doc.createElement("input"); if (fileName == null) { - ele.setAttribute("file", "${DEST_DIR_OUTPUT}" + File.separatorChar + basename + getSectionExt(type)); + ele.setAttribute("file", getSectionFile(basename, type)); } else { ele.setAttribute("file", fileName); } @@ -388,7 +395,7 @@ public class FfsProcess { // Element ele = doc.createElement("sectFile"); if (fileName == null) { - ele.setAttribute("fileName", "${DEST_DIR_OUTPUT}" + File.separatorChar + basename + getSectionExt(type)); + ele.setAttribute("fileName", getSectionFile(basename, type)); } else { ele.setAttribute("fileName", fileName); } @@ -402,13 +409,22 @@ public class FfsProcess { @param type Section type @return Corresponding section file extension **/ - private String getSectionExt(String type) { + private String getSectionFile(String basename, String type) { + for (int i = 0; i < sectionExt.length; i++) { + if (sectionExt[i][0].equalsIgnoreCase(type)) { + return "${DEST_DIR_OUTPUT}" + File.separatorChar + basename + sectionExt[i][1]; + } + } + return type; + } + + private boolean isSectionType(String type) { for (int i = 0; i < sectionExt.length; i++) { if (sectionExt[i][0].equalsIgnoreCase(type)) { - return sectionExt[i][1]; + return true; } } - return ".sec"; + return false; } /** diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/ModuleBuildFileGenerator.java b/Tools/Java/Source/GenBuild/org/tianocore/build/ModuleBuildFileGenerator.java index da6847d9da..9c65d673d9 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/ModuleBuildFileGenerator.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/ModuleBuildFileGenerator.java @@ -423,7 +423,8 @@ public class ModuleBuildFileGenerator { // // Parse AutoGen.c & AutoGen.h // - if ( ! fpdModuleId.getModule().getName().equalsIgnoreCase("Shell")) { + if (!fpdModuleId.getModule().isLibrary() + && !fpdModuleId.getModule().getName().equalsIgnoreCase("Shell")) { fileProcess.parseFile(project.getProperty("DEST_DIR_DEBUG") + File.separatorChar + "AutoGen.c", null, root, false); } diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java b/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java index ce6ff61842..b7d6ec4e39 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java @@ -673,10 +673,6 @@ public class AutoGen { fileBuffer.append(ToolDefinitions.LINE_SEPARATOR); fileBuffer.append(this.myPcdAutogen.getCAutoGenString()); } - - if (!saveFile(outputPath + File.separatorChar + "AutoGen.c", fileBuffer)) { - throw new AutoGenException("Failed to generate AutoGen.c !!!"); - } } /**