Fixed multi-target build issue.
authorjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Fri, 30 Nov 2007 08:53:20 +0000 (08:53 +0000)
committerjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Fri, 30 Nov 2007 08:53:20 +0000 (08:53 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@896 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/AutoGen/AutoGen.py
Source/Python/build/build.py

index f2e0f7c..da8dc6e 100755 (executable)
@@ -697,10 +697,9 @@ class ModuleAutoGen(object):
     @staticmethod\r
     def New(Workspace, Platform, Module, Target, Toolchain, Arch):\r
         # creating module autogen needs platform's autogen\r
-        if ModuleAutoGen._PlatformAutoGen == None:\r
-            ModuleAutoGen._PlatformAutoGen = PlatformAutoGen.New(Workspace, Platform, Target, Toolchain, None)\r
-            if ModuleAutoGen._PlatformAutoGen == None:\r
-                EdkLogger.error("AutoGen", AUTOGEN_ERROR, "Please create platform AutoGen first!")\r
+        _PlatformAutoGen = PlatformAutoGen.New(Workspace, Platform, Target, Toolchain, None)\r
+        if _PlatformAutoGen == None:\r
+            EdkLogger.error("AutoGen", AUTOGEN_ERROR, "No platform AutoGen available!")\r
 \r
         # check if the autogen for the module has been created or not\r
         Key = (Module, Target, Toolchain, Arch)\r
@@ -708,15 +707,15 @@ class ModuleAutoGen(object):
             if Arch == None or Arch == "":\r
                 return None\r
             AutoGenObject = ModuleAutoGen()\r
-            if AutoGenObject._Init(Workspace, ModuleAutoGen._PlatformAutoGen, Module, Target, Toolchain, Arch) == False:\r
+            if AutoGenObject._Init(Workspace, _PlatformAutoGen, Module, Target, Toolchain, Arch) == False:\r
                 return None\r
             ModuleAutoGen._Database[Key] = AutoGenObject\r
 \r
             # for new ModuleAutoGen object, put it in platform's AutoGen\r
             if AutoGenObject.BuildInfo.IsLibrary:\r
-                ModuleAutoGen._PlatformAutoGen.AddLibraryAutoGen(AutoGenObject, Arch)\r
+                _PlatformAutoGen.AddLibraryAutoGen(AutoGenObject, Arch)\r
             else:\r
-                ModuleAutoGen._PlatformAutoGen.AddModuleAutoGen(AutoGenObject, Arch)\r
+                _PlatformAutoGen.AddModuleAutoGen(AutoGenObject, Arch)\r
             return AutoGenObject\r
 \r
         return ModuleAutoGen._Database[Key]\r
@@ -1125,7 +1124,7 @@ class ModuleAutoGen(object):
                            (self.BuildInfo.Name, self.BuildInfo.Arch))\r
         else:\r
             EdkLogger.verbose("Skipped the generation of makefile for module %s [%s]" %\r
-                           (self.BuildInfo.Name, self.BuildInfo.Arch))\r
+                              (self.BuildInfo.Name, self.BuildInfo.Arch))\r
 \r
         self.IsMakeFileCreated = True\r
 \r
index 45e9c74..73635da 100644 (file)
@@ -321,6 +321,14 @@ class BuildTask:
     #\r
     @staticmethod\r
     def StartScheduler(MaxThreadNumber, ExitFlag):\r
+        BuildTask._PendingQueue.clear()\r
+        BuildTask._ReadyQueue.clear()\r
+        BuildTask._RunningQueue.clear()\r
+        BuildTask._TaskQueue.clear()\r
+        BuildTask._ErrorFlag.clear()\r
+        BuildTask._ErrorMessage = ""\r
+        BuildTask._Thread = None\r
+\r
         SchedulerThread = Thread(target=BuildTask.Scheduler, args=(MaxThreadNumber, ExitFlag))\r
         SchedulerThread.setName("Build-Task-Scheduler")\r
         SchedulerThread.setDaemon(False)\r