Added code to check that the definitions in target.txt are valid against tools_def.txt
authorjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 6 Nov 2006 03:09:32 +0000 (03:09 +0000)
committerjwang36 <jwang36@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 6 Nov 2006 03:09:32 +0000 (03:09 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1898 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Java/Source/GenBuild/org/tianocore/build/global/GlobalData.java
Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainConfig.java

index 437858a..b79e505 100644 (file)
@@ -682,7 +682,7 @@ public class GlobalData {
     ///\r
     /// Tool Chain Related, try to refine and put some logic process to ToolChainFactory\r
     ///\r
-    public synchronized static ToolChainInfo getToolChainInfo() {\r
+    public synchronized static ToolChainInfo getToolChainInfo() throws EdkException {\r
         if (toolChainInfo == null) {\r
             toolChainInfo = toolsDef.getConfigInfo().intersection(toolChainEnvInfo);\r
             if (toolChainPlatformInfo != null) {\r
@@ -690,6 +690,23 @@ public class GlobalData {
             }\r
             toolChainInfo.addCommands(toolsDef.getConfigInfo().getCommands());\r
             toolChainInfo.normalize();\r
+\r
+            if (toolChainInfo.getTargets().length == 0) {\r
+                throw new EdkException("No valid target specified! Please check your TARGET definition in Tools/Conf/target.txt.");\r
+            }\r
+\r
+            if (toolChainInfo.getTagnames().length == 0) {\r
+                throw new EdkException("No valid tool chain specified! Please check your TOOL_CHAIN_TAG definition in Tools/Conf/target.txt.");\r
+            }\r
+\r
+            if (toolChainInfo.getArchs().length == 0) {\r
+                throw new EdkException("No valid ARCH specified! Please check your TARGET_ARCH definition in Tools/Conf/target.txt.");\r
+            }\r
+\r
+            if (toolChainInfo.getCommands().length == 0) {\r
+                throw new EdkException("No valid COMMAND specified! Please check your TARGET definition in Tools/Conf/tools_def.txt.");\r
+            }\r
+\r
             EdkLog.log("Init", EdkLog.EDK_ALWAYS, "Current build tool chain information summary: ");\r
             EdkLog.log("Init", EdkLog.EDK_ALWAYS, toolChainInfo + "");\r
         }\r
@@ -724,7 +741,7 @@ public class GlobalData {
         msaFamilyBuildOption.put(moduleId, toolChainOption);\r
     }\r
     \r
-    public static boolean isCommandSet(String target, String toolchain, String arch) {\r
+    public static boolean isCommandSet(String target, String toolchain, String arch) throws EdkException {\r
         String[] commands = getToolChainInfo().getCommands();\r
 \r
         for (int i = 0; i < commands.length; ++i) {\r
index b12c436..f78d49f 100644 (file)
@@ -83,6 +83,7 @@ public class ToolChainConfig {
             info.addTagnames(keySet[ToolChainElement.TOOLCHAIN.value]);\r
             info.addArchs(keySet[ToolChainElement.ARCH.value]);\r
             info.addCommands(keySet[ToolChainElement.TOOLCODE.value]);\r
+            info.normalize();\r
         }\r
     }\r
 \r