X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=Tools%2FSource%2FGenBuild%2Forg%2Ftianocore%2Fbuild%2FGenBuildTask.java;h=04ebc5c83b620d254b2601cda457808ee1fd94ef;hb=d14ebb43742f411f2a013996b8e76bcab2420552;hp=bc484a29e428c6c1f49b3114324328ce47fa1fa6;hpb=42b787576f05b9cad1a07db5d0cc4d565c7e8d13;p=mirror_edk2.git diff --git a/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java b/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java index bc484a29e4..04ebc5c83b 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java +++ b/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java @@ -16,6 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. package org.tianocore.build; import java.io.File; +import java.util.ArrayList; import java.util.Hashtable; import java.util.Iterator; import java.util.LinkedHashSet; @@ -194,14 +195,29 @@ public class GenBuildTask extends Ant { // If single module : intersection MSA supported ARCHs and tools def!! // else, get arch from pass down // - String[] archList = new String[0]; - if ( getProject().getProperty("ARCH") != null ) { - archList = getProject().getProperty("ARCH").split(" "); + Set archListSupByToolChain = new LinkedHashSet(); + String[] archs = GlobalData.getToolChainInfo().getArchs(); + + for (int i = 0; i < archs.length; i ++) { + archListSupByToolChain.add(archs[i]); + } + + Set archSet = new LinkedHashSet(); + + if ( getProject().getProperty("ARCH") != null) { + String[] fpdArchList = getProject().getProperty("ARCH").split(" "); + + for (int i = 0; i < fpdArchList.length; i++) { + if (archListSupByToolChain.contains(fpdArchList[i])) { + archSet.add(fpdArchList[i]); + } + } } else { - archList = GlobalData.getToolChainInfo().getArchs(); + archSet = archListSupByToolChain; } - + + String[] archList = archSet.toArray(new String[archSet.size()]); // // Judge if arch is all supported by current module. If not, throw Exception. @@ -216,6 +232,7 @@ public class GenBuildTask extends Ant { } for (int k = 0; k < archList.length; k++) { + getProject().setProperty("ARCH", archList[k]); FpdModuleIdentification fpdModuleId = new FpdModuleIdentification(moduleId, archList[k]); @@ -223,10 +240,12 @@ public class GenBuildTask extends Ant { // // Whether the module is built before // - if (GlobalData.isModuleBuilt(fpdModuleId)) { - return ; - } - else { + if (moduleId.isLibrary() == false && GlobalData.hasFpdModuleSA(fpdModuleId) == false) { + System.out.println("\nWARNING: " + moduleId + " for " + archList[k] + " is not found in current platform\n"); + continue; + } else if (GlobalData.isModuleBuilt(fpdModuleId)) { + return; + } else { GlobalData.registerBuiltModule(fpdModuleId); } @@ -247,7 +266,7 @@ public class GenBuildTask extends Ant { // don't do anything if no tools found // if (GlobalData.isCommandSet(targetList[i], toolchainList[j], archList[k]) == false) { - System.out.println("!!!Warning: No build issued. No tools found for [target=" + targetList[i] + " toolchain=" + toolchainList[j] + " arch=" + archList[k] + "]\n"); + System.out.println("Warning: No build issued. No tools found for [target=" + targetList[i] + " toolchain=" + toolchainList[j] + " arch=" + archList[k] + "]\n"); continue; } @@ -291,7 +310,6 @@ public class GenBuildTask extends Ant { } popProperties(); }catch (Exception e){ - e.printStackTrace(); throw new BuildException(e.getMessage()); } } @@ -432,7 +450,6 @@ public class GenBuildTask extends Ant { key[4] = "NAME"; String cmdName = GlobalData.getCommandSetting(key, fpdModuleId); File cmdFile = new File(cmdPath + File.separatorChar + cmdName); -// GlobalData.log.info("PATH: " + cmdFile.getPath()); getProject().setProperty(cmd[m], cmdFile.getPath().replaceAll("(\\\\)", "/")); // @@ -440,7 +457,6 @@ public class GenBuildTask extends Ant { // key[4] = "FLAGS"; String cmdFlags = GlobalData.getCommandSetting(key, fpdModuleId); -// GlobalData.log.info("Flags: " + cmdFlags); Set addset = new LinkedHashSet(); Set subset = new LinkedHashSet(); putFlagsToSet(addset, cmdFlags); @@ -451,7 +467,6 @@ public class GenBuildTask extends Ant { // key[4] = "EXT"; String extName = GlobalData.getCommandSetting(key, fpdModuleId); -// GlobalData.log.info("Ext: " + extName); if ( extName != null && ! extName.equalsIgnoreCase("")) { getProject().setProperty(cmd[m] + "_EXT", extName); } @@ -464,7 +479,6 @@ public class GenBuildTask extends Ant { // key[4] = "FAMILY"; String toolChainFamily = GlobalData.getCommandSetting(key, fpdModuleId); -// GlobalData.log.info("FAMILY: " + toolChainFamily); if (toolChainFamily != null) { getProject().setProperty(cmd[m] + "_FAMILY", toolChainFamily); } @@ -474,7 +488,6 @@ public class GenBuildTask extends Ant { // key[4] = "SPATH"; String spath = GlobalData.getCommandSetting(key, fpdModuleId); -// GlobalData.log.info("SPATH: " + spath); if (spath != null) { getProject().setProperty(cmd[m] + "_SPATH", spath.replaceAll("(\\\\)", "/")); } @@ -487,7 +500,6 @@ public class GenBuildTask extends Ant { // key[4] = "DPATH"; String dpath = GlobalData.getCommandSetting(key, fpdModuleId); -// GlobalData.log.info("DPATH: " + dpath); if (dpath != null) { getProject().setProperty(cmd[m] + "_DPATH", dpath.replaceAll("(\\\\)", "/")); } @@ -543,7 +555,7 @@ public class GenBuildTask extends Ant { // AutoGen // - AutoGen autogen = new AutoGen(getProject().getProperty("DEST_DIR_DEBUG"), fpdModuleId.getModule(),fpdModuleId.getArch()); + AutoGen autogen = new AutoGen(getProject().getProperty("FV_DIR"), getProject().getProperty("DEST_DIR_DEBUG"), fpdModuleId.getModule(),fpdModuleId.getArch()); autogen.genAutogen();