## @file
# This file is used to define each component of the build database
#
# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
##
# Import Modules
#
import EdkLogger
import DataType
from InfClassObject import *
from DecClassObject import *
from DscClassObject import *
from String import *
from BuildToolError import *
## PcdClassObject
#
# This Class is used for PcdObject
#
# @param object: Inherited from object class
# @param Name: Input value for Name of Pcd, default is None
# @param Guid: Input value for Guid of Pcd, default is None
# @param Type: Input value for Type of Pcd, default is None
# @param DatumType: Input value for DatumType of Pcd, default is None
# @param Value: Input value for Value of Pcd, default is None
# @param Token: Input value for Token of Pcd, default is None
# @param MaxDatumSize: Input value for MaxDatumSize of Pcd, default is None
# @param SkuInfoList: Input value for SkuInfoList of Pcd, default is {}
# @param IsOverrided: Input value for IsOverrided of Pcd, default is False
#
# @var TokenCName: To store value for TokenCName
# @var TokenSpaceGuidCName: To store value for TokenSpaceGuidCName
# @var Type: To store value for Type
# @var DatumType: To store value for DatumType
# @var TokenValue: To store value for TokenValue
# @var MaxDatumSize: To store value for MaxDatumSize
# @var SkuInfoList: To store value for SkuInfoList
# @var IsOverrided: To store value for IsOverrided
# @var Phase: To store value for Phase, default is "DXE"
#
def __init__(self, Name = None, Guid = None, Type = None, DatumType = None, Value = None, Token = None, MaxDatumSize = None, SkuInfoList = {}, IsOverrided = False):
## Convert the class to a string
#
# Convert each member of the class to string
# Organize to a signle line format string
#
# @retval Rtn Formatted String
#
return Rtn
## Override __eq__ function
#
# Check whether pcds are the same
#
# @retval False The two pcds are different
# @retval True The two pcds are the same
#
return Other != None and self.TokenCName == Other.TokenCName and self.TokenSpaceGuidCName == Other.TokenSpaceGuidCName
## Override __hash__ function
#
# Use (TokenCName, TokenSpaceGuidCName) as key in hash table
#
# @retval truple() Key for hash table
#
## LibraryClassObject
#
# This Class defines LibraryClassObject used in BuildDatabase
#
# @param object: Inherited from object class
# @param Name: Input value for LibraryClassName, default is None
# @param SupModList: Input value for SupModList, default is []
# @param Type: Input value for Type, default is None
#
# @var LibraryClass: To store value for LibraryClass
# @var SupModList: To store value for SupModList
# @var Type: To store value for Type
#
if Type != None:
## ModuleBuildClassObject
#
# This Class defines ModuleBuildClass
#
# @param object: Inherited from object class
#
# @var DescFilePath: To store value for DescFilePath
# @var BaseName: To store value for BaseName
# @var ModuleType: To store value for ModuleType
# @var Guid: To store value for Guid
# @var Version: To store value for Version
# @var PcdIsDriver: To store value for PcdIsDriver
# @var BinaryModule: To store value for BinaryModule
# @var CustomMakefile: To store value for CustomMakefile
# @var Specification: To store value for Specification
# @var Shadow To store value for Shadow
# @var LibraryClass: To store value for LibraryClass, it is a list structure as
# [ LibraryClassObject, ...]
# @var ModuleEntryPointList: To store value for ModuleEntryPointList
# @var ModuleUnloadImageList: To store value for ModuleUnloadImageList
# @var ConstructorList: To store value for ConstructorList
# @var DestructorList: To store value for DestructorList
# @var Binaries: To store value for Binaries, it is a list structure as
# [ ModuleBinaryClassObject, ...]
# @var Sources: To store value for Sources, it is a list structure as
# [ ModuleSourceFilesClassObject, ... ]
# @var LibraryClasses: To store value for LibraryClasses, it is a set structure as
# { [LibraryClassName, ModuleType] : LibraryClassInfFile }
# @var Protocols: To store value for Protocols, it is a list structure as
# [ ProtocolName, ... ]
# @var Ppis: To store value for Ppis, it is a list structure as
# [ PpiName, ... ]
# @var Guids: To store value for Guids, it is a list structure as
# [ GuidName, ... ]
# @var Includes: To store value for Includes, it is a list structure as
# [ IncludePath, ... ]
# @var Packages: To store value for Packages, it is a list structure as
# [ DecFileName, ... ]
# @var Pcds: To store value for Pcds, it is a set structure as
# { [(PcdCName, PcdGuidCName)] : PcdClassObject}
# @var BuildOptions: To store value for BuildOptions, it is a set structure as
# { [BuildOptionKey] : BuildOptionValue}
# @var Depex: To store value for Depex
#
self.CustomMakefile = {}
self.Specification = {}
self.LibraryClass = []
self.ModuleEntryPointList = []
self.ConstructorList = []
self.DestructorList = []
self.BuildOptions = {}
## Convert the class to a string
#
# Convert member DescFilePath of the class to a string
#
# @retval string Formatted String
#
return self.DescFilePath
## Override __eq__ function
#
# Check whether ModuleBuildClassObjects are the same
#
# @retval False The two ModuleBuildClassObjects are different
# @retval True The two ModuleBuildClassObjects are the same
#
## Override __hash__ function
#
# Use DescFilePath as key in hash table
#
# @retval string Key for hash table
#
## PackageBuildClassObject
#
# This Class defines PackageBuildClass
#
# @param object: Inherited from object class
#
# @var DescFilePath: To store value for DescFilePath
# @var PackageName: To store value for PackageName
# @var Guid: To store value for Guid
# @var Version: To store value for Version
# @var Protocols: To store value for Protocols, it is a set structure as
# { [ProtocolName] : Protocol Guid, ... }
# @var Ppis: To store value for Ppis, it is a set structure as
# { [PpiName] : Ppi Guid, ... }
# @var Guids: To store value for Guids, it is a set structure as
# { [GuidName] : Guid, ... }
# @var Includes: To store value for Includes, it is a list structure as
# [ IncludePath, ... ]
# @var LibraryClasses: To store value for LibraryClasses, it is a set structure as
# { [LibraryClassName] : LibraryClassInfFile }
# @var Pcds: To store value for Pcds, it is a set structure as
# { [(PcdCName, PcdGuidCName)] : PcdClassObject}
#
self.LibraryClasses = {}
## Convert the class to a string
#
# Convert member DescFilePath of the class to a string
#
# @retval string Formatted String
#
return self.DescFilePath
## Override __eq__ function
#
# Check whether PackageBuildClassObjects are the same
#
# @retval False The two PackageBuildClassObjects are different
# @retval True The two PackageBuildClassObjects are the same
#
## Override __hash__ function
#
# Use DescFilePath as key in hash table
#
# @retval string Key for hash table
#
## PlatformBuildClassObject
#
# This Class defines PlatformBuildClass
#
# @param object: Inherited from object class
#
# @var DescFilePath: To store value for DescFilePath
# @var PlatformName: To store value for PlatformName
# @var Guid: To store value for Guid
# @var Version: To store value for Version
# @var DscSpecification: To store value for DscSpecification
# @var OutputDirectory: To store value for OutputDirectory
# @var FlashDefinition: To store value for FlashDefinition
# @var BuildNumber: To store value for BuildNumber
# @var MakefileName: To store value for MakefileName
# @var SkuIds: To store value for SkuIds, it is a set structure as
# { 'SkuName' : SkuId, '!include' : includefilename, ...}
# @var Modules: To store value for Modules, it is a list structure as
# [ InfFileName, ... ]
# @var Libraries: To store value for Libraries, it is a list structure as
# [ InfFileName, ... ]
# @var LibraryClasses: To store value for LibraryClasses, it is a set structure as
# { (LibraryClassName, ModuleType) : LibraryClassInfFile }
# @var Pcds: To store value for Pcds, it is a set structure as
# { [(PcdCName, PcdGuidCName)] : PcdClassObject }
# @var BuildOptions: To store value for BuildOptions, it is a set structure as
# { [BuildOptionKey] : BuildOptionValue }
#
self.LibraryInstances = []
self.LibraryClasses = {}
self.BuildOptions = {}
## Convert the class to a string
#
# Convert member DescFilePath of the class to a string
#
# @retval string Formatted String
#
return self.DescFilePath
## Override __eq__ function
#
# Check whether PlatformBuildClassObjects are the same
#
# @retval False The two PlatformBuildClassObjects are different
# @retval True The two PlatformBuildClassObjects are the same
#
## Override __hash__ function
#
# Use DescFilePath as key in hash table
#
# @retval string Key for hash table
#
## ItemBuild
#
#
# @param object: Inherited from object class
# @param Arch: Build arch
# @param Platform: Build Platform
# @param Package: Build Package
# @param Module: Build Module
#
# @var Arch: To store value for Build Arch
# @var PlatformDatabase: To store value for PlatformDatabase, it is a set structure as
# { [DscFileName] : PlatformBuildClassObject, ...}
# @var PackageDatabase: To store value for PackageDatabase, it is a set structure as
# { [DecFileName] : PacakgeBuildClassObject, ...}
# @var ModuleDatabase: To store value for ModuleDatabase, it is a list structure as
# { [InfFileName] : ModuleBuildClassObject, ...}
#
self.PlatformDatabase = {}
self.PackageDatabase = {}
self.ModuleDatabase = {}
## WorkspaceBuild
#
#
# @param object: Inherited from object class
# @param ActivePlatform: Input value for current active platform
# @param WorkspaceDir: Input value for current WorkspaceDir
#
# @var WorkspaceDir: To store value for WorkspaceDir
# @var SupArchList: To store value for SupArchList, selection scope is in below list
# EBC | IA32 | X64 | IPF | ARM | PPC
# @var BuildTarget: To store value for WorkspaceDir, selection scope is in below list
# RELEASE | DEBUG
# @var SkuId: To store value for SkuId
# @var Fdf: To store value for Fdf
# @var FdTargetList: To store value for FdTargetList
# @var FvTargetList: To store value for FvTargetList
# @var TargetTxt: To store value for TargetTxt, it is a set structure as
# TargetTxtClassObject
# @var ToolDef: To store value for ToolDef, it is a set structure as
# ToolDefClassObject
# @var InfDatabase: To store value for InfDatabase, it is a set structure as
# { [InfFileName] : InfClassObject}
# @var DecDatabase: To store value for DecDatabase, it is a set structure as
# { [DecFileName] : DecClassObject}
# @var DscDatabase: To store value for DscDatabase, it is a set structure as
# { [DscFileName] : DscClassObject}
# @var Build: To store value for DscDatabase, it is a set structure as
# ItemBuild
# @var DscFileName: To store value for Active Platform
# @var UnFoundPcdInDsc: To store values for the pcds defined in INF/DEC but not found in DSC, it is a set structure as
# { (PcdGuid, PcdCName, Arch) : DecFileName }
#
self.SupArchList = []
self.BuildTarget = []
self.FdTargetList = []
self.FvTargetList = []
self.InfDatabase = {}
self.DecDatabase = {}
self.DscDatabase = {}
self.UnFoundPcdInDsc = {}
#
# Init build for all arches
#
#
# Init build database
#
#
# Get active platform
#
else:
#
# Parse platform to get module
#
#
# Get global information
#
#
# Get all inf files
#
#
# Add modules
#
#
# Add library used in modules
#
#
# Parse module to get package
#
#
# Get all dec
#
# End of self.Init()
## Generate PlatformDatabase
#
# Go through each arch to get all items in DscDatabase to PlatformDatabase
#
#
# Defines
#
EdkLogger.error("AutoGen", PARSER_ERROR, "The BaseName of platform %s is not defined for arch %s" % (Dsc, Arch))
#
# SkuId
#
#
# Module
#
#
# BuildOptions
#
#
# LibraryClass
#
SupModuleList = self.FindSupModuleListOfLibraryClass(Item, Platform.LibraryClasses.LibraryList, Arch)
for ModuleType in SupModuleList:
#
# Libraries
#
continue
#
# Pcds
#
Pb.Pcds[(Name, Guid)] = PcdClassObject(Name, Guid, Type, DatumType, Value, Token, MaxDatumSize, SkuInfoList, False)
Pb.Pcds[(Name, Guid)] = PcdClassObject(Name, Guid, Type, DatumType, Value, Token, MaxDatumSize, SkuInfoList, False)
break
else:
# nothing found
continue
# found in one package, find next PCD
break
else:
EdkLogger.error("AutoGen", PARSER_ERROR, "PCD is not found in any package", ExtraData="%s.%s" % (Guid, Name))
#
# Add to database
#
Pb = None
## Generate PackageDatabase
#
# Go through each arch to get all items in DecDatabase to PackageDatabase
#
#
# Defines
#
EdkLogger.error("AutoGen", PARSER_ERROR, "The BaseName of package %s is not defined for arch %s" % (Dec, Arch))
#
# Protocols
#
#
# Ppis
#
#
# Guids
#
#
# Includes
#
#
# LibraryClasses
#
#
# Pcds
#
Pb.Pcds[(Name, Guid, Type)] = PcdClassObject(Name, Guid, Type, DatumType, Value, Token, MaxDatumSize, SkuInfoList, False)
#
# Add to database
#
Pb = None
## Generate ModuleDatabase
#
# Go through each arch to get all items in InfDatabase to ModuleDatabase
#
continue
#
# Defines
#
EdkLogger.error("AutoGen", PARSER_ERROR, "The BaseName of module %s is not defined for arch %s" % (Inf, Arch))
#
# Specs os Defines
#
Pb.Specification[TAB_INF_DEFINES_UEFI_SPECIFICATION_VERSION] = ModuleHeader.UefiSpecificationVersion
#
# LibraryClass of Defines
#
#
# Module image and library of Defines
#
#
# Binaries
#
#
# Sources
#
Pb.Sources.append(ModuleSourceFileClass(SourceFile, TagName, ToolCode, ToolChainFamily, FeatureFlag))
#
# Protocols
#
#
# Ppis
#
#
# Guids
#
#
# Includes
#
#
# Packages
#
#
# BuildOptions
#
else:
#
# Depex
#
#
# LibraryClasses
#
if Pb.LibraryClass != []:
#
# For Library
#
if Instance == None:
else:
#
# For Module
#
if Instance == None:
#
# Libraries
#
#
# Pcds
#
#
# Add to database
#
Pb = None
## Update Libraries Of Platform Database
#
# @param InfList: A list for all inf files
#
for Dsc in PlatformDatabase:
continue
## Update Libraries Of Module Database
#
# @param Module: The module need to be updated libraries
# @param Arch: The supportted arch of the module
#
# check Edk module
# "CompilerStub" is a must for Edk modules
M = LibraryConsumerList.pop()
for LibraryName in M.Libraries:
continue
return
# EdkII module
Constructor = []
ConsumedByList = sdict()
LibraryInstance = sdict()
M = LibraryConsumerList.pop()
# The "Key" is in format of (library_class_name, supported_module_type)
EdkLogger.debug(EdkLogger.DEBUG_3, "%s for module type %s is not supported (%s)" % (Key + (LibraryPath,)))
continue
LibraryInstance[LibraryClassName] = None
continue
continue
else:
if LibraryModule not in ConsumedByList:
ConsumedByList[LibraryModule] = []
if M != Module:
if M in ConsumedByList[LibraryModule]:
continue
#
# Initialize the sorted output list to the empty set
#
SortedLibraryList = []
#
# Q <- Set of all nodes with no incoming edges
#
LibraryList = [] #LibraryInstance.values()
Q = []
for LibraryClassName in LibraryInstance:
if M == None:
"Library instance for library class [%s] is not found" % LibraryClassName,
#
# check if there're duplicate library classes
#
for Lc in M.LibraryClass:
"More than one library instance found for library class [%s] in module [%s]" % (Lc.LibraryClass, Module),
)
if ConsumedByList[M] == []:
Q.insert(0, M)
#
# while Q is not empty do
#
while Q != []:
#
# remove node from Q
#
#
# output Node
#
#
# for each node Item with an edge e from Node to Item do
#
for Item in LibraryList:
continue
#
# remove edge e from the graph
#
#
# If Item has no other incoming edges then
#
if ConsumedByList[Item] == []:
#
# insert Item into Q
#
while Q == [] and EdgeRemoved:
#
# for each node Item with a Constructor
#
for Item in LibraryList:
if Item in Constructor:
#
# for each Node without a constructor with an edge e from Item to Node
#
if Node not in Constructor:
#
# remove edge e from the graph
#
if ConsumedByList[Item] == []:
#
# insert Item into Q
#
break
if Q != []:
break
#
# if any remaining node Item in the graph has a constructor and an incoming edge, then the graph has a cycle
#
for Item in LibraryList:
if Item not in SortedLibraryList:
#
# Build the list of constructor and destructir names
# The DAG Topo sort produces the destructor order, so the list of constructors must generated in the reverse order
#
for L in SortedLibraryList:
for Lc in L.LibraryClass:
#
# Merge PCDs from library instance
#
Module.Pcds[Key] = self.FindPcd(Arch, str(Module), LibPcd.TokenCName, LibPcd.TokenSpaceGuidCName, LibPcd.Type)
#
# Merge GUIDs from library instance
#
#
# Merge Protocols from library instance
#
#
# Merge Ppis from library instance
#
## GenBuildDatabase
#
# Generate build database for all arches
#
# @param PcdsSet: Pcd list for override from Fdf parse result
# @param InfList: Inf list for override from Fdf parse result
#
#
# Add additional inf file defined in Fdf file
#
#
# Generate PlatformDatabase, PackageDatabase and ModuleDatabase
#
#
# Update Libraries Of Platform
#
#
# Output used Pcds not found in DSC file
#
## ShowUnFoundPcds()
#
# If there is any pcd used but not defined in DSC
# Print warning message on screen and output a list of pcds
#
if self.UnFoundPcdInDsc != {}:
WrnMessage = '**** WARNING ****\n'
WrnMessage += 'The default values were obtained from the DEC file that declares the PCD and the PCD default value\n'
WrnMessage += '%s.%s: Defined in file %s, PcdItemType is Pcds%s, DefaultValue is %s\n' % (Guid, Name, Dec, PcdItemTypeUsed, DefaultValue)
## Create a full path with workspace dir
#
# Convert Filename with workspace dir to create a full path
#
# @param Filename: The filename need to be added workspace dir
#
# @retval string Full path
#
## Update LibraryClass of Module
#
# If a module of a platform has its own override libraryclass but the libraryclass not defined in the module
# Add this libraryclass to the module
#
# @param InfFileName: InfFileName specificed in platform
# @param LibraryClass: LibraryClass specificed in platform
# @param Arch: Supportted Arch
# @param InstanceFilePath: InstanceFilePath specificed in platform
#
#
# Update the library instance itself to add this libraryclass name
#
#
# Find this LibraryClass
#
break;
if NotFound:
#
# Add it to LibraryClasses Section for the module which is using the library
#
#
# Find this LibraryClass
#
return
else:
return
if NotFound:
Lib = LibraryClassClass()
## Add Inf file to InfDatabase
#
# Create a Inf instance for input inf file and add it to InfDatabase
#
# @param InfFileName: The InfFileName need to be added to database
#
self.InfDatabase[InfFileName] = Inf(File, False, True, self.WorkspaceDir, self.Db, self.SupArchList)
else:
## Add Dec file to DecDatabase
#
# Create a Dec instance for input dec file and add it to DecDatabase
#
# @param DecFileName: The DecFileName need to be added to database
#
self.DecDatabase[DecFileName] = Dec(File, False, True, self.WorkspaceDir, self.Db, self.SupArchList)
else:
## Search LibraryClass Instance for Module
#
# Search PlatformBuildDatabase to find LibraryClass Instance for Module
# Return the instance if found
#
# @param Lib: Input value for Library Class Name
# @param Arch: Supportted Arch
# @param ModuleType: Supportted ModuleType
# @param ModuleName: Input value for Module Name
#
# @retval string Found LibraryClass Instance file path
#
#
# First find if exist in <LibraryClass> of <Components> from dsc file
#
return LibraryClass.FilePath
#
#Second find if exist in <LibraryClass> of <LibraryClasses> from dsc file
#
## Search LibraryClass Instance for Library
#
# Search PlatformBuildDatabase to find LibraryClass Instance for Library
# Return the instance if found
#
# @param Lib: Input value for Library Class Name
# @param Arch: Supportted Arch
# @param Type: Supportted Library Usage Type
#
# @retval string Found LibraryClass Instance file path
# @retval None Not Found
#
return None
## Find BuildOptions
#
# Search DscDatabase to find component definition of ModuleName
# Override BuildOption if it is defined in component
#
# @param Arch: Supportted Arch
# @param ModuleName: The module which has buildoption definition in component of platform
# @param BuildOptions: The set of all buildopitons
#
#
# First find if exist in <BuildOptions> of <Components> from dsc file
# if find, use that override the one defined in inf file
#
#
# Add to BuildOptions
#
## Find Pcd
#
# Search platform database, package database, module database and PcdsSet from Fdf
# Return found Pcd
#
# @param Arch: Supportted Arch
# @param ModuleName: The module which has pcd definition in component of platform
# @param Name: Name of Pcd
# @param Guid: Guid of Pcd
# @param Type: Type of Pcd
#
# @retval PcdClassObject An instance for PcdClassObject with all members filled
#
NewType = ''
DatumType = ''
Value = ''
Token = ''
MaxDatumSize = ''
SkuInfoList = {}
FoundInDecFile = ''
#
# Second get information from platform database
#
OwnerPlatform = ''
else:
ErrorMsg = "PCD %s.%s is declared as [%s] in module\n\t%s\n\n"\
" But it's used as [%s] in platform\n\t%s"\
break
#
# Third get information from <Pcd> of <Compontents> from module database
#
break
#
# First get information from package database
#
Pcd = None
if NewType == '':
if Type != '':
PcdTypeList = [Type]
else:
for PcdType in PcdTypeList:
break
else:
continue
break
else:
break
if not IsFoundInDec:
ErrorMsg = "Pcd '%s.%s [%s]' defined in module '%s' is not found in any package for Arch '%s'" % (Guid, Name, NewType, ModuleName, Arch)
#
# Not found in any platform and fdf
#
if not IsFoundInDsc:
SkuInfoList['DEFAULT'] = SkuInfoClass(SkuIdName='DEFAULT', SkuId=SkuIds['DEFAULT'], DefaultValue=Value)
#elif Type != '' and NewType.startswith("Dynamic"):
# NewType = Pcd.Type
if Token in [None, '']:
EdkLogger.verbose("No MaxDatumSize specified for PCD %s.%s in module [%s]" % (Guid, Name, ModuleName))
else:
return PcdClassObject(Name, Guid, NewType, DatumType, Value, Token, MaxDatumSize, SkuInfoList, IsOverrided)
## Find Supportted Module List Of LibraryClass
#
# Search in InfDatabase, find the supmodulelist of the libraryclass
#
# @param LibraryClass: LibraryClass name for search
# @param OverridedLibraryClassList: A list of all LibraryClass
# @param Arch: Supportted Arch
#
# @retval list SupModuleList
#
#
# If the SupModuleList means all, remove overrided module types of platform
#
for Item in OverridedLibraryClassList:
#
# Find a library class (Item) with the same name
#
#
# Do nothing if it is itself
#
continue
#
# If not itself, check arch first
#
#
# If arch is supportted, remove all related module type
#
if ModuleType in SupModuleList:
return SupModuleList
## Find Module inf Platform
#
# Check if the module is defined in <Compentent> of <Platform>
#
# @param Inf: Inf file (Module) need to be searched
# @param Arch: Supportted Arch
# @param InfList: A list for all Inf file
#
# @retval True Mudule Found
# @retval Flase Module Not Found
#
return True
return True
return True
return True
return False
## Show all content of the workspacebuild
#
# Print each item of the workspacebuild with (Key = Value) pair
#
print self.DscDatabase
print self.InfDatabase
print self.DecDatabase
print Arch
print 'Platform'
print 'DescFilePath = ', P.DescFilePath
print 'PlatformName = ', P.PlatformName
print 'Guid = ', P.Guid
print 'Version = ', P.Version
print 'OutputDirectory = ', P.OutputDirectory
print 'FlashDefinition = ', P.FlashDefinition
print 'SkuIds = ', P.SkuIds
print 'Modules = ', P.Modules
print 'LibraryClasses = ', P.LibraryClasses
print 'Pcds = ', P.Pcds
print 'BuildOptions = ', P.BuildOptions
print ''
# End of Platform
print 'package'
print 'DescFilePath = ', P.DescFilePath
print 'PackageName = ', P.PackageName
print 'Guid = ', P.Guid
print 'Version = ', P.Version
print 'Protocols = ', P.Protocols
print 'Ppis = ', P.Ppis
print 'Guids = ', P.Guids
print 'Includes = ', P.Includes
print 'LibraryClasses = ', P.LibraryClasses
print 'Pcds = ', P.Pcds
print ''
# End of Package
print 'module'
print 'DescFilePath = ', P.DescFilePath
print 'BaseName = ', P.BaseName
print 'ModuleType = ', P.ModuleType
print 'Guid = ', P.Guid
print 'Version = ', P.Version
print 'CustomMakefile = ', P.CustomMakefile
print 'Specification = ', P.Specification
print 'Shadow = ', P.Shadow
print 'PcdIsDriver = ', P.PcdIsDriver
for Lib in P.LibraryClass:
print 'ModuleEntryPointList = ', P.ModuleEntryPointList
print 'ModuleUnloadImageList = ', P.ModuleUnloadImageList
print 'ConstructorList = ', P.ConstructorList
print 'DestructorList = ', P.DestructorList
print 'Binaries = '
print 'Sources = '
print item.SourceFile
print 'LibraryClasses = ', P.LibraryClasses
print 'Protocols = ', P.Protocols
print 'Ppis = ', P.Ppis
print 'Guids = ', P.Guids
print 'Includes = ', P.Includes
print 'Packages = ', P.Packages
print 'Pcds = ', P.Pcds
print 'BuildOptions = ', P.BuildOptions
print 'Depex = ', P.Depex
print ''
# End of Module
##
#
# This acts like the main() function for the script, unless it is 'import'ed into another
# script.
#
if __name__ == '__main__':
Ewb.GenBuildDatabase({('PcdDevicePathSupportDevicePathFromText', 'gEfiMdeModulePkgTokenSpaceGuid') : 'KKKKKKKKKKKKKKKKKKKKK'}, ['Test.Inf'])