From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 20CCF203369C2 for ; Fri, 29 Jun 2018 00:37:18 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jun 2018 00:37:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,285,1526367600"; d="scan'208";a="51421683" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga008.fm.intel.com with ESMTP; 29 Jun 2018 00:37:17 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 29 Jun 2018 00:37:17 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 29 Jun 2018 00:37:16 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.51]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.70]) with mapi id 14.03.0319.002; Fri, 29 Jun 2018 15:37:08 +0800 From: "Zhu, Yonghong" To: "Carsey, Jaben" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Zhu, Yonghong" Thread-Topic: [PATCH v1 1/1] BaseTools: AutoGen - clean up access Thread-Index: AQHUDl25HB0XFS7pakimF9haD0ghDaR22zfA Date: Fri, 29 Jun 2018 07:37:07 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v1 1/1] BaseTools: AutoGen - clean up access X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2018 07:37:18 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yonghong Zhu =20 Best Regards, Zhu Yonghong -----Original Message----- From: Carsey, Jaben=20 Sent: Thursday, June 28, 2018 5:28 AM To: edk2-devel@lists.01.org Cc: Gao, Liming ; Zhu, Yonghong Subject: [PATCH v1 1/1] BaseTools: AutoGen - clean up access 1) add a property so others can access needed data 2) change GenMake to use property 3) add local variable in GenMake to speed up access Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey --- BaseTools/Source/Python/AutoGen/AutoGen.py | 3 +- BaseTools/Source/Python/AutoGen/GenMake.py | 230 ++++++++++---------- 2 files changed, 118 insertions(+), 115 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/= Python/AutoGen/AutoGen.py index 381dbc0a71fa..c8009d04d7af 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -2780,7 +2780,7 @@ class ModuleAutoGen(AutoGen): self._Macro =3D OrderedDict() self._Macro["WORKSPACE" ] =3D self.WorkspaceDir self._Macro["MODULE_NAME" ] =3D self.Name - self._Macro["MODULE_NAME_GUID" ] =3D self._GetUniqueBaseN= ame() + self._Macro["MODULE_NAME_GUID" ] =3D self.UniqueBaseName self._Macro["MODULE_GUID" ] =3D self.Guid self._Macro["MODULE_VERSION" ] =3D self.Version self._Macro["MODULE_TYPE" ] =3D self.ModuleType @@ -4408,6 +4408,7 @@ class ModuleAutoGen(AutoGen): BuildCommand =3D property(_GetBuildCommand) =20 FixedAtBuildPcds =3D property(_GetFixedAtBuildPcds) + UniqueBaseName =3D property(_GetUniqueBaseName) =20 # This acts like the main() function for the script, unless it is 'import'= ed into another script. if __name__ =3D=3D '__main__': diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/= Python/AutoGen/GenMake.py index f3b23ed055fb..992de5490dff 100644 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -458,59 +458,60 @@ cleanlib: if self._FileType not in self._SEP_: EdkLogger.error("build", PARAMETER_INVALID, "Invalid Makefile = type [%s]" % self._FileType, ExtraData=3D"[%s]" % str(self._AutoGenObject)) + MyAgo =3D self._AutoGenObject Separator =3D self._SEP_[self._FileType] =20 # break build if no source files and binary files are found - if len(self._AutoGenObject.SourceFileList) =3D=3D 0 and len(self._= AutoGenObject.BinaryFileList) =3D=3D 0: + if len(MyAgo.SourceFileList) =3D=3D 0 and len(MyAgo.BinaryFileList= ) =3D=3D 0: EdkLogger.error("build", AUTOGEN_ERROR, "No files to be built = in module [%s, %s, %s]" - % (self._AutoGenObject.BuildTarget, self._Auto= GenObject.ToolChain, self._AutoGenObject.Arch), - ExtraData=3D"[%s]" % str(self._AutoGenObject)) + % (MyAgo.BuildTarget, MyAgo.ToolChain, MyAgo.A= rch), + ExtraData=3D"[%s]" % str(MyAgo)) =20 # convert dependent libraries to build command self.ProcessDependentLibrary() - if len(self._AutoGenObject.Module.ModuleEntryPointList) > 0: - ModuleEntryPoint =3D self._AutoGenObject.Module.ModuleEntryPoi= ntList[0] + if len(MyAgo.Module.ModuleEntryPointList) > 0: + ModuleEntryPoint =3D MyAgo.Module.ModuleEntryPointList[0] else: ModuleEntryPoint =3D "_ModuleEntryPoint" =20 # Intel EBC compiler enforces EfiMain - if self._AutoGenObject.AutoGenVersion < 0x00010005 and self._AutoG= enObject.Arch =3D=3D "EBC": + if MyAgo.AutoGenVersion < 0x00010005 and MyAgo.Arch =3D=3D "EBC": ArchEntryPoint =3D "EfiMain" else: ArchEntryPoint =3D ModuleEntryPoint =20 - if self._AutoGenObject.Arch =3D=3D "EBC": + if MyAgo.Arch =3D=3D "EBC": # EBC compiler always use "EfiStart" as entry point. Only appl= ies to EdkII modules ImageEntryPoint =3D "EfiStart" - elif self._AutoGenObject.AutoGenVersion < 0x00010005: + elif MyAgo.AutoGenVersion < 0x00010005: # Edk modules use entry point specified in INF file ImageEntryPoint =3D ModuleEntryPoint else: # EdkII modules always use "_ModuleEntryPoint" as entry point ImageEntryPoint =3D "_ModuleEntryPoint" =20 - for k, v in self._AutoGenObject.Module.Defines.iteritems(): - if k not in self._AutoGenObject.Macros: - self._AutoGenObject.Macros[k] =3D v + for k, v in MyAgo.Module.Defines.iteritems(): + if k not in MyAgo.Macros: + MyAgo.Macros[k] =3D v =20 - if 'MODULE_ENTRY_POINT' not in self._AutoGenObject.Macros: - self._AutoGenObject.Macros['MODULE_ENTRY_POINT'] =3D ModuleEnt= ryPoint - if 'ARCH_ENTRY_POINT' not in self._AutoGenObject.Macros: - self._AutoGenObject.Macros['ARCH_ENTRY_POINT'] =3D ArchEntryPo= int - if 'IMAGE_ENTRY_POINT' not in self._AutoGenObject.Macros: - self._AutoGenObject.Macros['IMAGE_ENTRY_POINT'] =3D ImageEntry= Point + if 'MODULE_ENTRY_POINT' not in MyAgo.Macros: + MyAgo.Macros['MODULE_ENTRY_POINT'] =3D ModuleEntryPoint + if 'ARCH_ENTRY_POINT' not in MyAgo.Macros: + MyAgo.Macros['ARCH_ENTRY_POINT'] =3D ArchEntryPoint + if 'IMAGE_ENTRY_POINT' not in MyAgo.Macros: + MyAgo.Macros['IMAGE_ENTRY_POINT'] =3D ImageEntryPoint =20 PCI_COMPRESS_Flag =3D False - for k, v in self._AutoGenObject.Module.Defines.iteritems(): + for k, v in MyAgo.Module.Defines.iteritems(): if 'PCI_COMPRESS' =3D=3D k and 'TRUE' =3D=3D v: PCI_COMPRESS_Flag =3D True =20 # tools definitions ToolsDef =3D [] - IncPrefix =3D self._INC_FLAG_[self._AutoGenObject.ToolChainFamily] - for Tool in self._AutoGenObject.BuildOption: - for Attr in self._AutoGenObject.BuildOption[Tool]: - Value =3D self._AutoGenObject.BuildOption[Tool][Attr] + IncPrefix =3D self._INC_FLAG_[MyAgo.ToolChainFamily] + for Tool in MyAgo.BuildOption: + for Attr in MyAgo.BuildOption[Tool]: + Value =3D MyAgo.BuildOption[Tool][Attr] if Attr =3D=3D "FAMILY": continue elif Attr =3D=3D "PATH": @@ -521,7 +522,7 @@ cleanlib: continue # Remove duplicated include path, if any if Attr =3D=3D "FLAGS": - Value =3D RemoveDupOption(Value, IncPrefix, self._= AutoGenObject.IncludePathList) + Value =3D RemoveDupOption(Value, IncPrefix,=20 + MyAgo.IncludePathList) if Tool =3D=3D "OPTROM" and PCI_COMPRESS_Flag: ValueList =3D Value.split() if ValueList: @@ -535,11 +536,11 @@ cleanlib: =20 # generate the Response file and Response flag RespDict =3D self.CommandExceedLimit() - RespFileList =3D os.path.join(self._AutoGenObject.OutputDir, 'resp= filelist.txt') + RespFileList =3D os.path.join(MyAgo.OutputDir,=20 + 'respfilelist.txt') if RespDict: RespFileListContent =3D '' for Resp in RespDict: - RespFile =3D os.path.join(self._AutoGenObject.OutputDir, s= tr(Resp).lower() + '.txt') + RespFile =3D os.path.join(MyAgo.OutputDir,=20 + str(Resp).lower() + '.txt') StrList =3D RespDict[Resp].split(' ') UnexpandMacro =3D [] NewStr =3D [] @@ -560,10 +561,10 @@ cleanlib: os.remove(RespFileList) =20 # convert source files and binary files to build targets - self.ResultFileList =3D [str(T.Target) for T in self._AutoGenObjec= t.CodaTargetList] - if len(self.ResultFileList) =3D=3D 0 and len(self._AutoGenObject.S= ourceFileList) !=3D 0: + self.ResultFileList =3D [str(T.Target) for T in MyAgo.CodaTargetLi= st] + if len(self.ResultFileList) =3D=3D 0 and len(MyAgo.SourceFileList)= !=3D 0: EdkLogger.error("build", AUTOGEN_ERROR, "Nothing to build", - ExtraData=3D"[%s]" % str(self._AutoGenObject)) + ExtraData=3D"[%s]" % str(MyAgo)) =20 self.ProcessBuildTargetList() self.ParserGenerateFfsCmd() @@ -582,7 +583,7 @@ cleanlib: # INC_LIST is special FileMacro =3D "" IncludePathList =3D [] - for P in self._AutoGenObject.IncludePathList: + for P in MyAgo.IncludePathList: IncludePathList.append(IncPrefix + self.PlaceMacro(P, self.Mac= ros)) if FileBuildRule.INC_LIST_MACRO in self.ListFileMacros: self.ListFileMacros[FileBuildRule.INC_LIST_MACRO].append(I= ncPrefix + P) @@ -596,7 +597,7 @@ cleanlib: =20 # Generate macros used to represent files containing list of input= files for ListFileMacro in self.ListFileMacros: - ListFileName =3D os.path.join(self._AutoGenObject.OutputDir, "= %s.lst" % ListFileMacro.lower()[:len(ListFileMacro) - 5]) + ListFileName =3D os.path.join(MyAgo.OutputDir, "%s.lst" %=20 + ListFileMacro.lower()[:len(ListFileMacro) - 5]) FileMacroList.append("%s =3D %s" % (ListFileMacro, ListFileNam= e)) SaveFileOnChange( ListFileName, @@ -605,7 +606,7 @@ cleanlib: ) =20 # Edk modules need StrDefs.h for string ID - #if self._AutoGenObject.AutoGenVersion < 0x00010005 and len(self._= AutoGenObject.UnicodeFileList) > 0: + #if MyAgo.AutoGenVersion < 0x00010005 and len(MyAgo.UnicodeFileLis= t) > 0: # BcTargetList =3D ['strdefs'] #else: # BcTargetList =3D [] @@ -617,7 +618,7 @@ cleanlib: Command =3D self._MAKE_TEMPLATE_[self._FileType] % {"file":os.= path.join(D, MakefileName)} LibraryMakeCommandList.append(Command) =20 - package_rel_dir =3D self._AutoGenObject.SourceDir + package_rel_dir =3D MyAgo.SourceDir current_dir =3D self.Macros["WORKSPACE"] found =3D False while not found and os.sep in package_rel_dir: @@ -639,29 +640,29 @@ cleanlib: "platform_version" : self.PlatformInfo.Version, "platform_relative_directory": self.PlatformInfo.SourceDir, "platform_output_directory" : self.PlatformInfo.OutputDir, - "ffs_output_directory" : self._AutoGenObject.Macros["FFS_= OUTPUT_DIR"], - "platform_dir" : self._AutoGenObject.Macros["PLAT= FORM_DIR"], + "ffs_output_directory" : MyAgo.Macros["FFS_OUTPUT_DIR"], + "platform_dir" : MyAgo.Macros["PLATFORM_DIR"], =20 - "module_name" : self._AutoGenObject.Name, - "module_guid" : self._AutoGenObject.Guid, - "module_name_guid" : self._AutoGenObject._GetUniqueBa= seName(), - "module_version" : self._AutoGenObject.Version, - "module_type" : self._AutoGenObject.ModuleType, - "module_file" : self._AutoGenObject.MetaFile.Nam= e, - "module_file_base_name" : self._AutoGenObject.MetaFile.Bas= eName, - "module_relative_directory" : self._AutoGenObject.SourceDir, - "module_dir" : mws.join (self.Macros["WORKSPACE= "], self._AutoGenObject.SourceDir), + "module_name" : MyAgo.Name, + "module_guid" : MyAgo.Guid, + "module_name_guid" : MyAgo.UniqueBaseName, + "module_version" : MyAgo.Version, + "module_type" : MyAgo.ModuleType, + "module_file" : MyAgo.MetaFile.Name, + "module_file_base_name" : MyAgo.MetaFile.BaseName, + "module_relative_directory" : MyAgo.SourceDir, + "module_dir" : mws.join (self.Macros["WORKSPACE= "], MyAgo.SourceDir), "package_relative_directory": package_rel_dir, - "module_extra_defines" : ["%s =3D %s" % (k, v) for k, v i= n self._AutoGenObject.Module.Defines.iteritems()], + "module_extra_defines" : ["%s =3D %s" % (k, v) for k, v i= n MyAgo.Module.Defines.iteritems()], =20 - "architecture" : self._AutoGenObject.Arch, - "toolchain_tag" : self._AutoGenObject.ToolChain, - "build_target" : self._AutoGenObject.BuildTarget, + "architecture" : MyAgo.Arch, + "toolchain_tag" : MyAgo.ToolChain, + "build_target" : MyAgo.BuildTarget, =20 "platform_build_directory" : self.PlatformInfo.BuildDir, - "module_build_directory" : self._AutoGenObject.BuildDir, - "module_output_directory" : self._AutoGenObject.OutputDir, - "module_debug_directory" : self._AutoGenObject.DebugDir, + "module_build_directory" : MyAgo.BuildDir, + "module_output_directory" : MyAgo.OutputDir, + "module_debug_directory" : MyAgo.DebugDir, =20 "separator" : Separator, "module_tool_definitions" : ToolsDef, @@ -1205,32 +1206,33 @@ ${BEGIN}\t-@${create_directory_command}\n${END}\ # Compose a dict object containing information used to do replacement = in template def _CreateTemplateDict(self): Separator =3D self._SEP_[self._FileType] - if self._FileType not in self._AutoGenObject.CustomMakefile: + MyAgo =3D self._AutoGenObject + if self._FileType not in MyAgo.CustomMakefile: EdkLogger.error('build', OPTION_NOT_SUPPORTED, "No custom make= file for %s" % self._FileType, - ExtraData=3D"[%s]" % str(self._AutoGenObject)) + ExtraData=3D"[%s]" % str(MyAgo)) MakefilePath =3D mws.join( - self._AutoGenObject.WorkspaceDir, - self._AutoGenObject.CustomMakefile[self._F= ileType] + MyAgo.WorkspaceDir, + MyAgo.CustomMakefile[self._FileType] ) try: CustomMakefile =3D open(MakefilePath, 'r').read() except: - EdkLogger.error('build', FILE_OPEN_FAILURE, File=3Dstr(self._A= utoGenObject), - ExtraData=3Dself._AutoGenObject.CustomMakefile= [self._FileType]) + EdkLogger.error('build', FILE_OPEN_FAILURE, File=3Dstr(MyAgo), + =20 + ExtraData=3DMyAgo.CustomMakefile[self._FileType]) =20 # tools definitions ToolsDef =3D [] - for Tool in self._AutoGenObject.BuildOption: + for Tool in MyAgo.BuildOption: # Don't generate MAKE_FLAGS in makefile. It's put in environme= nt variable. if Tool =3D=3D "MAKE": continue - for Attr in self._AutoGenObject.BuildOption[Tool]: + for Attr in MyAgo.BuildOption[Tool]: if Attr =3D=3D "FAMILY": continue elif Attr =3D=3D "PATH": - ToolsDef.append("%s =3D %s" % (Tool, self._AutoGenObje= ct.BuildOption[Tool][Attr])) + ToolsDef.append("%s =3D %s" % (Tool,=20 + MyAgo.BuildOption[Tool][Attr])) else: - ToolsDef.append("%s_%s =3D %s" % (Tool, Attr, self._Au= toGenObject.BuildOption[Tool][Attr])) + ToolsDef.append("%s_%s =3D %s" % (Tool, Attr,=20 + MyAgo.BuildOption[Tool][Attr])) ToolsDef.append("") =20 MakefileName =3D self._FILE_NAME_[self._FileType] @@ -1242,26 +124= 4,26 @@ ${BEGIN}\t-@${create_directory_command}\n${END}\ "platform_version" : self.PlatformInfo.Version, "platform_relative_directory": self.PlatformInfo.SourceDir, "platform_output_directory" : self.PlatformInfo.OutputDir, - "platform_dir" : self._AutoGenObject.Macros["PLAT= FORM_DIR"], + "platform_dir" : MyAgo.Macros["PLATFORM_DIR"], =20 - "module_name" : self._AutoGenObject.Name, - "module_guid" : self._AutoGenObject.Guid, - "module_name_guid" : self._AutoGenObject._GetUniqueBa= seName(), - "module_version" : self._AutoGenObject.Version, - "module_type" : self._AutoGenObject.ModuleType, - "module_file" : self._AutoGenObject.MetaFile, - "module_file_base_name" : self._AutoGenObject.MetaFile.Bas= eName, - "module_relative_directory" : self._AutoGenObject.SourceDir, - "module_dir" : mws.join (self._AutoGenObject.Wo= rkspaceDir, self._AutoGenObject.SourceDir), + "module_name" : MyAgo.Name, + "module_guid" : MyAgo.Guid, + "module_name_guid" : MyAgo.UniqueBaseName, + "module_version" : MyAgo.Version, + "module_type" : MyAgo.ModuleType, + "module_file" : MyAgo.MetaFile, + "module_file_base_name" : MyAgo.MetaFile.BaseName, + "module_relative_directory" : MyAgo.SourceDir, + "module_dir" : mws.join (MyAgo.WorkspaceDir, My= Ago.SourceDir), =20 - "architecture" : self._AutoGenObject.Arch, - "toolchain_tag" : self._AutoGenObject.ToolChain, - "build_target" : self._AutoGenObject.BuildTarget, + "architecture" : MyAgo.Arch, + "toolchain_tag" : MyAgo.ToolChain, + "build_target" : MyAgo.BuildTarget, =20 "platform_build_directory" : self.PlatformInfo.BuildDir, - "module_build_directory" : self._AutoGenObject.BuildDir, - "module_output_directory" : self._AutoGenObject.OutputDir, - "module_debug_directory" : self._AutoGenObject.DebugDir, + "module_build_directory" : MyAgo.BuildDir, + "module_output_directory" : MyAgo.OutputDir, + "module_debug_directory" : MyAgo.DebugDir, =20 "separator" : Separator, "module_tool_definitions" : ToolsDef, @@ -1396,10 +1398,10 @@ cleanlib: def _CreateTemplateDict(self): Separator =3D self._SEP_[self._FileType] =20 - PlatformInfo =3D self._AutoGenObject - if "MAKE" not in PlatformInfo.ToolDefinition or "PATH" not in Plat= formInfo.ToolDefinition["MAKE"]: + MyAgo =3D self._AutoGenObject + if "MAKE" not in MyAgo.ToolDefinition or "PATH" not in MyAgo.ToolD= efinition["MAKE"]: EdkLogger.error("build", OPTION_MISSING, "No MAKE command defi= ned. Please check your tools_def.txt!", - ExtraData=3D"[%s]" % str(self._AutoGenObject)) + ExtraData=3D"[%s]" % str(MyAgo)) =20 self.IntermediateDirectoryList =3D ["$(BUILD_DIR)"] self.ModuleBuildDirectoryList =3D self.GetModuleBuildDirectoryList= () @@ -1409,7 +1411,7 @@ cleanlib: LibraryMakefileList =3D [] LibraryMakeCommandList =3D [] for D in self.LibraryBuildDirectoryList: - D =3D self.PlaceMacro(D, {"BUILD_DIR":PlatformInfo.BuildDir}) + D =3D self.PlaceMacro(D, {"BUILD_DIR":MyAgo.BuildDir}) Makefile =3D os.path.join(D, MakefileName) Command =3D self._MAKE_TEMPLATE_[self._FileType] % {"file":Mak= efile} LibraryMakefileList.append(Makefile) @@ -1419,7 +1421,7 @@ cleanlib: ModuleMakefileList =3D [] ModuleMakeCommandList =3D [] for D in self.ModuleBuildDirectoryList: - D =3D self.PlaceMacro(D, {"BUILD_DIR":PlatformInfo.BuildDir}) + D =3D self.PlaceMacro(D, {"BUILD_DIR":MyAgo.BuildDir}) Makefile =3D os.path.join(D, MakefileName) Command =3D self._MAKE_TEMPLATE_[self._FileType] % {"file":Mak= efile} ModuleMakefileList.append(Makefile) @@ -1428,23 +1430,23 @@ cleanlib: MakefileTemplateDict =3D { "makefile_header" : self._FILE_HEADER_[self._FileTyp= e], "makefile_path" : os.path.join("$(BUILD_DIR)", Mak= efileName), - "make_path" : PlatformInfo.ToolDefinition["MAK= E"]["PATH"], + "make_path" : MyAgo.ToolDefinition["MAKE"]["PA= TH"], "makefile_name" : MakefileName, - "platform_name" : PlatformInfo.Name, - "platform_guid" : PlatformInfo.Guid, - "platform_version" : PlatformInfo.Version, - "platform_file" : self._AutoGenObject.MetaFile, - "platform_relative_directory": PlatformInfo.SourceDir, - "platform_output_directory" : PlatformInfo.OutputDir, - "platform_build_directory" : PlatformInfo.BuildDir, - "platform_dir" : self._AutoGenObject.Macros["PLAT= FORM_DIR"], + "platform_name" : MyAgo.Name, + "platform_guid" : MyAgo.Guid, + "platform_version" : MyAgo.Version, + "platform_file" : MyAgo.MetaFile, + "platform_relative_directory": MyAgo.SourceDir, + "platform_output_directory" : MyAgo.OutputDir, + "platform_build_directory" : MyAgo.BuildDir, + "platform_dir" : MyAgo.Macros["PLATFORM_DIR"], =20 - "toolchain_tag" : PlatformInfo.ToolChain, - "build_target" : PlatformInfo.BuildTarget, + "toolchain_tag" : MyAgo.ToolChain, + "build_target" : MyAgo.BuildTarget, "shell_command_code" : self._SHELL_CMD_[self._FileType]= .keys(), "shell_command" : self._SHELL_CMD_[self._FileType]= .values(), - "build_architecture_list" : self._AutoGenObject.Arch, - "architecture" : self._AutoGenObject.Arch, + "build_architecture_list" : MyAgo.Arch, + "architecture" : MyAgo.Arch, "separator" : Separator, "create_directory_command" : self.GetCreateDirectoryCommand(s= elf.IntermediateDirectoryList), "cleanall_command" : self.GetRemoveDirectoryCommand(s= elf.IntermediateDirectoryList), @@ -1503,20 +1505,20 @@ class TopLevelMakefile(BuildFile): Separator =3D self._SEP_[self._FileType] =20 # any platform autogen object is ok because we just need common in= formation - PlatformInfo =3D self._AutoGenObject + MyAgo =3D self._AutoGenObject =20 - if "MAKE" not in PlatformInfo.ToolDefinition or "PATH" not in Plat= formInfo.ToolDefinition["MAKE"]: + if "MAKE" not in MyAgo.ToolDefinition or "PATH" not in MyAgo.ToolD= efinition["MAKE"]: EdkLogger.error("build", OPTION_MISSING, "No MAKE command defi= ned. Please check your tools_def.txt!", - ExtraData=3D"[%s]" % str(self._AutoGenObject)) + ExtraData=3D"[%s]" % str(MyAgo)) =20 - for Arch in PlatformInfo.ArchList: + for Arch in MyAgo.ArchList: self.IntermediateDirectoryList.append(Separator.join(["$(BUILD= _DIR)", Arch])) self.IntermediateDirectoryList.append("$(FV_DIR)") =20 # TRICK: for not generating GenFds call in makefile if no FDF file MacroList =3D [] - if PlatformInfo.FdfFile is not None and PlatformInfo.FdfFile !=3D = "": - FdfFileList =3D [PlatformInfo.FdfFile] + if MyAgo.FdfFile is not None and MyAgo.FdfFile !=3D "": + FdfFileList =3D [MyAgo.FdfFile] # macros passed to GenFds MacroList.append('"%s=3D%s"' % ("EFI_SOURCE", GlobalData.gEfiS= ource.replace('\\', '\\\\'))) MacroList.append('"%s=3D%s"' % ("EDK_SOURCE", GlobalData.gEdkS= ource.replace('\\', '\\\\'))) @@ -1562,35 +1564,35 @@ class TopLevelMakefil= e(BuildFile): =20 MakefileName =3D self._FILE_NAME_[self._FileType] SubBuildCommandList =3D [] - for A in PlatformInfo.ArchList: + for A in MyAgo.ArchList: Command =3D self._MAKE_TEMPLATE_[self._FileType] % {"file":os.= path.join("$(BUILD_DIR)", A, MakefileName)} SubBuildCommandList.append(Command) =20 MakefileTemplateDict =3D { "makefile_header" : self._FILE_HEADER_[self._FileTyp= e], "makefile_path" : os.path.join("$(BUILD_DIR)", Mak= efileName), - "make_path" : PlatformInfo.ToolDefinition["MAK= E"]["PATH"], - "platform_name" : PlatformInfo.Name, - "platform_guid" : PlatformInfo.Guid, - "platform_version" : PlatformInfo.Version, - "platform_build_directory" : PlatformInfo.BuildDir, + "make_path" : MyAgo.ToolDefinition["MAKE"]["PA= TH"], + "platform_name" : MyAgo.Name, + "platform_guid" : MyAgo.Guid, + "platform_version" : MyAgo.Version, + "platform_build_directory" : MyAgo.BuildDir, "conf_directory" : GlobalData.gConfDirectory, =20 - "toolchain_tag" : PlatformInfo.ToolChain, - "build_target" : PlatformInfo.BuildTarget, + "toolchain_tag" : MyAgo.ToolChain, + "build_target" : MyAgo.BuildTarget, "shell_command_code" : self._SHELL_CMD_[self._FileType]= .keys(), "shell_command" : self._SHELL_CMD_[self._FileType]= .values(), - 'arch' : list(PlatformInfo.ArchList), - "build_architecture_list" : ','.join(PlatformInfo.ArchList), + 'arch' : list(MyAgo.ArchList), + "build_architecture_list" : ','.join(MyAgo.ArchList), "separator" : Separator, "create_directory_command" : self.GetCreateDirectoryCommand(s= elf.IntermediateDirectoryList), "cleanall_command" : self.GetRemoveDirectoryCommand(s= elf.IntermediateDirectoryList), "sub_build_command" : SubBuildCommandList, "fdf_file" : FdfFileList, - "active_platform" : str(PlatformInfo), - "fd" : PlatformInfo.FdTargetList, - "fv" : PlatformInfo.FvTargetList, - "cap" : PlatformInfo.CapTargetList, + "active_platform" : str(MyAgo), + "fd" : MyAgo.FdTargetList, + "fv" : MyAgo.FvTargetList, + "cap" : MyAgo.CapTargetList, "extra_options" : ExtraOption, "macro" : MacroList, } -- 2.16.2.windows.1