git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@432 7335b...
authorhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Fri, 27 Jul 2007 13:45:05 +0000 (13:45 +0000)
committerhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Fri, 27 Jul 2007 13:45:05 +0000 (13:45 +0000)
Source/Python/Common/DscClassObject.py
Source/Python/Common/EdkIIWorkspaceBuild.py

index 674a2f8..0f9e49e 100644 (file)
@@ -487,7 +487,7 @@ class Dsc(DscObject):
     \r
 if __name__ == '__main__':\r
     p = Dsc()\r
-    directory = 'C:\MyWorkspace\\EdkModulePkg'\r
+    directory = 'C:\MyWorkspace\Nt32Pkg'\r
     fileList = []\r
     for f in os.listdir(directory):\r
         if os.path.splitext(os.path.normcase(f))[1] == '.dsc':\r
index 9b32f97..e9f39c9 100644 (file)
@@ -142,6 +142,7 @@ class PlatformBuildClassObject(object):
                 \r
         self.SkuIds                  = {}       #{ 'SkuName' : SkuId, '!include' : includefilename, ...}\r
         self.Modules                 = []       #[ InfFileName, ... ]\r
+        self.Libraries               = []       #[ InfFileName, ... ]\r
         self.LibraryClasses          = {}       #{ (LibraryClassName, ModuleType) : LibraryClassInfFile }\r
         self.Pcds                    = {}       #{ [(PcdCName, PcdGuidCName)] : PcdClassObject }\r
         self.BuildOptions            = {}       #{ [BuildOptionKey] : BuildOptionValue }    \r
@@ -214,7 +215,7 @@ class WorkspaceBuild(object):
             #\r
             # Get all inf files\r
             #\r
-            for Item in Platform.Libraries.LibraryList:\r
+            for Item in Platform.LibraryClasses.LibraryList:\r
                 for Arch in Item.SupArchList:\r
                     self.AddToInfDatabase(Item.FilePath)\r
             \r
@@ -488,6 +489,26 @@ class WorkspaceBuild(object):
                 self.Build[Arch].ModuleDatabase[Inf] = pb\r
                 pb = None\r
     \r
+    #\r
+    # Update Libraries Of Platform Database\r
+    #\r
+    def UpdateLibrariesOfPlatform(self):\r
+        for Arch in self.SupArchList:\r
+            PlatformDatabase = self.Build[Arch].PlatformDatabase\r
+            for Dsc in PlatformDatabase:\r
+                Platform = PlatformDatabase[Dsc]\r
+                for Inf in Platform.Modules:\r
+                    Module = self.Build[Arch].ModuleDatabase[NormPath(Inf)]\r
+                    Stack = [NormPath(str(Module))]\r
+                    while len(Stack) > 0:\r
+                        M = self.Build[Arch].ModuleDatabase[Stack.pop()]\r
+                        if M != Module:\r
+                            Platform.Libraries.append(M)\r
+                        for Lib in M.LibraryClasses.values():\r
+                            if Lib not in Platform.Libraries and Lib != '':\r
+                                Platform.Libraries.append(NormPath(Lib))\r
+                                Stack.append(NormPath(Lib))\r
+    \r
     #\r
     # Generate build database for all arches\r
     #\r
@@ -495,7 +516,8 @@ class WorkspaceBuild(object):
         self.GenPlatformDatabase()\r
         self.GenPackageDatabase()\r
         self.GenModuleDatabase(PcdsSet)\r
-        \r
+        #self.UpdateLibrariesOfPlatform()\r
+\r
     #\r
     # Return a full path with workspace dir\r
     #\r
@@ -660,9 +682,9 @@ class WorkspaceBuild(object):
     # Show all content of the workspacebuild\r
     #\r
     def ShowWorkspaceBuild(self):\r
-        #print ewb.DscDatabase\r
-        #print ewb.InfDatabase\r
-        #print ewb.DecDatabase\r
+        print ewb.DscDatabase\r
+        print ewb.InfDatabase\r
+        print ewb.DecDatabase\r
         print 'SupArchList', ewb.SupArchList\r
         print 'BuildTarget', ewb.BuildTarget\r
         print 'SkuId', ewb.SkuId\r