- Remove the TOOL without NAME defined and its definition in ARCH_build.opt
[mirror_edk2.git] / Tools / Python / buildgen / BuildFile.py
index 8514e4c..9a2aae3 100644 (file)
@@ -230,18 +230,19 @@ class AntPlatformBuildFile(BuildFile):
         """Generate ${ARCH}_build.opt which contains the default build&tool definitions"""\r
         tools = self.Workspace.ToolConfig.ToolCodes\r
         for arch in self.Workspace.ActiveArchs:\r
+            validTools = []\r
+            for tool in tools:\r
+                key = (self.Toolchain, self.Target, arch, tool, "NAME")\r
+                if self.Workspace.ToolConfig[key] == "": continue\r
+                validTools.append(tool)\r
+                \r
             optFileDir = os.path.join(self.Workspace.Path, self.Platform.OutputPath,\r
                                       self.Target + "_" + self.Toolchain)\r
             optFileName = arch + "_build.opt"\r
             if not os.path.exists(optFileDir): os.makedirs(optFileDir)\r
             f = open(os.path.join(optFileDir, optFileName), "w")\r
-            for tool in tools:\r
-                key = (self.Toolchain, self.Target, arch, tool, "FLAGS")\r
-                flag = self.Workspace.ToolConfig[key]\r
-                f.write("DEFAULT_%s_FLAGS=%s\n" % (tool, flag))\r
-\r
-            f.write("\n")\r
-            for tool in tools:\r
+            \r
+            for tool in validTools:\r
                 key = (self.Toolchain, self.Target, arch, tool, "FLAGS")\r
                 if key in self.Platform.BuildOptions:\r
                     flag = self.Platform.BuildOptions[key]\r
@@ -254,15 +255,22 @@ class AntPlatformBuildFile(BuildFile):
                     else:\r
                         flag = ""\r
                 f.write("PLATFORM_%s_FLAGS=%s\n" % (tool, flag))\r
+            f.write("\n")\r
+\r
+            for tool in validTools:\r
+                key = (self.Toolchain, self.Target, arch, tool, "FLAGS")\r
+                flag = self.Workspace.ToolConfig[key]\r
+                f.write("DEFAULT_%s_FLAGS=%s\n" % (tool, flag))\r
 \r
             f.write("\n")\r
-            for tool in tools:\r
+            for tool in validTools:\r
                 for attr in self.Workspace.ToolConfig.Attributes:\r
                     if attr == "FLAGS": continue\r
                     key = (self.Toolchain, self.Target, arch, tool, attr)\r
                     value = self.Workspace.ToolConfig[key]\r
                     if attr == "NAME":\r
-                        f.write("%s=%s\n" % (tool, value))\r
+                        path = self.Workspace.ToolConfig[(self.Toolchain, self.Target, arch, tool, "PATH")]\r
+                        f.write("%s=%s\n" % (tool, os.path.join(path, value)))\r
                     else:\r
                         f.write("%s_%s=%s\n" % (tool, attr, value))\r
                 f.write("%s_FLAGS=${DEFAULT_%s_FLAGS} ${DEFAULT_MODULE_%s_FLAGS} ${PLATFORM_%s_FLAGS} ${MODULE_%s_FLAGS}\n" %\r