} else {\r
moduleId.setLibrary(true);\r
}\r
+ moduleId.setBinary(saq.getBinaryModule());\r
\r
//\r
// Judge whether it is single module build or not\r
\r
Set<String> archSet = new LinkedHashSet<String>();\r
String archString = getProject().getProperty("ARCH");\r
- if (archString != null) {\r
+ if (archString != null && archString.length() > 0) {\r
String[] fpdArchList = archString.split(" ");\r
\r
for (int i = 0; i < fpdArchList.length; i++) {\r
List moduleSupportedArchs = saq.getModuleSupportedArchs();\r
if (moduleSupportedArchs != null) {\r
for (int k = 0; k < archList.length; k++) {\r
- if ( ! moduleSupportedArchs.contains(archList[k])) {\r
- throw new BuildException("Specified architecture [" + archList[k] + "] is not supported by " + moduleId + ". The module " + moduleId + " only supports [" + moduleSupportedArchs + "] architectures.");\r
+ if (!moduleSupportedArchs.contains(archList[k])) {\r
+ EdkLog.log(this, EdkLog.EDK_WARNING, "Specified architecture [" + archList[k] + "] is not supported by " + moduleId + ". The module " + moduleId + " only supports [" + moduleSupportedArchs + "] architectures.");\r
+ archList[k] = "";\r
}\r
}\r
}\r
}\r
\r
for (int k = 0; k < archList.length; k++) {\r
+ if (archList[k] == "") {\r
+ continue;\r
+ }\r
\r
getProject().setProperty("ARCH", archList[k]);\r
\r
//\r
// Whether the module is built before\r
//\r
- if (moduleId.isLibrary() == false && GlobalData.hasFpdModuleSA(fpdModuleId) == false) {\r
- EdkLog.log(this, EdkLog.EDK_WARNING, "Warning: " + moduleId + " for " + archList[k] + " was not found in current platform FPD file!\n");\r
+ if ((moduleId.isLibrary() == false || isSingleModuleBuild) && GlobalData.hasFpdModuleSA(fpdModuleId) == false) {\r
+ if (isSingleModuleBuild) {\r
+ EdkLog.log(this, EdkLog.EDK_ERROR, "Error: " + moduleId + " for " + archList[k] + " was not found in current platform FPD file!\n");\r
+ throw new BuildException("No platform containing this module!");\r
+ } else {\r
+ EdkLog.log(this, EdkLog.EDK_WARNING, "Warning: " + moduleId + " for " + archList[k] + " was not found in current platform FPD file!\n");\r
+ }\r
continue;\r
} else if (GlobalData.isModuleBuilt(fpdModuleId)) {\r
break;\r
\r
if (type.equalsIgnoreCase("all") || type.equalsIgnoreCase("build")) {\r
applyBuild(targetList[i], toolchainList[j], fpdModuleId);\r
- } else if (type.equalsIgnoreCase("clean")) {\r
- applyClean(fpdModuleId);\r
- } else if (type.equalsIgnoreCase("cleanall")) {\r
- applyCleanall(fpdModuleId);\r
+ } else {\r
+ applyNonBuildTarget(fpdModuleId);\r
}\r
}\r
}\r
// if it is CUSTOM_BUILD\r
// then call the exist BaseName_build.xml directly.\r
//\r
- if (moduleId.getModuleType().equalsIgnoreCase("USER_DEFINED")) {\r
- EdkLog.log(this, "Call user-defined " + moduleId.getName() + "_build.xml");\r
+ String buildFilename = "";\r
+ if ((buildFilename = GetCustomizedBuildFile(fpdModuleId.getArch())) != "") {\r
+ EdkLog.log(this, "Call user-defined " + buildFilename);\r
\r
- String antFilename = getProject().getProperty("MODULE_DIR") + File.separatorChar + moduleId.getName() + "_build.xml";\r
+ String antFilename = getProject().getProperty("MODULE_DIR") + File.separatorChar + buildFilename;\r
antCall(antFilename, null);\r
\r
return ;\r
//\r
String ffsKeyword = saq.getModuleFfsKeyword();\r
ModuleBuildFileGenerator fileGenerator = new ModuleBuildFileGenerator(getProject(), ffsKeyword, fpdModuleId, includes, saq);\r
- String buildFilename = getProject().getProperty("DEST_DIR_OUTPUT") + File.separatorChar + moduleId.getName() + "_build.xml";\r
+ buildFilename = getProject().getProperty("DEST_DIR_OUTPUT") + File.separatorChar + moduleId.getName() + "_build.xml";\r
fileGenerator.genBuildFile(buildFilename);\r
\r
//\r
antCall(antFilename, null);\r
}\r
\r
+ private void applyNonBuildTarget(FpdModuleIdentification fpdModuleId){\r
+ //\r
+ // if it is CUSTOM_BUILD\r
+ // then call the exist BaseName_build.xml directly.\r
+ //\r
+ if (moduleId.getModuleType().equalsIgnoreCase("USER_DEFINED")) {\r
+ EdkLog.log(this, "Calling user-defined " + moduleId.getName() + "_build.xml");\r
+ \r
+ String antFilename = getProject().getProperty("MODULE_DIR") + File.separatorChar + moduleId.getName() + "_build.xml";\r
+ antCall(antFilename, this.type);\r
+ \r
+ return ;\r
+ }\r
+\r
+ String antFilename = getProject().getProperty("DEST_DIR_OUTPUT") + File.separatorChar + moduleId.getName() + "_build.xml";\r
+ antCall(antFilename, this.type);\r
+ }\r
+\r
private void applyClean(FpdModuleIdentification fpdModuleId){\r
//\r
// if it is CUSTOM_BUILD\r
public void setExternalProperties(Vector<Property> v) {\r
this.properties = v;\r
}\r
+\r
+ private String GetCustomizedBuildFile(String arch) {\r
+ String[][] files = saq.getSourceFiles(arch);\r
+ for (int i = 0; i < files.length; ++i) {\r
+ if (files[i][1].endsWith("build.xml")) {\r
+ return files[i][1];\r
+ }\r
+ }\r
+\r
+ return "";\r
+ }\r
}\r