From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web12.6279.1580824235485431617 for ; Tue, 04 Feb 2020 05:50:35 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: liming.gao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Feb 2020 05:50:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,402,1574150400"; d="scan'208";a="378420521" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga004.jf.intel.com with ESMTP; 04 Feb 2020 05:50:22 -0800 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 4 Feb 2020 05:50:19 -0800 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by SHSMSX601.ccr.corp.intel.com (10.109.6.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 4 Feb 2020 21:50:18 +0800 Received: from shsmsx606.ccr.corp.intel.com ([10.109.6.216]) by SHSMSX606.ccr.corp.intel.com ([10.109.6.216]) with mapi id 15.01.1713.004; Tue, 4 Feb 2020 21:50:18 +0800 From: "Liming Gao" To: "devel@edk2.groups.io" , "pierre.gondois@arm.com" CC: "Feng, Bob C" , Sami Mujawar , nd Subject: Re: [edk2-devel] [PATCH v2 1/1] BaseTools: Rationalise makefile generation Thread-Topic: [edk2-devel] [PATCH v2 1/1] BaseTools: Rationalise makefile generation Thread-Index: AQHV21LZFCxLN11+8Eimoj6t5Q0vy6gK7xJwgAAc7nA= Date: Tue, 4 Feb 2020 13:50:18 +0000 Message-ID: References: <15F0315032D95F8E.2867@groups.io> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action x-originating-ip: [10.239.127.36] MIME-Version: 1.0 Return-Path: liming.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Pierre: I think below three configurations are common. With this patch, they can= work fine, right? And, do you mean Windows - GCC - GNUmake is still blo= cked by the change "0c3e8e9947a6c13b4327dd11b20acb95441701cf BaseTools: Enh= ance Basetool for incremental build"? > Windows - GCC - GNUmake > Windows - VS2017 - nmake > Linux - GCC5 - GNUmake Thanks Liming > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of PierreGon= dois > Sent: Tuesday, February 4, 2020 8:03 PM > To: devel@edk2.groups.io; Pierre Gondois > Cc: Feng, Bob C ; Gao, Liming ; Sami Mujawar ; nd > > Subject: Re: [edk2-devel] [PATCH v2 1/1] BaseTools: Rationalise makefile= generation >=20 > Hello Liming and Bob, > To answer Liming's questions, I am building the DynamicTablesPkg with th= e patch with the AARCH64-DEBUG and the following > configurations: > Windows - GCC - GNUmake > Windows - GCC - nmake > Windows - VS2017 - GNUmake > Windows - VS2017 - nmake > Linux - GCC5 - GNUmake > For the record, when building with the Windows-VS2017-GNUmake configurat= ion, the *_*_*_MAKE_FLAG(S) variable is set to "/nologo". > As this is a nmake specific flag, it has to be removed when using GNUmak= e. Some warning flags also need to be slightly modified when > building with VS2017. > To modify the type of make tool to use (GNUmake or nmake), I modify the = following variable in Conf/tools_def.txt: > *_[GCC5|VS2017]_*_MAKE_PATH =3D [nmake|GNUmake] >=20 > I am building the ShellPkg with the patch and a small modification on ho= w nasm files are added for IA32 and X64 for the following > configurations: > Windows - VS2017 - GNUmake > Windows - VS2017 - nmake > Linux - GCC - GNUmake >=20 > Unfortunately, the gcc compiler available on windows doesn't provide all= the options of the one available on linux. For instances: > * When building ShellPkg-DEBUG build-X64 -Windows-GCC-[nmake], the "-mc= model=3Dsmall" option provided is not supported. > * When building ShellPkg-DEBUG build-IA32-Windows-GCC-[nmake], the "-m,= elf_i386" option provided is not supported. > These issues are related to the compiler and not to the patch. >=20 > The Windows-GCC-GNUmake configuration is very important for Arm. This co= nfiguration was working fine until patch > "0c3e8e9947a6c13b4327dd11b20acb95441701cf BaseTools: Enhance Basetool fo= r incremental build" was merged in edk2. >=20 > Regards, > Pierre >=20 > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of PierreGon= dois via Groups.Io > Sent: 04 February 2020 12:01 > To: devel@edk2.groups.io > Cc: Pierre Gondois ; bob.c.feng@intel.com; limin= g.gao@intel.com; Sami Mujawar > ; Pierre Gondois ; nd > Subject: [edk2-devel] [PATCH v2 1/1] BaseTools: Rationalise makefile gen= eration >=20 > From: Pierre Gondois >=20 > The GenMake.py script tests the platform environment to determine the ty= pe of makefile that needs to be generated. If a Windows build > host is detected, the makefile generated is of Nmake type. Otherwise a G= NUmake type is generated. >=20 > Furthermore, the ___MAKE_PATH > option in tools_def.template defines the make tool to use. > E.g.: for VS2017 this is configured to use Nmake, cf. > *_VS2017_*_MAKE_PATH =3D DEF(VS2017_BIN_HOST)\nmake.exe while for GCC5 i= t is setup to use GNU make. > *_GCC5_*_MAKE_PATH =3D DEF(GCC_HOST_PREFIX)make >=20 > This prevents using the GCC compiler toolchain on a Windows build host. >=20 > To address this issue this patch introduces 2 factors to determine the g= enerated makefile output. > 1. Platform -> to determine shell commands used > in makefile. > 2. MakeTool -> to determine the type of makefile > that needs to be generated. >=20 > Signed-off-by: Pierre Gondois > Signed-off-by: Sami Mujawar > --- >=20 > The changes can be seen at https://github.com/PierreARM/edk2/tree/720_Ba= seTools_Rationalise_makefile_generation_v2 >=20 > Notes: > v2: > - Rebase on latest master [Pierre] >=20 > BaseTools/Source/Python/AutoGen/GenMake.py | 122 ++++++++++----= ------ > BaseTools/Source/Python/AutoGen/IncludesAutoGen.py | 34 +++--- > BaseTools/Source/Python/build/build.py | 7 +- > 3 files changed, 88 insertions(+), 75 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Sour= ce/Python/AutoGen/GenMake.py > index ba199c1aa73dc46856b41c13e07e3d9770081acd..f49c765c791d57c06fcccf70= 59b37a018dc68ae6 100755 > --- a/BaseTools/Source/Python/AutoGen/GenMake.py > +++ b/BaseTools/Source/Python/AutoGen/GenMake.py > @@ -2,6 +2,7 @@ > # Create makefile for MS nmake and GNU make # # Copyright (c) 2007 - = 2020, Intel Corporation. All rights reserved.
> +# Copyright (c) 2020, ARM Limited. All rights reserved.
> # SPDX-License-Identifier: BSD-2-Clause-Patent # >=20 > @@ -52,13 +53,6 @@ gIncludeMacroConversion =3D { > "EFI_PPI_DEPENDENCY" : gPpiDefinition, > } >=20 > -## default makefile type > -gMakeType =3D "" > -if sys.platform =3D=3D "win32": > - gMakeType =3D "nmake" > -else: > - gMakeType =3D "gmake" > - >=20 > ## BuildFile class > # > @@ -77,6 +71,13 @@ class BuildFile(object): > "gmake" : "GNUmakefile" > } >=20 > + # Get Makefile name. > + def getMakefileName(self): > + if not self._FileType: > + return _DEFAULT_FILE_NAME_ > + else: > + return self._FILE_NAME_[self._FileType] > + > ## Fixed header string for makefile > _MAKEFILE_HEADER =3D '''# > # DO NOT EDIT > @@ -106,7 +107,7 @@ class BuildFile(object): > # $(RD) remove dir command > # > _SHELL_CMD_ =3D { > - "nmake" : { > + "win32" : { > "CP" : "copy /y", > "MV" : "move /y", > "RM" : "del /f /q", > @@ -114,7 +115,7 @@ class BuildFile(object): > "RD" : "rmdir /s /q", > }, >=20 > - "gmake" : { > + "posix" : { > "CP" : "cp -f", > "MV" : "mv -f", > "RM" : "rm -f", > @@ -125,35 +126,35 @@ class BuildFile(object): >=20 > ## directory separator > _SEP_ =3D { > - "nmake" : "\\", > - "gmake" : "/" > + "win32" : "\\", > + "posix" : "/" > } >=20 > ## directory creation template > _MD_TEMPLATE_ =3D { > - "nmake" : 'if not exist %(dir)s $(MD) %(dir)s', > - "gmake" : "$(MD) %(dir)s" > + "win32" : 'if not exist %(dir)s $(MD) %(dir)s', > + "posix" : "$(MD) %(dir)s" > } >=20 > ## directory removal template > _RD_TEMPLATE_ =3D { > - "nmake" : 'if exist %(dir)s $(RD) %(dir)s', > - "gmake" : "$(RD) %(dir)s" > + "win32" : 'if exist %(dir)s $(RD) %(dir)s', > + "posix" : "$(RD) %(dir)s" > } > ## cp if exist > _CP_TEMPLATE_ =3D { > - "nmake" : 'if exist %(Src)s $(CP) %(Src)s %(Dst)s', > - "gmake" : "test -f %(Src)s && $(CP) %(Src)s %(Dst)s" > + "win32" : 'if exist %(Src)s $(CP) %(Src)s %(Dst)s', > + "posix" : "test -f %(Src)s && $(CP) %(Src)s %(Dst)s" > } >=20 > _CD_TEMPLATE_ =3D { > - "nmake" : 'if exist %(dir)s cd %(dir)s', > - "gmake" : "test -e %(dir)s && cd %(dir)s" > + "win32" : 'if exist %(dir)s cd %(dir)s', > + "posix" : "test -e %(dir)s && cd %(dir)s" > } >=20 > _MAKE_TEMPLATE_ =3D { > - "nmake" : 'if exist %(file)s "$(MAKE)" $(MAKE_FLAGS) -f %(fil= e)s', > - "gmake" : 'test -e %(file)s && "$(MAKE)" $(MAKE_FLAGS) -f %(f= ile)s' > + "win32" : 'if exist %(file)s "$(MAKE)" $(MAKE_FLAGS) -f %(fil= e)s', > + "posix" : 'test -e %(file)s && "$(MAKE)" $(MAKE_FLAGS) -f %(f= ile)s' > } >=20 > _INCLUDE_CMD_ =3D { > @@ -169,22 +170,30 @@ class BuildFile(object): > # > def __init__(self, AutoGenObject): > self._AutoGenObject =3D AutoGenObject > - self._FileType =3D gMakeType >=20 > - ## Create build file > + MakePath =3D AutoGenObject.BuildOption.get('MAKE', {}).get('PAT= H') > + if not MakePath: > + self._FileType =3D "" > + elif "nmake" in MakePath: > + self._FileType =3D "nmake" > + else: > + self._FileType =3D "gmake" > + > + if sys.platform =3D=3D "win32": > + self._Platform =3D "win32" > + else: > + self._Platform =3D "posix" > + > + ## Create build file. > # > - # @param FileType Type of build file. Only nmake and gmake ar= e supported now. > + # Only nmake and gmake are supported. > # > - # @retval TRUE The build file is created or re-created suc= cessfully > - # @retval FALSE The build file exists and is the same as th= e one to be generated > + # @retval TRUE The build file is created or re-created succ= essfully > + # @retval FALSE The build file exists and is the same as the= one to be generated > # > - def Generate(self, FileType=3DgMakeType): > - if FileType not in self._FILE_NAME_: > - EdkLogger.error("build", PARAMETER_INVALID, "Invalid build = type [%s]" % FileType, > - ExtraData=3D"[%s]" % str(self._AutoGenObjec= t)) > - self._FileType =3D FileType > + def Generate(self): > FileContent =3D self._TEMPLATE_.Replace(self._TemplateDict) > - FileName =3D self._FILE_NAME_[FileType] > + FileName =3D self.getMakefileName() > if not os.path.exists(os.path.join(self._AutoGenObject.MakeFile= Dir, "deps.txt")): > with open(os.path.join(self._AutoGenObject.MakeFileDir, "de= ps.txt"),"w+") as fd: > fd.write("") > @@ -203,7 +212,7 @@ class BuildFile(object): > # @retval list The directory creation command list > # > def GetCreateDirectoryCommand(self, DirList): > - return [self._MD_TEMPLATE_[self._FileType] % {'dir':Dir} for Di= r in DirList] > + return [self._MD_TEMPLATE_[self._Platform] % {'dir':Dir} for > + Dir in DirList] >=20 > ## Return a list of directory removal command string > # > @@ -212,7 +221,7 @@ class BuildFile(object): > # @retval list The directory removal command list > # > def GetRemoveDirectoryCommand(self, DirList): > - return [self._RD_TEMPLATE_[self._FileType] % {'dir':Dir} for Di= r in DirList] > + return [self._RD_TEMPLATE_[self._Platform] % {'dir':Dir} for > + Dir in DirList] >=20 > def PlaceMacro(self, Path, MacroDefinitions=3DNone): > if Path.startswith("$("): > @@ -462,11 +471,8 @@ cleanlib: > # Compose a dict object containing information used to do replaceme= nt in template > @property > def _TemplateDict(self): > - if self._FileType not in self._SEP_: > - EdkLogger.error("build", PARAMETER_INVALID, "Invalid Makefi= le type [%s]" % self._FileType, > - ExtraData=3D"[%s]" % str(self._AutoGenObjec= t)) > MyAgo =3D self._AutoGenObject > - Separator =3D self._SEP_[self._FileType] > + Separator =3D self._SEP_[self._Platform] >=20 > # break build if no source files and binary files are found > if len(MyAgo.SourceFileList) =3D=3D 0 and len(MyAgo.BinaryFileL= ist) =3D=3D 0: > @@ -628,10 +634,10 @@ cleanlib: >=20 > BcTargetList =3D [] >=20 > - MakefileName =3D self._FILE_NAME_[self._FileType] > + MakefileName =3D self.getMakefileName() > LibraryMakeCommandList =3D [] > for D in self.LibraryBuildDirectoryList: > - Command =3D self._MAKE_TEMPLATE_[self._FileType] % {"file":= os.path.join(D, MakefileName)} > + Command =3D self._MAKE_TEMPLATE_[self._Platform] % > + {"file":os.path.join(D, MakefileName)} > LibraryMakeCommandList.append(Command) >=20 > package_rel_dir =3D MyAgo.SourceDir @@ -683,8 +689,8 @@ cleanli= b: > "separator" : Separator, > "module_tool_definitions" : ToolsDef, >=20 > - "shell_command_code" : list(self._SHELL_CMD_[self._F= ileType].keys()), > - "shell_command" : list(self._SHELL_CMD_[self._F= ileType].values()), > + "shell_command_code" : list(self._SHELL_CMD_[self._P= latform].keys()), > + "shell_command" : list(self._SHELL_CMD_[self._P= latform].values()), >=20 > "module_entry_point" : ModuleEntryPoint, > "image_entry_point" : ImageEntryPoint, > @@ -721,7 +727,7 @@ cleanlib: > self.ResultFileList.append(Dst) > if '%s :' %(Dst) not in self.BuildTargetList: > self.BuildTargetList.append("%s :" %(Dst)) > - self.BuildTargetList.append('\t' + self._CP_TEM= PLATE_[self._FileType] %{'Src': Src, 'Dst': Dst}) > + self.BuildTargetList.append('\t' + > + self._CP_TEMPLATE_[self._Platform] %{'Src': Src, 'Dst': Dst}) >=20 > FfsCmdList =3D Cmd[0] > for index, Str in enumerate(FfsCmdList): > @@ -1222,7 +1228,7 @@ ${BEGIN}\t-@${create_directory_command}\n${END}\ > # Compose a dict object containing information used to do replaceme= nt in template > @property > def _TemplateDict(self): > - Separator =3D self._SEP_[self._FileType] > + Separator =3D self._SEP_[self._Platform] > MyAgo =3D self._AutoGenObject > if self._FileType not in MyAgo.CustomMakefile: > EdkLogger.error('build', OPTION_NOT_SUPPORTED, "No custom m= akefile for %s" % self._FileType, @@ -1252,7 +1258,7 @@ > ${BEGIN}\t-@${create_directory_command}\n${END}\ > ToolsDef.append("%s_%s =3D %s" % (Tool, Attr, MyAgo= .BuildOption[Tool][Attr])) > ToolsDef.append("") >=20 > - MakefileName =3D self._FILE_NAME_[self._FileType] > + MakefileName =3D self.getMakefileName() > MakefileTemplateDict =3D { > "makefile_header" : self._FILE_HEADER_[self._File= Type], > "makefile_path" : os.path.join("$(MODULE_BUILD_= DIR)", MakefileName), > @@ -1285,8 +1291,8 @@ ${BEGIN}\t-@${create_directory_command}\n${END}\ > "separator" : Separator, > "module_tool_definitions" : ToolsDef, >=20 > - "shell_command_code" : list(self._SHELL_CMD_[self._F= ileType].keys()), > - "shell_command" : list(self._SHELL_CMD_[self._F= ileType].values()), > + "shell_command_code" : list(self._SHELL_CMD_[self._P= latform].keys()), > + "shell_command" : list(self._SHELL_CMD_[self._P= latform].values()), >=20 > "create_directory_command" : self.GetCreateDirectoryComman= d(self.IntermediateDirectoryList), > "custom_makefile_content" : CustomMakefile > @@ -1413,7 +1419,7 @@ cleanlib: > # Compose a dict object containing information used to do replaceme= nt in template > @property > def _TemplateDict(self): > - Separator =3D self._SEP_[self._FileType] > + Separator =3D self._SEP_[self._Platform] >=20 > MyAgo =3D self._AutoGenObject > if "MAKE" not in MyAgo.ToolDefinition or "PATH" not in MyAgo.To= olDefinition["MAKE"]: > @@ -1424,13 +1430,13 @@ cleanlib: > self.ModuleBuildDirectoryList =3D self.GetModuleBuildDirectoryL= ist() > self.LibraryBuildDirectoryList =3D self.GetLibraryBuildDirector= yList() >=20 > - MakefileName =3D self._FILE_NAME_[self._FileType] > + MakefileName =3D self.getMakefileName() > LibraryMakefileList =3D [] > LibraryMakeCommandList =3D [] > for D in self.LibraryBuildDirectoryList: > D =3D self.PlaceMacro(D, {"BUILD_DIR":MyAgo.BuildDir}) > Makefile =3D os.path.join(D, MakefileName) > - Command =3D self._MAKE_TEMPLATE_[self._FileType] % {"file":= Makefile} > + Command =3D self._MAKE_TEMPLATE_[self._Platform] % > + {"file":Makefile} > LibraryMakefileList.append(Makefile) > LibraryMakeCommandList.append(Command) > self.LibraryMakeCommandList =3D LibraryMakeCommandList @@ -1440= ,7 +1446,7 @@ cleanlib: > for D in self.ModuleBuildDirectoryList: > D =3D self.PlaceMacro(D, {"BUILD_DIR":MyAgo.BuildDir}) > Makefile =3D os.path.join(D, MakefileName) > - Command =3D self._MAKE_TEMPLATE_[self._FileType] % {"file":= Makefile} > + Command =3D self._MAKE_TEMPLATE_[self._Platform] % > + {"file":Makefile} > ModuleMakefileList.append(Makefile) > ModuleMakeCommandList.append(Command) >=20 > @@ -1460,8 +1466,8 @@ cleanlib: >=20 > "toolchain_tag" : MyAgo.ToolChain, > "build_target" : MyAgo.BuildTarget, > - "shell_command_code" : list(self._SHELL_CMD_[self._F= ileType].keys()), > - "shell_command" : list(self._SHELL_CMD_[self._F= ileType].values()), > + "shell_command_code" : list(self._SHELL_CMD_[self._P= latform].keys()), > + "shell_command" : list(self._SHELL_CMD_[self._P= latform].values()), > "build_architecture_list" : MyAgo.Arch, > "architecture" : MyAgo.Arch, > "separator" : Separator, > @@ -1519,7 +1525,7 @@ class TopLevelMakefile(BuildFile): > # Compose a dict object containing information used to do replaceme= nt in template > @property > def _TemplateDict(self): > - Separator =3D self._SEP_[self._FileType] > + Separator =3D self._SEP_[self._Platform] >=20 > # any platform autogen object is ok because we just need common= information > MyAgo =3D self._AutoGenObject > @@ -1575,10 +1581,10 @@ class TopLevelMakefile(BuildFile): > else: > ExtraOption +=3D " --pcd " + pcdname + '=3D' + pcd[3] >=20 > - MakefileName =3D self._FILE_NAME_[self._FileType] > + MakefileName =3D self.getMakefileName() > SubBuildCommandList =3D [] > for A in MyAgo.ArchList: > - Command =3D self._MAKE_TEMPLATE_[self._FileType] % {"file":= os.path.join("$(BUILD_DIR)", A, MakefileName)} > + Command =3D self._MAKE_TEMPLATE_[self._Platform] % > + {"file":os.path.join("$(BUILD_DIR)", A, MakefileName)} > SubBuildCommandList.append(Command) >=20 > MakefileTemplateDict =3D { > @@ -1593,8 +1599,8 @@ class TopLevelMakefile(BuildFile): >=20 > "toolchain_tag" : MyAgo.ToolChain, > "build_target" : MyAgo.BuildTarget, > - "shell_command_code" : list(self._SHELL_CMD_[self._F= ileType].keys()), > - "shell_command" : list(self._SHELL_CMD_[self._F= ileType].values()), > + "shell_command_code" : list(self._SHELL_CMD_[self._P= latform].keys()), > + "shell_command" : list(self._SHELL_CMD_[self._P= latform].values()), > 'arch' : list(MyAgo.ArchList), > "build_architecture_list" : ','.join(MyAgo.ArchList), > "separator" : Separator, > diff --git a/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py b/BaseTo= ols/Source/Python/AutoGen/IncludesAutoGen.py > index 1ca1798907ef9b46a17d8938bb2f673d5ade662f..ca9e02d19b4afad82241abb8= e15845731cabd22f 100644 > --- a/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py > +++ b/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py > @@ -2,6 +2,7 @@ > # Build cache intermediate result and state # # Copyright (c) 2019 - = 2020, Intel Corporation. All rights reserved.
> +# Copyright (c) 2020, ARM Limited. All rights reserved.
> # SPDX-License-Identifier: BSD-2-Clause-Patent # from Common.caching = import cached_property @@ -12,20 +13,6 @@ from > Common.Misc import SaveFileOnChange, PathClass from Common.Misc import = TemplateString import sys gIsFileMap =3D {} -if > sys.platform =3D=3D "win32": > - _INCLUDE_DEPS_TEMPLATE =3D TemplateString(''' > -${BEGIN} > -!IF EXIST(${deps_file}) > -!INCLUDE ${deps_file} > -!ENDIF > -${END} > - ''') > -else: > - _INCLUDE_DEPS_TEMPLATE =3D TemplateString(''' > -${BEGIN} > --include ${deps_file} > -${END} > - ''') >=20 > DEP_FILE_TAIL =3D "# Updated \n" >=20 > @@ -59,6 +46,25 @@ class IncludesAutoGen(): >=20 > def CreateDepsInclude(self): > deps_file =3D {'deps_file':self.deps_files} > + > + MakePath =3D self.module_autogen.BuildOption.get('MAKE', {}).ge= t('PATH') > + if not MakePath: > + EdkLogger.error("build", PARAMETER_MISSING, Message=3D"No M= ake path available.") > + elif "nmake" in MakePath: > + _INCLUDE_DEPS_TEMPLATE =3D TemplateString(''' > + ${BEGIN} > + !IF EXIST(${deps_file}) > + !INCLUDE ${deps_file} > + !ENDIF > + ${END} > + ''') > + else: > + _INCLUDE_DEPS_TEMPLATE =3D TemplateString(''' > + ${BEGIN} > + -include ${deps_file} > + ${END} > + ''') > + > try: > deps_include_str =3D _INCLUDE_DEPS_TEMPLATE.Replace(deps_fi= le) > except Exception as e: > diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/P= ython/build/build.py > index 1e47e382cba94dc6fba7d8ecad2bc924b02cea1d..8e6625ae42afe5ed5fddbdb7= 2ef5e8ca044609b4 100755 > --- a/BaseTools/Source/Python/build/build.py > +++ b/BaseTools/Source/Python/build/build.py > @@ -4,6 +4,7 @@ > # Copyright (c) 2014, Hewlett-Packard Development Company, L.P.
#= Copyright (c) 2007 - 2020, Intel Corporation. All rights > reserved.
# Copyright (c) 2018, Hewlett Packard Enterprise Develop= ment, L.P.
> +# Copyright (c) 2020, ARM Limited. All rights reserved.
> # > # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -1251,7 +1252,7 @= @ class Build(): > (AutoGenObject.BuildTarget, AutoGenObje= ct.ToolChain, AutoGenObject.Arch), > ExtraData=3Dstr(AutoGenObject)) >=20 > - makefile =3D GenMake.BuildFile(AutoGenObject)._FILE_NAME_[GenMa= ke.gMakeType] > + makefile =3D GenMake.BuildFile(AutoGenObject).getMakefileName() >=20 > # run > if Target =3D=3D 'run': > @@ -2040,10 +2041,10 @@ class Build(): > ModuleBuildDirectoryList =3D data_pipe.Get("ModuleBuildDire= ctoryList") >=20 > for m_build_dir in LibraryBuildDirectoryList: > - if not os.path.exists(os.path.join(m_build_dir,GenMake.= BuildFile._FILE_NAME_[GenMake.gMakeType])): > + if not os.path.exists(os.path.join(m_build_dir,GenMake.= BuildFile.getMakefileName())): > return None > for m_build_dir in ModuleBuildDirectoryList: > - if not os.path.exists(os.path.join(m_build_dir,GenMake.= BuildFile._FILE_NAME_[GenMake.gMakeType])): > + if not os.path.exists(os.path.join(m_build_dir,GenMake.= BuildFile.getMakefileName())): > return None > Wa =3D WorkSpaceInfo( > workspacedir,active_p,target,toolchain,archlist > -- > 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' >=20 >=20 >=20 >=20 >=20 >=20 >=20