From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: liming.gao@intel.com) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by groups.io with SMTP; Thu, 25 Apr 2019 18:06:45 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Apr 2019 18:06:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,395,1549958400"; d="scan'208";a="137548130" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga008.jf.intel.com with ESMTP; 25 Apr 2019 18:06:43 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 25 Apr 2019 18:06:43 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 25 Apr 2019 18:06:42 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.92]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.39]) with mapi id 14.03.0415.000; Fri, 26 Apr 2019 09:06:41 +0800 From: "Liming Gao" To: "Feng, Bob C" , "devel@edk2.groups.io" Subject: Re: [Patch] BaseTools: Support customized compiling command Thread-Topic: [Patch] BaseTools: Support customized compiling command Thread-Index: AQHU+YOuH0z9JITv8E2v/Wj8ow6cK6ZNpZOg Date: Fri, 26 Apr 2019 01:06:40 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E430ED4@SHSMSX104.ccr.corp.intel.com> References: <20190423032122.29868-1-bob.c.feng@intel.com> In-Reply-To: <20190423032122.29868-1-bob.c.feng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] 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 Reviewed-by: Liming Gao >-----Original Message----- >From: Feng, Bob C >Sent: Tuesday, April 23, 2019 11:21 AM >To: devel@edk2.groups.io >Cc: Feng, Bob C ; Gao, Liming >Subject: [Patch] BaseTools: Support customized compiling command > >BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1737 >User may add other commands before CC command from build_rule.txt >for specific purpose. It worked fine before commit 05217d210e. > >This patch is going to fix the bug in commit 05217d210e to >support customized CC command. > >Signed-off-by: Bob Feng >Cc: Liming Gao >--- > BaseTools/Source/Python/AutoGen/GenMake.py | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > >diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py >b/BaseTools/Source/Python/AutoGen/GenMake.py >index 7562dc68b3..0513807f4f 100644 >--- a/BaseTools/Source/Python/AutoGen/GenMake.py >+++ b/BaseTools/Source/Python/AutoGen/GenMake.py >@@ -1022,11 +1022,11 @@ cleanlib: > CmdCppDict[item.Target.SubDir].append(Pat= h) > if T.Commands: > CommandList =3D T.Commands[:] > for Item in CommandList[:]: > SingleCommandList =3D Item.split() >- if len(SingleCommandList) > 0 and '$(CC)' in SingleComman= dList[0]: >+ if len(SingleCommandList) > 0 and >self.CheckCCCmd(SingleCommandList): > for Temp in SingleCommandList: > if Temp.startswith('/Fo'): > CmdSign =3D '%s%s' % (Temp.rsplit(TAB_SLASH, = 1)[0], TAB_SLASH) > break > else: continue >@@ -1042,10 +1042,15 @@ cleanlib: > T.Commands[Index] =3D '%s\n\t%s' % (' \\\n\t'.joi= n(Cpplist), >CmdTargetDict[CmdSign]) > else: > T.Commands.pop(Index) > return T, CmdSumDict, CmdTargetDict, CmdCppDict > >+ def CheckCCCmd(self, CommandList): >+ for cmd in CommandList: >+ if '$(CC)' in cmd: >+ return True >+ return False > ## For creating makefile targets for dependent libraries > def ProcessDependentLibrary(self): > for LibraryAutoGen in self._AutoGenObject.LibraryAutoGenList: > if not LibraryAutoGen.IsBinaryModule and not >LibraryAutoGen.CanSkipbyHash(): > >self.LibraryBuildDirectoryList.append(self.PlaceMacro(LibraryAutoGen.Build= Di >r, self.Macros)) >-- >2.20.1.windows.1