git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@275 7335b...
authorhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 5 Jul 2007 08:09:07 +0000 (08:09 +0000)
committerhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 5 Jul 2007 08:09:07 +0000 (08:09 +0000)
Source/Python/ClassObjects/CommonClassObject.py
Source/Python/ClassObjects/PlatformClassObject.py
Source/Python/DataType.py
Source/Python/DscClassObject.py
Source/Python/EdkIIWorkspaceBuild.py
Source/Python/String.py

index 156be56..32f2491 100644 (file)
@@ -88,6 +88,16 @@ class SkuInfoClassObject(object):
     \r
     #Used by Default\r
     self.DefaultValue = ''\r
+    \r
+  def __str__(self):\r
+    rtn = rtn = str(self.SkuId) + "," + \\r
+          str(self.VariableName) + "," + \\r
+          str(self.VariableGuid) + "," + \\r
+          str(self.VariableOffset) + "," + \\r
+          str(self.HiiDefaultValue) + "," + \\r
+          str(self.VpdOffset) + "," + \\r
+          str(self.DefaultValue) + ","\r
+    return rtn\r
 \r
 class PcdClassObject(CommonClassObject):\r
   def __init__(self):\r
index f4558cc..01b7d3b 100644 (file)
@@ -130,12 +130,13 @@ class PlatformModuleClassObject(object):
 class PlatformClassObject(object):\r
   def __init__(self):\r
     self.Header = PlatformHeaderClassObject()\r
-    self.SkuInfoList = {}                              #[ PlatformSkuInfoClassObject ]\r
+    self.SkuInfoList = []                              #[ PlatformSkuInfoClassObject ]\r
     self.FlashDefinitionFile = None                    #PlatformFlashDefinitionFileClassObject()\r
     self.FvImages = []                                 #[ PlatformFvImagesClassObject, ...]\r
     self.Modules = []                                  #[ PlatformModuleClassObject, ...]\r
     self.BuildOptions = []                             #[ PlatformBuildOptionClassObject, ...]\r
     self.DynamicPcdBuildDefinitions = []               #[ PcdClassObject, ...] \r
+    self.Fdf = FdfClassObject()\r
     self.UserExtensions = []                           #[ UserExtensionsClassObject, ...]\r
 \r
 if __name__ == '__main__':\r
index 77f473b..fb6561d 100644 (file)
@@ -116,7 +116,13 @@ TAB_PCDS_FIXED_AT_BUILD = 'FixedAtBuild'
 TAB_PCDS_PATCHABLE_IN_MODULE = 'PatchableInModule'\r
 TAB_PCDS_FEATURE_FLAG = 'FeatureFlag'\r
 TAB_PCDS_DYNAMIC_EX = 'DynamicEx'\r
+TAB_PCDS_DYNAMIC_EX_DEFAULT = 'DynamicExDefault'\r
+TAB_PCDS_DYNAMIC_EX_VPD = 'DynamicExVpd'\r
+TAB_PCDS_DYNAMIC_EX_HII = 'DynamicExHii'\r
 TAB_PCDS_DYNAMIC = 'Dynamic'\r
+TAB_PCDS_DYNAMIC_DEFAULT = 'DynamicDefault'\r
+TAB_PCDS_DYNAMIC_VPD = 'DynamicVpd'\r
+TAB_PCDS_DYNAMIC_HII = 'DynamicHii'\r
 \r
 TAB_PCDS_FIXED_AT_BUILD_NULL = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD\r
 TAB_PCDS_FIXED_AT_BUILD_COMMON = TAB_PCDS + TAB_PCDS_FIXED_AT_BUILD + TAB_SPLIT + TAB_ARCH_COMMON\r
@@ -140,6 +146,9 @@ TAB_PCDS_FEATURE_FLAG_IPF = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_A
 TAB_PCDS_FEATURE_FLAG_EBC = TAB_PCDS + TAB_PCDS_FEATURE_FLAG + TAB_SPLIT + TAB_ARCH_EBC\r
 \r
 TAB_PCDS_DYNAMIC_EX_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_EX\r
+TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_EX_DEFAULT\r
+TAB_PCDS_DYNAMIC_EX_HII_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_EX_HII\r
+TAB_PCDS_DYNAMIC_EX_VPD_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_EX_VPD\r
 TAB_PCDS_DYNAMIC_EX_COMMON = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_COMMON\r
 TAB_PCDS_DYNAMIC_EX_IA32 = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_IA32\r
 TAB_PCDS_DYNAMIC_EX_X64 = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_X64\r
@@ -147,6 +156,9 @@ TAB_PCDS_DYNAMIC_EX_IPF = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_
 TAB_PCDS_DYNAMIC_EX_EBC = TAB_PCDS + TAB_PCDS_DYNAMIC_EX + TAB_SPLIT + TAB_ARCH_EBC\r
 \r
 TAB_PCDS_DYNAMIC_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC\r
+TAB_PCDS_DYNAMIC_DEFAULT_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_DEFAULT\r
+TAB_PCDS_DYNAMIC_HII_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_HII\r
+TAB_PCDS_DYNAMIC_VPD_NULL = TAB_PCDS + TAB_PCDS_DYNAMIC_VPD\r
 TAB_PCDS_DYNAMIC_COMMON = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_COMMON\r
 TAB_PCDS_DYNAMIC_IA32 = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_IA32\r
 TAB_PCDS_DYNAMIC_X64 = TAB_PCDS + TAB_PCDS_DYNAMIC + TAB_SPLIT + TAB_ARCH_X64\r
@@ -160,6 +172,8 @@ TAB_DEPEX_X64 = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_X64
 TAB_DEPEX_IPF = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_IPF\r
 TAB_DEPEX_EBC = TAB_DEPEX + TAB_SPLIT + TAB_ARCH_EBC\r
 \r
+TAB_SKUIDS = 'SkuIds'\r
+\r
 TAB_LIBRARIES = 'Libraries'\r
 TAB_LIBRARIES_COMMON = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_COMMON\r
 TAB_LIBRARIES_IA32 = TAB_LIBRARIES + TAB_SPLIT + TAB_ARCH_IA32\r
@@ -176,6 +190,8 @@ TAB_COMPONENTS_EBC = TAB_COMPONENTS + TAB_SPLIT + TAB_ARCH_EBC
 \r
 TAB_BUILD_OPTIONS = 'BuildOptions'\r
 \r
+TAB_DEFINE = 'DEFINE'\r
+\r
 #Common Define\r
 TAB_COMMON_DEFINES = 'Defines'\r
 \r
index e63476e..d6e305d 100644 (file)
@@ -16,6 +16,7 @@ from String import *
 from DataType import *\r
 from Identification import *\r
 from Dictionary import *\r
+from ClassObjects.PlatformClassObject import *\r
 \r
 class DscObject(object):\r
     def __init__(self):\r
@@ -44,14 +45,19 @@ class DscSkuId(DscObject):
 \r
 class DscContents(DscObject):\r
     def __init__(self):\r
+        self.SkuIds = []\r
         self.Libraries = []\r
         self.Components = []                #[['component name', [lib1, lib2, lib3], [bo1, bo2, bo3]], ...]\r
         self.LibraryClasses = []\r
         self.PcdsFixedAtBuild = []\r
         self.PcdsPatchableInModule = []\r
         self.PcdsFeatureFlag = []\r
-        self.PcdsDynamic = []\r
-        self.PcdsDynamicEx = []\r
+        self.PcdsDynamicDefault = []\r
+        self.PcdsDynamicVpd = []\r
+        self.PcdsDynamicHii = []       \r
+        self.PcdsDynamicExDefault = []\r
+        self.PcdsDynamicExVpd = []\r
+        self.PcdsDynamicExHii = []                \r
         self.BuildOptions = []\r
 \r
 class Dsc(DscObject):\r
@@ -64,9 +70,11 @@ class Dsc(DscObject):
             self.Contents[key] = DscContents()\r
         \r
         self.KeyList = [\r
-            TAB_LIBRARIES, TAB_LIBRARY_CLASSES, TAB_BUILD_OPTIONS, TAB_PCDS_FIXED_AT_BUILD_NULL, \\r
+            TAB_SKUIDS, TAB_LIBRARIES, TAB_LIBRARY_CLASSES, TAB_BUILD_OPTIONS, TAB_PCDS_FIXED_AT_BUILD_NULL, \\r
             TAB_PCDS_PATCHABLE_IN_MODULE_NULL, TAB_PCDS_FEATURE_FLAG_NULL, \\r
-            TAB_PCDS_DYNAMIC_NULL, TAB_PCDS_DYNAMIC_EX_NULL, TAB_COMPONENTS, TAB_BUILD_OPTIONS\r
+            TAB_PCDS_DYNAMIC_DEFAULT_NULL, TAB_PCDS_DYNAMIC_HII_NULL, TAB_PCDS_DYNAMIC_VPD_NULL, \\r
+            TAB_PCDS_DYNAMIC_EX_DEFAULT_NULL, TAB_PCDS_DYNAMIC_EX_HII_NULL, TAB_PCDS_DYNAMIC_EX_VPD_NULL, \\r
+            TAB_COMPONENTS, TAB_BUILD_OPTIONS\r
         ]\r
         \r
         if filename != None:\r
@@ -81,6 +89,8 @@ class Dsc(DscObject):
             GetLibraryClassesWithModuleType(Lines, Key, KeyField, TAB_COMMENT_SPLIT)\r
         elif newKey[0].find(TAB_COMPONENTS.upper()) != -1:\r
             GetComponents(Lines, Key, KeyField, TAB_COMMENT_SPLIT)\r
+        elif newKey[0].find(TAB_PCDS_DYNAMIC.upper()) != -1:\r
+            GetDynamics(Lines, Key, KeyField, TAB_COMMENT_SPLIT)\r
         else:\r
             GetMultipleValuesOfKeyFromLines(Lines, Key, KeyField, TAB_COMMENT_SPLIT)\r
     \r
index dd85c09..d4411e8 100644 (file)
@@ -24,6 +24,7 @@ from InfClassObject import *
 from DecClassObject import *\r
 from DscClassObject import *\r
 from String import *\r
+from ClassObjects.CommonClassObject import *\r
 \r
 class ModuleSourceFilesClassObject(object):\r
     def __init__(self, SourceFile = '', PcdFeatureFlag = '', TagName = '', ToolCode = '', ToolChainFamily = '', String = ''):\r
@@ -42,9 +43,23 @@ class ModuleSourceFilesClassObject(object):
               self.ToolCode + DataType.TAB_VALUE_SPLIT + \\r
               self.String\r
         return rtn\r
+\r
+class ModuleBinaryFilesClassObject(object):\r
+    def __init__(self, BinaryFile = '', FileType = '', Target = '', PcdFeatureFlag = ''):\r
+        self.BinaryFile = BinaryFile\r
+        self.FileType =FileType\r
+        self.Target = Target\r
+        self.PcdFeatureFlag = PcdFeatureFlag\r
+    \r
+    def __str__(self):\r
+        rtn = self.BinaryFile + DataType.TAB_VALUE_SPLIT + \\r
+              self.FileType + DataType.TAB_VALUE_SPLIT + \\r
+              self.Target +  DataType.TAB_VALUE_SPLIT + \\r
+              self.PcdFeatureFlag\r
+        return rtn\r
         \r
 class PcdClassObject(object):\r
-    def __init__(self, Name = None, Guid = None, Type = None, DatumType = None, Value = None, Token = None, MaxDatumSize = None):\r
+    def __init__(self, Name = None, Guid = None, Type = None, DatumType = None, Value = None, Token = None, MaxDatumSize = None, SkuInfoList = []):\r
         self.TokenCName = Name\r
         self.TokenSpaceGuidCName = Guid\r
         self.Type = Type\r
@@ -52,8 +67,7 @@ class PcdClassObject(object):
         self.DefaultValue = Value\r
         self.TokenValue = Token\r
         self.MaxDatumSize = MaxDatumSize\r
-        self.Phase = "DXE"\r
-        self.SkuInfo = []\r
+        self.SkuInfoList = SkuInfoList\r
         \r
     def __str__(self):\r
         rtn = str(self.TokenCName) + DataType.TAB_VALUE_SPLIT + \\r
@@ -62,15 +76,11 @@ class PcdClassObject(object):
               str(self.DatumType) + DataType.TAB_VALUE_SPLIT + \\r
               str(self.DefaultValue) + DataType.TAB_VALUE_SPLIT + \\r
               str(self.TokenValue) + DataType.TAB_VALUE_SPLIT + \\r
-              str(self.MaxDatumSize)\r
+              str(self.MaxDatumSize) + DataType.TAB_VALUE_SPLIT\r
+        for Item in self.SkuInfoList:\r
+            rtn = rtn + str(Item)\r
         return rtn\r
-\r
-    def __eq__(self, other):\r
-        return self.TokenCName == other.TokenCName and self.TokenSpaceGuidCName == other.TokenSpaceGuidCName\r
-\r
-    def __hash__(self):\r
-        return hash((self.TokenCName, self.TokenSpaceGuidCName))\r
-\r
+              \r
 class LibraryClassObject(object):\r
     def __init__(self, Name = None, Type = None):\r
         self.LibraryClass = Name\r
@@ -86,6 +96,7 @@ class ModuleBuildClassObject(object):
         self.Guid                    = ''\r
         self.Version                 = ''\r
         self.PcdIsDriver             = ''\r
+        self.BinaryModule            = ''\r
         self.CustomMakefile          = {}\r
         self.Specification           = {}\r
         self.LibraryClass            = None      # LibraryClassObject\r
@@ -94,7 +105,8 @@ class ModuleBuildClassObject(object):
         self.ConstructorList         = []\r
         self.DestructorList          = []\r
         \r
-        self.Sources                 = []        #[ SourcesClassObject, ... ]\r
+        self.Binaries                = []        #[ ModuleBinaryClassObject, ...]\r
+        self.Sources                 = []        #[ ModuleSourceFilesClassObject, ... ]\r
         self.LibraryClasses          = {}        #{ [LibraryClassName, ModuleType] : LibraryClassInfFile }\r
         self.Protocols               = []        #[ ProtocolName, ... ]\r
         self.Ppis                    = []        #[ PpiName, ... ]\r
@@ -143,9 +155,13 @@ class PlatformBuildClassObject(object):
         self.PlatformName            = ''\r
         self.Guid                    = ''\r
         self.Version                 = ''\r
+        self.DscSpecification        = ''\r
         self.OutputDirectory         = ''\r
         self.FlashDefinition         = ''\r
-        \r
+        self.BuildNumber             = ''\r
+        self.MakefileName            = ''\r
+                \r
+        self.SkuIds                  = {}       #{ 'SkuName' : SkuId, '!include' : includefilename, ...}\r
         self.Modules                 = []       #[ InfFileName, ... ]\r
         self.LibraryClasses          = {}       #{ (LibraryClassName, ModuleType) : LibraryClassInfFile }\r
         self.Pcds                    = {}       #{ [(PcdCName, PcdGuidCName)] : PcdClassObject }\r
@@ -174,8 +190,11 @@ class WorkspaceBuild(object):
         self.PlatformBuild           = True\r
         self.TargetTxt               = TargetTxtClassObject()\r
         self.ToolDef                 = ToolDefClassObject()\r
+\r
         self.SupArchList             = []        #[ 'IA32', 'X64', ...]\r
         self.BuildTarget             = []        #[ 'RELEASE', 'DEBUG']\r
+        self.SkuId                   = ''\r
+        \r
         self.InfDatabase             = {}        #{ [InfFileName] : InfClassObject}\r
         self.DecDatabase             = {}        #{ [DecFileName] : DecClassObject}\r
         self.DscDatabase             = {}        #{ [DscFileName] : DscClassObject}\r
@@ -202,8 +221,14 @@ class WorkspaceBuild(object):
         #parse platform to get module\r
         for dsc in self.DscDatabase.keys():\r
             dscObj = self.DscDatabase[dsc]\r
+            \r
+            #\r
+            # Get global information\r
+            #\r
             self.SupArchList = dscObj.Defines.DefinesDictionary[TAB_DSC_DEFINES_SUPPORTED_ARCHITECTURES]\r
             self.BuildTarget = dscObj.Defines.DefinesDictionary[TAB_DSC_DEFINES_BUILD_TARGETS]\r
+            self.SkuId = dscObj.Defines.DefinesDictionary[TAB_DSC_DEFINES_SKUID_IDENTIFIER][0]\r
+            \r
             #Get all inf\r
             for key in DataType.ARCH_LIST:\r
                 for index in range(len(dscObj.Contents[key].LibraryClasses)):\r
@@ -237,17 +262,44 @@ class WorkspaceBuild(object):
                 pb.PlatformName = dscObj.Defines.DefinesDictionary[DataType.TAB_DSC_DEFINES_PLATFORM_NAME][0]\r
                 pb.Guid = dscObj.Defines.DefinesDictionary[DataType.TAB_DSC_DEFINES_PLATFORM_GUID][0]\r
                 pb.Version = dscObj.Defines.DefinesDictionary[DataType.TAB_DSC_DEFINES_PLATFORM_VERSION][0]\r
+                pb.DscSpecification = dscObj.Defines.DefinesDictionary[DataType.TAB_DSC_DEFINES_DSC_SPECIFICATION][0]\r
                 pb.OutputDirectory = NormPath(dscObj.Defines.DefinesDictionary[DataType.TAB_DSC_DEFINES_OUTPUT_DIRECTORY][0])\r
                 pb.FlashDefinition = NormPath(dscObj.Defines.DefinesDictionary[DataType.TAB_DSC_DEFINES_FLASH_DEFINITION][0])\r
-            \r
+                pb.BuildNumber = dscObj.Defines.DefinesDictionary[DataType.TAB_DSC_DEFINES_BUILD_NUMBER][0]\r
+                pb.MakefileName = NormPath(dscObj.Defines.DefinesDictionary[DataType.TAB_DSC_DEFINES_MAKEFILE_NAME][0])\r
+        \r
+                #SkuId\r
+                for index in range(len(dscObj.Contents[key].SkuIds)):\r
+                    SkuInfo = dscObj.Contents[key].SkuIds[index]\r
+                    SkuName = ''\r
+                    SkuId = ''\r
+                    if SkuInfo.find('!include') > -1:\r
+                        SkuName = '!include'\r
+                        SkuId = NormPath(CleanString(SkuInfo[SkuInfo.find('!include') + len('!include'):]))\r
+                    elif len(SkuInfo.split(DataType.TAB_VALUE_SPLIT)) == 2:\r
+                        SkuName = CleanString(SkuInfo.split(DataType.TAB_VALUE_SPLIT)[1])\r
+                        SkuId = CleanString(SkuInfo.split(DataType.TAB_VALUE_SPLIT)[0])\r
+                    else:\r
+                        EdkLogger.error('Wrong defintion for SkuId')\r
+                    pb.SkuIds[SkuName] = SkuId\r
+                \r
                 #Module\r
                 for index in range(len(dscObj.Contents[key].Components)):\r
                     pb.Modules.append(NormPath(dscObj.Contents[key].Components[index][0]))\r
                 \r
                 #BuildOptions\r
                 for index in range(len(dscObj.Contents[key].BuildOptions)):\r
-                    b = desObj.Contents[key].BuildOptions[index]\r
-                    pb.BuildOptions[CleanString(b.split(DataType.TAB_EQUAL_SPLIT)[0])] = CleanString(b.split(DataType.TAB_EQUAL_SPLIT)[1])\r
+                    b = dscObj.Contents[key].BuildOptions[index].split(DataType.TAB_EQUAL_SPLIT, 1)\r
+                    Family = ''\r
+                    ToolChain = ''\r
+                    Flag = ''\r
+                    if b[0].find(':') > -1:\r
+                        Family = CleanString(b[0][ : b[0].find(':')])\r
+                        ToolChain = CleanString(b[0][b[0].find(':') + 1 : ])\r
+                    else:\r
+                        ToolChain = CleanString(b[0])\r
+                    Flag = CleanString(b[1])\r
+                    pb.BuildOptions[(Family, ToolChain)] = Flag\r
                     \r
                 #LibraryClass\r
                 for index in range(len(dscObj.Contents[key].LibraryClasses)):\r
@@ -269,15 +321,103 @@ class WorkspaceBuild(object):
                     pcd = dscObj.Contents[key].PcdsFeatureFlag[index].split(DataType.TAB_VALUE_SPLIT)\r
                     pcd.append(None)                    \r
                     pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_FEATURE_FLAG, None, pcd[2], None, pcd[3])\r
-                for index in range(len(dscObj.Contents[key].PcdsDynamic)):\r
-                    pcd = dscObj.Contents[key].PcdsDynamic[index].split(DataType.TAB_VALUE_SPLIT)\r
+                #\r
+                # PcdsDynamic\r
+                #\r
+                for index in range(len(dscObj.Contents[key].PcdsDynamicDefault)):\r
+                    pcd = dscObj.Contents[key].PcdsDynamicDefault[index][0].split(DataType.TAB_VALUE_SPLIT)\r
                     pcd.append(None)\r
-                    pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_DYNAMIC, None, pcd[2], None, pcd[3])\r
-                for index in range(len(dscObj.Contents[key].PcdsDynamicEx)):\r
-                    pcd = dscObj.Contents[key].PcdsDynamicEx[index].split(DataType.TAB_VALUE_SPLIT)\r
-                    pcd.append(None)                    \r
-                    pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_DYNAMIC_EX, None, pcd[2], None, pcd[3])\r
-                \r
+                    SkuId = dscObj.Contents[key].PcdsDynamicDefault[index][1]\r
+                    SkuInfoList = []\r
+                    if SkuId == None:\r
+                        SkuId = 'DEFAULT'\r
+                    SkuIdList = map(lambda l: l.strip(), SkuId.split(DataType.TAB_VALUE_SPLIT))\r
+                    for Item in SkuIdList:\r
+                        SkuInfo = SkuInfoClassObject()\r
+                        SkuInfo.SkuId = Item\r
+                        SkuInfo.DefaultValue = pcd[2]\r
+                        SkuInfoList.append(SkuInfo)\r
+                    pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_DYNAMIC_DEFAULT, None, None, None, pcd[3], SkuInfoList)\r
+                for index in range(len(dscObj.Contents[key].PcdsDynamicVpd)):\r
+                    pcd = dscObj.Contents[key].PcdsDynamicVpd[index][0].split(DataType.TAB_VALUE_SPLIT)\r
+                    pcd.append(None)\r
+                    SkuId = dscObj.Contents[key].PcdsDynamicVpd[index][1]\r
+                    SkuInfoList = []\r
+                    if SkuId == None:\r
+                        SkuId = 'DEFAULT'\r
+                    SkuIdList = map(lambda l: l.strip(), SkuId.split(DataType.TAB_VALUE_SPLIT))\r
+                    for Item in SkuIdList:\r
+                        SkuInfo = SkuInfoClassObject()\r
+                        SkuInfo.SkuId = Item\r
+                        SkuInfo.VpdOffset = pcd[2]\r
+                        SkuInfoList.append(SkuInfo)\r
+                    pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_DYNAMIC_VPD, None, None, None, pcd[3], SkuInfoList)\r
+                for index in range(len(dscObj.Contents[key].PcdsDynamicHii)):\r
+                    pcd = dscObj.Contents[key].PcdsDynamicHii[index][0].split(DataType.TAB_VALUE_SPLIT)\r
+                    pcd.append(None)\r
+                    SkuId = dscObj.Contents[key].PcdsDynamicHii[index][1]\r
+                    SkuInfoList = []\r
+                    if SkuId == None:\r
+                        SkuId = 'DEFAULT'\r
+                    SkuIdList = map(lambda l: l.strip(), SkuId.split(DataType.TAB_VALUE_SPLIT))\r
+                    for Item in SkuIdList:\r
+                        SkuInfo = SkuInfoClassObject()\r
+                        SkuInfo.SkuId = Item\r
+                        SkuInfo.VariableName = pcd[2]\r
+                        SkuInfo.VariableGuid = pcd[3]\r
+                        SkuInfo.VariableOffset = pcd[4]\r
+                        SkuInfo.HiiDefaultValue = pcd[5]                                                \r
+                        SkuInfoList.append(SkuInfo)\r
+                    pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_DYNAMIC_HII, None, None, None, pcd[6], SkuInfoList)\r
+                #\r
+                # PcdsDynamicEx\r
+                #\r
+                for index in range(len(dscObj.Contents[key].PcdsDynamicExDefault)):\r
+                    pcd = dscObj.Contents[key].PcdsDynamicExDefault[index][0].split(DataType.TAB_VALUE_SPLIT)\r
+                    pcd.append(None)\r
+                    SkuId = dscObj.Contents[key].PcdsDynamicExDefault[index][1]\r
+                    SkuInfoList = []\r
+                    if SkuId == None:\r
+                        SkuId = 'DEFAULT'\r
+                    SkuIdList = map(lambda l: l.strip(), SkuId.split(DataType.TAB_VALUE_SPLIT))\r
+                    for Item in SkuIdList:\r
+                        SkuInfo = SkuInfoClassObject()\r
+                        SkuInfo.SkuId = Item\r
+                        SkuInfo.DefaultValue = pcd[2]\r
+                        SkuInfoList.append(SkuInfo)\r
+                    pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_DYNAMIC_EX_DEFAULT, None, None, None, pcd[3], SkuInfoList)\r
+                for index in range(len(dscObj.Contents[key].PcdsDynamicExVpd)):\r
+                    pcd = dscObj.Contents[key].PcdsDynamicExVpd[index][0].split(DataType.TAB_VALUE_SPLIT)\r
+                    pcd.append(None)\r
+                    SkuId = dscObj.Contents[key].PcdsDynamicExVpd[index][1]\r
+                    SkuInfoList = []\r
+                    if SkuId == None:\r
+                        SkuId = 'DEFAULT'\r
+                    SkuIdList = map(lambda l: l.strip(), SkuId.split(DataType.TAB_VALUE_SPLIT))\r
+                    for Item in SkuIdList:\r
+                        SkuInfo = SkuInfoClassObject()\r
+                        SkuInfo.SkuId = Item\r
+                        SkuInfo.VpdOffset = pcd[2]\r
+                        SkuInfoList.append(SkuInfo)\r
+                    pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_DYNAMIC_EX_VPD, None, None, None, pcd[3], SkuInfoList)\r
+                for index in range(len(dscObj.Contents[key].PcdsDynamicExHii)):\r
+                    pcd = dscObj.Contents[key].PcdsDynamicExHii[index][0].split(DataType.TAB_VALUE_SPLIT)\r
+                    pcd.append(None)\r
+                    SkuId = dscObj.Contents[key].PcdsDynamicExHii[index][1]\r
+                    SkuInfoList = []\r
+                    if SkuId == None:\r
+                        SkuId = 'DEFAULT'\r
+                    SkuIdList = map(lambda l: l.strip(), SkuId.split(DataType.TAB_VALUE_SPLIT))\r
+                    for Item in SkuIdList:\r
+                        SkuInfo = SkuInfoClassObject()\r
+                        SkuInfo.SkuId = Item\r
+                        SkuInfo.VariableName = pcd[2]\r
+                        SkuInfo.VariableGuid = pcd[3]\r
+                        SkuInfo.VariableOffset = pcd[4]\r
+                        SkuInfo.HiiDefaultValue = pcd[5]                                                \r
+                        SkuInfoList.append(SkuInfo)\r
+                    pb.Pcds[(pcd[0], pcd[1])] = PcdClassObject(pcd[0], pcd[1], DataType.TAB_PCDS_DYNAMIC_EX_HII, None, None, None, pcd[6], SkuInfoList)\r
+              \r
                 self.Build[key].PlatformDatabase[dsc] = pb\r
                 pb = None    \r
             #End of Arch List Go Through    \r
@@ -361,6 +501,7 @@ class WorkspaceBuild(object):
                 pb.Version = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_VERSION_STRING][0]\r
                 pb.ModuleType = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_MODULE_TYPE][0]\r
                 pb.PcdIsDriver = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_PCD_IS_DRIVER][0]\r
+                pb.BinaryModule = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_BINARY_MODULE][0]\r
                 \r
                 for Index in range(len(infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_CUSTOM_MAKEFILE])):\r
                     Makefile = infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_CUSTOM_MAKEFILE][Index]\r
@@ -389,6 +530,16 @@ class WorkspaceBuild(object):
                 pb.ConstructorList.extend(infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_CONSTRUCTOR])\r
                 pb.DestructorList.extend(infObj.Defines.DefinesDictionary[TAB_INF_DEFINES_DESTRUCTOR])\r
 \r
+                #Binaries\r
+                for index in range(len(infObj.Contents[key].Binaries)):\r
+                    BinaryFile = infObj.Contents[key].Binaries[index].split(DataType.TAB_VALUE_SPLIT)\r
+                    BinaryFile.append('')\r
+                    FileType = BinaryFile[0].strip()\r
+                    Target = BinaryFile[1].strip()\r
+                    FileName = NormPath(BinaryFile[2].strip())\r
+                    PcdFeatureFlag = BinaryFile[3].strip()\r
+                    pb.Binaries.append(ModuleBinaryFilesClassObject(FileName, FileType, Target, PcdFeatureFlag))\r
+                    \r
                 #Sources\r
                 for index in range(len(infObj.Contents[key].Sources)):\r
                     SourceFile = infObj.Contents[key].Sources[index].split(DataType.TAB_VALUE_SPLIT)\r
@@ -427,8 +578,17 @@ class WorkspaceBuild(object):
                     \r
                 #BuildOptions\r
                 for index in range(len(infObj.Contents[key].BuildOptions)):\r
-                    b = infObj.Contents[key].BuildOptions[index]\r
-                    pb.BuildOptions[CleanString(b.split(DataType.TAB_EQUAL_SPLIT)[0])] = CleanString(b.split(DataType.TAB_EQUAL_SPLIT)[1])\r
+                    b = infObj.Contents[key].BuildOptions[index].split(DataType.TAB_EQUAL_SPLIT, 1)\r
+                    Family = ''\r
+                    ToolChain = ''\r
+                    Flag = ''\r
+                    if b[0].find(':') > -1:\r
+                        Family = CleanString(b[0][ : b[0].find(':')])\r
+                        ToolChain = CleanString(b[0][b[0].find(':') + 1 : ])\r
+                    else:\r
+                        ToolChain = CleanString(b[0])\r
+                    Flag = CleanString(b[1])\r
+                    pb.BuildOptions[(Family, ToolChain)] = Flag\r
                 self.FindBuildOptions(key, inf, pb.BuildOptions)\r
                 \r
                 #Depex\r
@@ -537,13 +697,24 @@ class WorkspaceBuild(object):
                 if NormPath(dscObj.Contents[arch].Components[index][0]) == moduleName and len(dscObj.Contents[arch].Components[index][2]) > 0:\r
                     list = dscObj.Contents[arch].Components[index][2]\r
                     for l in list:\r
-                        BuildOptions[CleanString(l.split(DataType.TAB_EQUAL_SPLIT)[0])] = CleanString(l.split(DataType.TAB_EQUAL_SPLIT)[1])\r
+                        b = l.split(DataType.TAB_EQUAL_SPLIT, 1)\r
+                        Family = ''\r
+                        ToolChain = ''\r
+                        Flag = ''\r
+                        if b[0].find(':') > -1:\r
+                            Family = CleanString(b[0][ : b[0].find(':')])\r
+                            ToolChain = CleanString(b[0][b[0].find(':') + 1 : ])\r
+                        else:\r
+                            ToolChain = CleanString(b[0])\r
+                        Flag = CleanString(b[1])\r
+                        BuildOptions[(Family, ToolChain)] = Flag\r
                         \r
     def FindPcd(self, arch, CName, GuidCName, Type):\r
         DatumType = ''\r
         DefaultValue = ''\r
         TokenValue = ''\r
         MaxDatumSize = ''\r
+        SkuInfoList = None\r
         for dsc in self.Build[arch].PlatformDatabase.keys():\r
             platform = self.Build[arch].PlatformDatabase[dsc]\r
             pcds = platform.Pcds\r
@@ -553,6 +724,7 @@ class WorkspaceBuild(object):
                 DefaultValue = pcds[(CName, GuidCName)].DefaultValue\r
                 TokenValue = pcds[(CName, GuidCName)].TokenValue\r
                 MaxDatumSize = pcds[(CName, GuidCName)].MaxDatumSize\r
+                SkuInfoList =  pcds[(CName, GuidCName)].SkuInfoList\r
                 break\r
 \r
         for dec in self.Build[arch].PackageDatabase.keys():\r
@@ -565,7 +737,7 @@ class WorkspaceBuild(object):
                 #MaxDatumSize = pcds[(CName, GuidCName)].MaxDatumSize\r
                 break\r
         \r
-        return PcdClassObject(CName, GuidCName, Type, DatumType, DefaultValue, TokenValue, MaxDatumSize)\r
+        return PcdClassObject(CName, GuidCName, Type, DatumType, DefaultValue, TokenValue, MaxDatumSize, SkuInfoList)\r
                 \r
                 \r
 # This acts like the main() function for the script, unless it is 'import'ed into another\r
@@ -581,6 +753,7 @@ if __name__ == '__main__':
 #    print ewb.DecDatabase\r
     print 'SupArchList', ewb.SupArchList\r
     print 'BuildTarget', ewb.BuildTarget\r
+    print 'SkuId', ewb.SkuId\r
     \r
     #\r
     for arch in DataType.ARCH_LIST:\r
@@ -594,6 +767,7 @@ if __name__ == '__main__':
             print 'Version = ', p.Version\r
             print 'OutputDirectory = ', p.OutputDirectory                \r
             print 'FlashDefinition = ', p.FlashDefinition\r
+            print 'SkuIds = ', p.SkuIds\r
             print 'Modules = ', p.Modules\r
             print 'LibraryClasses = ', p.LibraryClasses \r
             print 'Pcds = ', p.Pcds\r
@@ -638,6 +812,9 @@ if __name__ == '__main__':
             print 'ConstructorList = ', p.ConstructorList            \r
             print 'DestructorList = ', p.DestructorList             \r
                                                                      \r
+            print 'Binaries = '\r
+            for item in p.Binaries:\r
+                print str(item)\r
             print 'Sources = '\r
             for item in p.Sources:\r
                 print str(item)\r
index ecf3836..ac1d797 100644 (file)
@@ -150,6 +150,17 @@ def GetLibraryClassesWithModuleType(Lines, Key, KeyValues, CommentCharacter):
 \r
     return True\r
 \r
+def GetDynamics(Lines, Key, KeyValues, CommentCharacter):\r
+    newKey = SplitModuleType(Key)\r
+    Lines = Lines.split(DataType.TAB_SECTION_END, 1)[1]\r
+    LineList = Lines.splitlines()\r
+    for Line in LineList:\r
+        Line = CleanString(Line, CommentCharacter)\r
+        if Line != '' and Line[0] != CommentCharacter:\r
+            KeyValues.append([CleanString(Line, CommentCharacter), newKey[1]])\r
+\r
+    return True\r
+\r
 def SplitModuleType(Key):\r
     #from DataType import *\r
     KeyList = Key.split(DataType.TAB_SPLIT)\r