BaseTools: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
@ -241,7 +241,7 @@ class WorkspaceAutoGen(AutoGen):
|
||||
super(WorkspaceAutoGen, self).__init__(Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs)
|
||||
self._InitWorker(Workspace, MetaFile, Target, Toolchain, Arch, *args, **kwargs)
|
||||
self._Init = True
|
||||
|
||||
|
||||
## Initialize WorkspaceAutoGen
|
||||
#
|
||||
# @param WorkspaceDir Root directory of workspace
|
||||
@ -310,7 +310,7 @@ class WorkspaceAutoGen(AutoGen):
|
||||
ExtraData="Build target [%s] is not supported by the platform. [Valid target: %s]"
|
||||
% (self.BuildTarget, " ".join(self.Platform.BuildTargets)))
|
||||
|
||||
|
||||
|
||||
# parse FDF file to get PCDs in it, if any
|
||||
if not self.FdfFile:
|
||||
self.FdfFile = self.Platform.FlashDefinition
|
||||
@ -763,7 +763,7 @@ class WorkspaceAutoGen(AutoGen):
|
||||
|
||||
## _CheckDuplicateInFV() method
|
||||
#
|
||||
# Check whether there is duplicate modules/files exist in FV section.
|
||||
# Check whether there is duplicate modules/files exist in FV section.
|
||||
# The check base on the file GUID;
|
||||
#
|
||||
def _CheckDuplicateInFV(self, Fdf):
|
||||
@ -794,7 +794,7 @@ class WorkspaceAutoGen(AutoGen):
|
||||
Module.Guid.upper()),
|
||||
ExtraData=self.FdfFile)
|
||||
#
|
||||
# Some INF files not have entity in DSC file.
|
||||
# Some INF files not have entity in DSC file.
|
||||
#
|
||||
if not InfFoundFlag:
|
||||
if FfsFile.InfFileName.find('$') == -1:
|
||||
@ -804,7 +804,7 @@ class WorkspaceAutoGen(AutoGen):
|
||||
|
||||
PathClassObj = PathClass(FfsFile.InfFileName, self.WorkspaceDir)
|
||||
#
|
||||
# Here we just need to get FILE_GUID from INF file, use 'COMMON' as ARCH attribute. and use
|
||||
# Here we just need to get FILE_GUID from INF file, use 'COMMON' as ARCH attribute. and use
|
||||
# BuildObject from one of AutoGenObjectList is enough.
|
||||
#
|
||||
InfObj = self.AutoGenObjectList[0].BuildDatabase.WorkspaceDb.BuildObject[PathClassObj, TAB_ARCH_COMMON, self.BuildTarget, self.ToolChain]
|
||||
@ -823,7 +823,7 @@ class WorkspaceAutoGen(AutoGen):
|
||||
|
||||
if FfsFile.NameGuid is not None:
|
||||
#
|
||||
# If the NameGuid reference a PCD name.
|
||||
# If the NameGuid reference a PCD name.
|
||||
# The style must match: PCD(xxxx.yyy)
|
||||
#
|
||||
if gPCDAsGuidPattern.match(FfsFile.NameGuid):
|
||||
@ -900,7 +900,7 @@ class WorkspaceAutoGen(AutoGen):
|
||||
for Pcd in Pa.Platform.Pcds:
|
||||
PcdType = Pa.Platform.Pcds[Pcd].Type
|
||||
|
||||
# If no PCD type, this PCD comes from FDF
|
||||
# If no PCD type, this PCD comes from FDF
|
||||
if not PcdType:
|
||||
continue
|
||||
|
||||
@ -992,14 +992,14 @@ class WorkspaceAutoGen(AutoGen):
|
||||
## Check the PCDs token value conflict in each DEC file.
|
||||
#
|
||||
# Will cause build break and raise error message while two PCDs conflict.
|
||||
#
|
||||
#
|
||||
# @return None
|
||||
#
|
||||
def _CheckAllPcdsTokenValueConflict(self):
|
||||
for Pa in self.AutoGenObjectList:
|
||||
for Package in Pa.PackageList:
|
||||
PcdList = Package.Pcds.values()
|
||||
PcdList.sort(lambda x, y: cmp(int(x.TokenValue, 0), int(y.TokenValue, 0)))
|
||||
PcdList.sort(lambda x, y: cmp(int(x.TokenValue, 0), int(y.TokenValue, 0)))
|
||||
Count = 0
|
||||
while (Count < len(PcdList) - 1) :
|
||||
Item = PcdList[Count]
|
||||
@ -1124,20 +1124,20 @@ class PlatformAutoGen(AutoGen):
|
||||
self._InitWorker(Workspace, MetaFile, Target, Toolchain, Arch)
|
||||
self._Init = True
|
||||
#
|
||||
# Used to store all PCDs for both PEI and DXE phase, in order to generate
|
||||
# Used to store all PCDs for both PEI and DXE phase, in order to generate
|
||||
# correct PCD database
|
||||
#
|
||||
#
|
||||
_DynaPcdList_ = []
|
||||
_NonDynaPcdList_ = []
|
||||
_PlatformPcds = {}
|
||||
|
||||
|
||||
#
|
||||
# The priority list while override build option
|
||||
# The priority list while override build option
|
||||
#
|
||||
PrioList = {"0x11111" : 16, # TARGET_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE (Highest)
|
||||
"0x01111" : 15, # ******_TOOLCHAIN_ARCH_COMMANDTYPE_ATTRIBUTE
|
||||
"0x10111" : 14, # TARGET_*********_ARCH_COMMANDTYPE_ATTRIBUTE
|
||||
"0x00111" : 13, # ******_*********_ARCH_COMMANDTYPE_ATTRIBUTE
|
||||
"0x00111" : 13, # ******_*********_ARCH_COMMANDTYPE_ATTRIBUTE
|
||||
"0x11011" : 12, # TARGET_TOOLCHAIN_****_COMMANDTYPE_ATTRIBUTE
|
||||
"0x01011" : 11, # ******_TOOLCHAIN_****_COMMANDTYPE_ATTRIBUTE
|
||||
"0x10011" : 10, # TARGET_*********_****_COMMANDTYPE_ATTRIBUTE
|
||||
@ -1289,9 +1289,9 @@ class PlatformAutoGen(AutoGen):
|
||||
#
|
||||
def CollectFixedAtBuildPcds(self):
|
||||
for LibAuto in self.LibraryAutoGenList:
|
||||
FixedAtBuildPcds = {}
|
||||
ShareFixedAtBuildPcdsSameValue = {}
|
||||
for Module in LibAuto._ReferenceModules:
|
||||
FixedAtBuildPcds = {}
|
||||
ShareFixedAtBuildPcdsSameValue = {}
|
||||
for Module in LibAuto._ReferenceModules:
|
||||
for Pcd in Module.FixedAtBuildPcds + LibAuto.FixedAtBuildPcds:
|
||||
key = ".".join((Pcd.TokenSpaceGuidCName, Pcd.TokenCName))
|
||||
if key not in FixedAtBuildPcds:
|
||||
@ -1299,7 +1299,7 @@ class PlatformAutoGen(AutoGen):
|
||||
FixedAtBuildPcds[key] = Pcd.DefaultValue
|
||||
else:
|
||||
if FixedAtBuildPcds[key] != Pcd.DefaultValue:
|
||||
ShareFixedAtBuildPcdsSameValue[key] = False
|
||||
ShareFixedAtBuildPcdsSameValue[key] = False
|
||||
for Pcd in LibAuto.FixedAtBuildPcds:
|
||||
key = ".".join((Pcd.TokenSpaceGuidCName, Pcd.TokenCName))
|
||||
if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName) not in self.NonDynamicPcdDict:
|
||||
@ -1308,7 +1308,7 @@ class PlatformAutoGen(AutoGen):
|
||||
DscPcd = self.NonDynamicPcdDict[(Pcd.TokenCName, Pcd.TokenSpaceGuidCName)]
|
||||
if DscPcd.Type != TAB_PCDS_FIXED_AT_BUILD:
|
||||
continue
|
||||
if key in ShareFixedAtBuildPcdsSameValue and ShareFixedAtBuildPcdsSameValue[key]:
|
||||
if key in ShareFixedAtBuildPcdsSameValue and ShareFixedAtBuildPcdsSameValue[key]:
|
||||
LibAuto.ConstPcd[key] = FixedAtBuildPcds[key]
|
||||
|
||||
def CollectVariables(self, DynamicPcdSet):
|
||||
@ -1405,7 +1405,7 @@ class PlatformAutoGen(AutoGen):
|
||||
for F in self.Platform.Modules.keys():
|
||||
M = ModuleAutoGen(self.Workspace, F, self.BuildTarget, self.ToolChain, self.Arch, self.MetaFile)
|
||||
#GuidValue.update(M.Guids)
|
||||
|
||||
|
||||
self.Platform.Modules[F].M = M
|
||||
|
||||
for PcdFromModule in M.ModulePcdList + M.LibraryPcdList:
|
||||
@ -1417,27 +1417,27 @@ class PlatformAutoGen(AutoGen):
|
||||
if M.IsBinaryModule == True:
|
||||
PcdFromModule.IsFromBinaryInf = True
|
||||
|
||||
# Check the PCD from DSC or not
|
||||
# Check the PCD from DSC or not
|
||||
PcdFromModule.IsFromDsc = (PcdFromModule.TokenCName, PcdFromModule.TokenSpaceGuidCName) in self.Platform.Pcds
|
||||
|
||||
if PcdFromModule.Type in PCD_DYNAMIC_TYPE_SET or PcdFromModule.Type in PCD_DYNAMIC_EX_TYPE_SET:
|
||||
if F.Path not in FdfModuleList:
|
||||
# If one of the Source built modules listed in the DSC is not listed
|
||||
# in FDF modules, and the INF lists a PCD can only use the PcdsDynamic
|
||||
# access method (it is only listed in the DEC file that declares the
|
||||
# If one of the Source built modules listed in the DSC is not listed
|
||||
# in FDF modules, and the INF lists a PCD can only use the PcdsDynamic
|
||||
# access method (it is only listed in the DEC file that declares the
|
||||
# PCD as PcdsDynamic), then build tool will report warning message
|
||||
# notify the PI that they are attempting to build a module that must
|
||||
# be included in a flash image in order to be functional. These Dynamic
|
||||
# PCD will not be added into the Database unless it is used by other
|
||||
# notify the PI that they are attempting to build a module that must
|
||||
# be included in a flash image in order to be functional. These Dynamic
|
||||
# PCD will not be added into the Database unless it is used by other
|
||||
# modules that are included in the FDF file.
|
||||
if PcdFromModule.Type in PCD_DYNAMIC_TYPE_SET and \
|
||||
PcdFromModule.IsFromBinaryInf == False:
|
||||
# Print warning message to let the developer make a determine.
|
||||
continue
|
||||
# If one of the Source built modules listed in the DSC is not listed in
|
||||
# FDF modules, and the INF lists a PCD can only use the PcdsDynamicEx
|
||||
# access method (it is only listed in the DEC file that declares the
|
||||
# PCD as PcdsDynamicEx), then DO NOT break the build; DO NOT add the
|
||||
# If one of the Source built modules listed in the DSC is not listed in
|
||||
# FDF modules, and the INF lists a PCD can only use the PcdsDynamicEx
|
||||
# access method (it is only listed in the DEC file that declares the
|
||||
# PCD as PcdsDynamicEx), then DO NOT break the build; DO NOT add the
|
||||
# PCD to the Platform's PCD Database.
|
||||
if PcdFromModule.Type in PCD_DYNAMIC_EX_TYPE_SET:
|
||||
continue
|
||||
@ -1465,14 +1465,14 @@ class PlatformAutoGen(AutoGen):
|
||||
PcdFromModule.Pending = False
|
||||
self._NonDynaPcdList_.append (PcdFromModule)
|
||||
DscModuleSet = {os.path.normpath(ModuleInf.Path) for ModuleInf in self.Platform.Modules}
|
||||
# add the PCD from modules that listed in FDF but not in DSC to Database
|
||||
# add the PCD from modules that listed in FDF but not in DSC to Database
|
||||
for InfName in FdfModuleList:
|
||||
if InfName not in DscModuleSet:
|
||||
InfClass = PathClass(InfName)
|
||||
M = self.BuildDatabase[InfClass, self.Arch, self.BuildTarget, self.ToolChain]
|
||||
# If a module INF in FDF but not in current arch's DSC module list, it must be module (either binary or source)
|
||||
# for different Arch. PCDs in source module for different Arch is already added before, so skip the source module here.
|
||||
# For binary module, if in current arch, we need to list the PCDs into database.
|
||||
# If a module INF in FDF but not in current arch's DSC module list, it must be module (either binary or source)
|
||||
# for different Arch. PCDs in source module for different Arch is already added before, so skip the source module here.
|
||||
# For binary module, if in current arch, we need to list the PCDs into database.
|
||||
if not M.IsSupportedArch:
|
||||
continue
|
||||
# Override the module PCD setting by platform setting
|
||||
@ -1497,20 +1497,20 @@ class PlatformAutoGen(AutoGen):
|
||||
self._NonDynaPcdList_.append(PcdFromModule)
|
||||
if PcdFromModule in self._DynaPcdList_ and PcdFromModule.Phase == 'PEI' and PcdFromModule.Type in PCD_DYNAMIC_EX_TYPE_SET:
|
||||
# Overwrite the phase of any the same PCD existing, if Phase is PEI.
|
||||
# It is to solve the case that a dynamic PCD used by a PEM module/PEI
|
||||
# It is to solve the case that a dynamic PCD used by a PEM module/PEI
|
||||
# module & DXE module at a same time.
|
||||
# Overwrite the type of the PCDs in source INF by the type of AsBuild
|
||||
# INF file as DynamicEx.
|
||||
# INF file as DynamicEx.
|
||||
Index = self._DynaPcdList_.index(PcdFromModule)
|
||||
self._DynaPcdList_[Index].Phase = PcdFromModule.Phase
|
||||
self._DynaPcdList_[Index].Type = PcdFromModule.Type
|
||||
for PcdFromModule in self._NonDynaPcdList_:
|
||||
# If a PCD is not listed in the DSC file, but binary INF files used by
|
||||
# this platform all (that use this PCD) list the PCD in a [PatchPcds]
|
||||
# section, AND all source INF files used by this platform the build
|
||||
# that use the PCD list the PCD in either a [Pcds] or [PatchPcds]
|
||||
# If a PCD is not listed in the DSC file, but binary INF files used by
|
||||
# this platform all (that use this PCD) list the PCD in a [PatchPcds]
|
||||
# section, AND all source INF files used by this platform the build
|
||||
# that use the PCD list the PCD in either a [Pcds] or [PatchPcds]
|
||||
# section, then the tools must NOT add the PCD to the Platform's PCD
|
||||
# Database; the build must assign the access method for this PCD as
|
||||
# Database; the build must assign the access method for this PCD as
|
||||
# PcdsPatchableInModule.
|
||||
if PcdFromModule not in self._DynaPcdList_:
|
||||
continue
|
||||
@ -1533,7 +1533,7 @@ class PlatformAutoGen(AutoGen):
|
||||
self._DynamicPcdList = self._DynaPcdList_
|
||||
#
|
||||
# Sort dynamic PCD list to:
|
||||
# 1) If PCD's datum type is VOID* and value is unicode string which starts with L, the PCD item should
|
||||
# 1) If PCD's datum type is VOID* and value is unicode string which starts with L, the PCD item should
|
||||
# try to be put header of dynamicd List
|
||||
# 2) If PCD is HII type, the PCD item should be put after unicode type PCD
|
||||
#
|
||||
@ -1554,7 +1554,7 @@ class PlatformAutoGen(AutoGen):
|
||||
if self._PlatformPcds[item].DatumType and self._PlatformPcds[item].DatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64, TAB_VOID, "BOOLEAN"]:
|
||||
self._PlatformPcds[item].DatumType = TAB_VOID
|
||||
|
||||
if (self.Workspace.ArchList[-1] == self.Arch):
|
||||
if (self.Workspace.ArchList[-1] == self.Arch):
|
||||
for Pcd in self._DynamicPcdList:
|
||||
# just pick the a value to determine whether is unicode string type
|
||||
Sku = Pcd.SkuInfoList.values()[0]
|
||||
@ -1637,7 +1637,7 @@ class PlatformAutoGen(AutoGen):
|
||||
#
|
||||
# Fix the PCDs define in VPD PCD section that never referenced by module.
|
||||
# An example is PCD for signature usage.
|
||||
#
|
||||
#
|
||||
for DscPcd in PlatformPcds:
|
||||
DscPcdEntry = self._PlatformPcds[DscPcd]
|
||||
if DscPcdEntry.Type in [TAB_PCDS_DYNAMIC_VPD, TAB_PCDS_DYNAMIC_EX_VPD]:
|
||||
@ -1659,8 +1659,8 @@ class PlatformAutoGen(AutoGen):
|
||||
defaultindex = SkuObjList.index((TAB_DEFAULT, DefaultSku))
|
||||
SkuObjList[0], SkuObjList[defaultindex] = SkuObjList[defaultindex], SkuObjList[0]
|
||||
for (SkuName, Sku) in SkuObjList:
|
||||
Sku.VpdOffset = Sku.VpdOffset.strip()
|
||||
|
||||
Sku.VpdOffset = Sku.VpdOffset.strip()
|
||||
|
||||
# Need to iterate DEC pcd information to get the value & datumtype
|
||||
for eachDec in self.PackageList:
|
||||
for DecPcd in eachDec.Pcds:
|
||||
@ -1671,8 +1671,8 @@ class PlatformAutoGen(AutoGen):
|
||||
EdkLogger.warn("build", "Unreferenced vpd pcd used!",
|
||||
File=self.MetaFile, \
|
||||
ExtraData = "PCD: %s.%s used in the DSC file %s is unreferenced." \
|
||||
%(DscPcdEntry.TokenSpaceGuidCName, DscPcdEntry.TokenCName, self.Platform.MetaFile.Path))
|
||||
|
||||
%(DscPcdEntry.TokenSpaceGuidCName, DscPcdEntry.TokenCName, self.Platform.MetaFile.Path))
|
||||
|
||||
DscPcdEntry.DatumType = DecPcdEntry.DatumType
|
||||
DscPcdEntry.DefaultValue = DecPcdEntry.DefaultValue
|
||||
DscPcdEntry.TokenValue = DecPcdEntry.TokenValue
|
||||
@ -1680,7 +1680,7 @@ class PlatformAutoGen(AutoGen):
|
||||
# Only fix the value while no value provided in DSC file.
|
||||
if not Sku.DefaultValue:
|
||||
DscPcdEntry.SkuInfoList[DscPcdEntry.SkuInfoList.keys()[0]].DefaultValue = DecPcdEntry.DefaultValue
|
||||
|
||||
|
||||
if DscPcdEntry not in self._DynamicPcdList:
|
||||
self._DynamicPcdList.append(DscPcdEntry)
|
||||
Sku.VpdOffset = Sku.VpdOffset.strip()
|
||||
@ -1711,7 +1711,7 @@ class PlatformAutoGen(AutoGen):
|
||||
VpdFile.Add(DscPcdEntry, SkuName, Sku.VpdOffset)
|
||||
SkuValueMap[PcdValue].append(Sku)
|
||||
if not NeedProcessVpdMapFile and Sku.VpdOffset == "*":
|
||||
NeedProcessVpdMapFile = True
|
||||
NeedProcessVpdMapFile = True
|
||||
if DscPcdEntry.DatumType == TAB_VOID and PcdValue.startswith("L"):
|
||||
UnicodePcdArray.add(DscPcdEntry)
|
||||
elif len(Sku.VariableName) > 0:
|
||||
@ -1723,7 +1723,7 @@ class PlatformAutoGen(AutoGen):
|
||||
VpdSkuMap[DscPcd] = SkuValueMap
|
||||
if (self.Platform.FlashDefinition is None or self.Platform.FlashDefinition == '') and \
|
||||
VpdFile.GetCount() != 0:
|
||||
EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE,
|
||||
EdkLogger.error("build", ATTRIBUTE_NOT_AVAILABLE,
|
||||
"Fail to get FLASH_DEFINITION definition in DSC file %s which is required when DSC contains VPD PCD." % str(self.Platform.MetaFile))
|
||||
|
||||
if VpdFile.GetCount() != 0:
|
||||
@ -2071,9 +2071,9 @@ class PlatformAutoGen(AutoGen):
|
||||
self._PcdTokenNumber = OrderedDict()
|
||||
TokenNumber = 1
|
||||
#
|
||||
# Make the Dynamic and DynamicEx PCD use within different TokenNumber area.
|
||||
# Make the Dynamic and DynamicEx PCD use within different TokenNumber area.
|
||||
# Such as:
|
||||
#
|
||||
#
|
||||
# Dynamic PCD:
|
||||
# TokenNumber 0 ~ 10
|
||||
# DynamicEx PCD:
|
||||
@ -2388,7 +2388,7 @@ class PlatformAutoGen(AutoGen):
|
||||
# @param Options Options to be expanded
|
||||
#
|
||||
# @retval options Options expanded
|
||||
#
|
||||
#
|
||||
def _ExpandBuildOption(self, Options, ModuleStyle=None):
|
||||
BuildOptions = {}
|
||||
FamilyMatch = False
|
||||
@ -2414,9 +2414,9 @@ class PlatformAutoGen(AutoGen):
|
||||
if OverrideList.get(Key[1]) is not None:
|
||||
OverrideList.pop(Key[1])
|
||||
OverrideList[Key[1]] = Options[Key]
|
||||
|
||||
|
||||
#
|
||||
# Use the highest priority value.
|
||||
# Use the highest priority value.
|
||||
#
|
||||
if (len(OverrideList) >= 2):
|
||||
KeyList = OverrideList.keys()
|
||||
@ -2427,7 +2427,7 @@ class PlatformAutoGen(AutoGen):
|
||||
NextKey = KeyList[Index1 + Index + 1]
|
||||
#
|
||||
# Compare two Key, if one is included by another, choose the higher priority one
|
||||
#
|
||||
#
|
||||
Target2, ToolChain2, Arch2, CommandType2, Attr2 = NextKey.split("_")
|
||||
if (Target1 == Target2 or Target1 == "*" or Target2 == "*") and\
|
||||
(ToolChain1 == ToolChain2 or ToolChain1 == "*" or ToolChain2 == "*") and\
|
||||
@ -2441,7 +2441,7 @@ class PlatformAutoGen(AutoGen):
|
||||
else:
|
||||
if Options.get((self.BuildRuleFamily, NowKey)) is not None:
|
||||
Options.pop((self.BuildRuleFamily, NowKey))
|
||||
|
||||
|
||||
for Key in Options:
|
||||
if ModuleStyle is not None and len (Key) > 2:
|
||||
# Check Module style is EDK or EDKII.
|
||||
@ -2639,7 +2639,7 @@ class ModuleAutoGen(AutoGen):
|
||||
% (MetaFile, Arch))
|
||||
return None
|
||||
return obj
|
||||
|
||||
|
||||
## Initialize ModuleAutoGen
|
||||
#
|
||||
# @param Workspace EdkIIWorkspaceBuild object
|
||||
@ -2737,13 +2737,13 @@ class ModuleAutoGen(AutoGen):
|
||||
|
||||
self.AutoGenDepSet = set()
|
||||
|
||||
|
||||
|
||||
## The Modules referenced to this Library
|
||||
# Only Library has this attribute
|
||||
self._ReferenceModules = []
|
||||
|
||||
self._ReferenceModules = []
|
||||
|
||||
## Store the FixedAtBuild Pcds
|
||||
#
|
||||
#
|
||||
self._FixedAtBuildPcds = []
|
||||
self.ConstPcd = {}
|
||||
|
||||
@ -2759,8 +2759,8 @@ class ModuleAutoGen(AutoGen):
|
||||
continue
|
||||
if Pcd not in self._FixedAtBuildPcds:
|
||||
self._FixedAtBuildPcds.append(Pcd)
|
||||
|
||||
return self._FixedAtBuildPcds
|
||||
|
||||
return self._FixedAtBuildPcds
|
||||
|
||||
def _GetUniqueBaseName(self):
|
||||
BaseName = self.Name
|
||||
@ -2959,7 +2959,7 @@ class ModuleAutoGen(AutoGen):
|
||||
continue
|
||||
PackageList.append(Package)
|
||||
return PackageList
|
||||
|
||||
|
||||
## Get the depex string
|
||||
#
|
||||
# @return : a string contain all depex expresion.
|
||||
@ -2988,7 +2988,7 @@ class ModuleAutoGen(AutoGen):
|
||||
(Arch.upper() == self.Arch.upper() and \
|
||||
ModuleType.upper() in [TAB_ARCH_COMMON, self.ModuleType.upper()]):
|
||||
DepexList.append({(Arch, ModuleType): DepexExpr})
|
||||
|
||||
|
||||
#the type of build module is USER_DEFINED.
|
||||
if self.ModuleType.upper() == SUP_MODULE_USER_DEFINED:
|
||||
for Depex in DepexList:
|
||||
@ -2999,7 +2999,7 @@ class ModuleAutoGen(AutoGen):
|
||||
if not DepexStr:
|
||||
return '[Depex.%s]\n' % self.Arch
|
||||
return DepexStr
|
||||
|
||||
|
||||
#the type of build module not is USER_DEFINED.
|
||||
Count = 0
|
||||
for Depex in DepexList:
|
||||
@ -3019,7 +3019,7 @@ class ModuleAutoGen(AutoGen):
|
||||
if not DepexStr:
|
||||
return '[Depex.%s]\n' % self.Arch
|
||||
return '[Depex.%s]\n# ' % self.Arch + DepexStr
|
||||
|
||||
|
||||
## Merge dependency expression
|
||||
#
|
||||
# @retval list The token list of the dependency expression after parsed
|
||||
@ -3155,14 +3155,14 @@ class ModuleAutoGen(AutoGen):
|
||||
#
|
||||
self._BuildOptionIncPathList = []
|
||||
return self._BuildOptionIncPathList
|
||||
|
||||
|
||||
BuildOptionIncPathList = []
|
||||
for Tool in ('CC', 'PP', 'VFRPP', 'ASLPP', 'ASLCC', 'APP', 'ASM'):
|
||||
try:
|
||||
FlagOption = self.BuildOption[Tool]['FLAGS']
|
||||
except KeyError:
|
||||
FlagOption = ''
|
||||
|
||||
|
||||
if self.PlatformInfo.ToolChainFamily != 'RVCT':
|
||||
IncPathList = [NormPath(Path, self.Macros) for Path in BuildOptIncludeRegEx.findall(FlagOption)]
|
||||
else:
|
||||
@ -3175,7 +3175,7 @@ class ModuleAutoGen(AutoGen):
|
||||
IncPathList.extend(NormPath(PathEntry, self.Macros) for PathEntry in PathList)
|
||||
|
||||
#
|
||||
# EDK II modules must not reference header files outside of the packages they depend on or
|
||||
# EDK II modules must not reference header files outside of the packages they depend on or
|
||||
# within the module's directory tree. Report error if violation.
|
||||
#
|
||||
if self.AutoGenVersion >= 0x00010005:
|
||||
@ -3187,13 +3187,13 @@ class ModuleAutoGen(AutoGen):
|
||||
ExtraData=ErrMsg,
|
||||
File=str(self.MetaFile))
|
||||
|
||||
|
||||
|
||||
BuildOptionIncPathList += IncPathList
|
||||
|
||||
|
||||
self._BuildOptionIncPathList = BuildOptionIncPathList
|
||||
|
||||
|
||||
return self._BuildOptionIncPathList
|
||||
|
||||
|
||||
## Return a list of files which can be built from source
|
||||
#
|
||||
# What kind of files can be built is determined by build rules in
|
||||
@ -3247,7 +3247,7 @@ class ModuleAutoGen(AutoGen):
|
||||
Order_Dict[F].sort(key=lambda i: self.BuildRuleOrder.index(i))
|
||||
for Ext in Order_Dict[F][1:]:
|
||||
RemoveList.append(F + Ext)
|
||||
|
||||
|
||||
for item in RemoveList:
|
||||
FileList.remove(item)
|
||||
|
||||
@ -3690,12 +3690,12 @@ class ModuleAutoGen(AutoGen):
|
||||
for SourceFile in self.Module.Sources:
|
||||
if SourceFile.Type.upper() == ".VFR" :
|
||||
#
|
||||
# search the .map file to find the offset of vfr binary in the PE32+/TE file.
|
||||
# search the .map file to find the offset of vfr binary in the PE32+/TE file.
|
||||
#
|
||||
VfrUniBaseName[SourceFile.BaseName] = (SourceFile.BaseName + "Bin")
|
||||
elif SourceFile.Type.upper() == ".UNI" :
|
||||
#
|
||||
# search the .map file to find the offset of Uni strings binary in the PE32+/TE file.
|
||||
# search the .map file to find the offset of Uni strings binary in the PE32+/TE file.
|
||||
#
|
||||
VfrUniBaseName["UniOffsetName"] = (self.Name + "Strings")
|
||||
|
||||
@ -3727,7 +3727,7 @@ class ModuleAutoGen(AutoGen):
|
||||
#
|
||||
UniGuid = [0xe0, 0xc5, 0x13, 0x89, 0xf6, 0x33, 0x86, 0x4d, 0x9b, 0xf1, 0x43, 0xef, 0x89, 0xfc, 0x6, 0x66]
|
||||
UniGuid = [chr(ItemGuid) for ItemGuid in UniGuid]
|
||||
fStringIO.write(''.join(UniGuid))
|
||||
fStringIO.write(''.join(UniGuid))
|
||||
UniValue = pack ('Q', int (Item[1], 16))
|
||||
fStringIO.write (UniValue)
|
||||
else:
|
||||
@ -3738,13 +3738,13 @@ class ModuleAutoGen(AutoGen):
|
||||
#
|
||||
VfrGuid = [0xb4, 0x7c, 0xbc, 0xd0, 0x47, 0x6a, 0x5f, 0x49, 0xaa, 0x11, 0x71, 0x7, 0x46, 0xda, 0x6, 0xa2]
|
||||
VfrGuid = [chr(ItemGuid) for ItemGuid in VfrGuid]
|
||||
fStringIO.write(''.join(VfrGuid))
|
||||
fStringIO.write(''.join(VfrGuid))
|
||||
VfrValue = pack ('Q', int (Item[1], 16))
|
||||
fStringIO.write (VfrValue)
|
||||
#
|
||||
# write data into file.
|
||||
#
|
||||
try :
|
||||
try :
|
||||
fInputfile.write (fStringIO.getvalue())
|
||||
except:
|
||||
EdkLogger.error("build", FILE_WRITE_FAILURE, "Write data to file %s failed, please check whether the "
|
||||
@ -3764,15 +3764,15 @@ class ModuleAutoGen(AutoGen):
|
||||
|
||||
if self.IsAsBuiltInfCreated:
|
||||
return
|
||||
|
||||
|
||||
# Skip the following code for EDK I inf
|
||||
if self.AutoGenVersion < 0x00010005:
|
||||
return
|
||||
|
||||
|
||||
# Skip the following code for libraries
|
||||
if self.IsLibrary:
|
||||
return
|
||||
|
||||
|
||||
# Skip the following code for modules with no source files
|
||||
if not self.SourceFileList:
|
||||
return
|
||||
@ -3780,7 +3780,7 @@ class ModuleAutoGen(AutoGen):
|
||||
# Skip the following code for modules without any binary files
|
||||
if self.BinaryFileList:
|
||||
return
|
||||
|
||||
|
||||
### TODO: How to handles mixed source and binary modules
|
||||
|
||||
# Find all DynamicEx and PatchableInModule PCDs used by this module and dependent libraries
|
||||
@ -4054,7 +4054,7 @@ class ModuleAutoGen(AutoGen):
|
||||
UsageIndex = Index
|
||||
break
|
||||
if UsageIndex != -1:
|
||||
PcdCommentList[UsageIndex] = '## %s %s %s' % (UsageStr, HiiInfo, PcdCommentList[UsageIndex].replace(UsageStr, ''))
|
||||
PcdCommentList[UsageIndex] = '## %s %s %s' % (UsageStr, HiiInfo, PcdCommentList[UsageIndex].replace(UsageStr, ''))
|
||||
else:
|
||||
PcdCommentList.append('## UNDEFINED ' + HiiInfo)
|
||||
PcdComments = '\n '.join(PcdCommentList)
|
||||
@ -4069,7 +4069,7 @@ class ModuleAutoGen(AutoGen):
|
||||
# Generated LibraryClasses section in comments.
|
||||
for Library in self.LibraryAutoGenList:
|
||||
AsBuiltInfDict['libraryclasses_item'].append(Library.MetaFile.File.replace('\\', '/'))
|
||||
|
||||
|
||||
# Generated UserExtensions TianoCore section.
|
||||
# All tianocore user extensions are copied.
|
||||
UserExtStr = ''
|
||||
@ -4083,12 +4083,12 @@ class ModuleAutoGen(AutoGen):
|
||||
# Generated depex expression section in comments.
|
||||
DepexExpresion = self._GetDepexExpresionString()
|
||||
AsBuiltInfDict['depexsection_item'] = DepexExpresion if DepexExpresion else ''
|
||||
|
||||
|
||||
AsBuiltInf = TemplateString()
|
||||
AsBuiltInf.Append(gAsBuiltInfHeaderString.Replace(AsBuiltInfDict))
|
||||
|
||||
|
||||
SaveFileOnChange(os.path.join(self.OutputDir, self.Name + '.inf'), str(AsBuiltInf), False)
|
||||
|
||||
|
||||
self.IsAsBuiltInfCreated = True
|
||||
if GlobalData.gBinCacheDest:
|
||||
self.CopyModuleToCache()
|
||||
@ -4408,7 +4408,7 @@ class ModuleAutoGen(AutoGen):
|
||||
BuildOption = property(_GetModuleBuildOption)
|
||||
BuildOptionIncPathList = property(_GetBuildOptionIncPathList)
|
||||
BuildCommand = property(_GetBuildCommand)
|
||||
|
||||
|
||||
FixedAtBuildPcds = property(_GetFixedAtBuildPcds)
|
||||
UniqueBaseName = property(_GetUniqueBaseName)
|
||||
|
||||
|
Reference in New Issue
Block a user