From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.7337.1583931545947107551 for ; Wed, 11 Mar 2020 05:59:07 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: liming.gao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Mar 2020 05:59:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,540,1574150400"; d="scan'208";a="265975253" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga004.fm.intel.com with ESMTP; 11 Mar 2020 05:59:04 -0700 Received: from shsmsx602.ccr.corp.intel.com (10.109.6.142) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 11 Mar 2020 05:59:04 -0700 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by SHSMSX602.ccr.corp.intel.com (10.109.6.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 11 Mar 2020 20:59:01 +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; Wed, 11 Mar 2020 20:59:01 +0800 From: "Liming Gao" To: "devel@edk2.groups.io" , "Fan, ZhijuX" CC: "Feng, Bob C" Subject: Re: [edk2-devel] [PATCH V4] BaseTools:copy the common PcdValueCommon.c to output directory Thread-Topic: [edk2-devel] [PATCH V4] BaseTools:copy the common PcdValueCommon.c to output directory Thread-Index: AQHV94rYPmma4MaHNU6OBVxoVeywBahDWo6A Date: Wed, 11 Mar 2020 12:59:01 +0000 Message-ID: References: <20200311095121.18788-1-zhijux.fan@intel.com> In-Reply-To: <20200311095121.18788-1-zhijux.fan@intel.com> 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 Reviewed-by: Liming Gao > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Fan, Zhij= uX > Sent: Wednesday, March 11, 2020 5:51 PM > To: devel@edk2.groups.io > Cc: Gao, Liming ; Feng, Bob C ; Fan, ZhijuX > Subject: [edk2-devel] [PATCH V4] BaseTools:copy the common PcdValueCommo= n.c to output directory >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2568 >=20 > PcdValueInit shares the same Edk2\BaseTools\Source\C\PcdValueCommon.c. > To avoid the conflict, it should copy this file to its output directory, > If so, PcdValueCommon.c file will be private for PcdValueInit >=20 > Cc: Liming Gao > Cc: Bob Feng > Signed-off-by: Zhiju.Fan > --- > Optimized the generated Makefile and script code > '%s' % PcdValueCommonName change to PcdValueCommonName >=20 > BaseTools/Source/Python/Workspace/DscBuildData.py | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseToo= ls/Source/Python/Workspace/DscBuildData.py > index 476c7edaf9da..75f419c7ff1b 100644 > --- a/BaseTools/Source/Python/Workspace/DscBuildData.py > +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py > @@ -55,6 +55,7 @@ def _IsFieldValueAnArray (Value): > return False >=20 > PcdValueInitName =3D 'PcdValueInit' > +PcdValueCommonName =3D 'PcdValueCommon' >=20 > PcdMainCHeader =3D ''' > /** > @@ -2634,10 +2635,10 @@ class DscBuildData(PlatformBuildClassObject): >=20 > MakeApp =3D PcdMakefileHeader > if sys.platform =3D=3D "win32": > - MakeApp =3D MakeApp + 'APPFILE =3D %s\%s.exe\n' % (self.Out= putPath, PcdValueInitName) + 'APPNAME =3D %s\n' % > (PcdValueInitName) + 'OBJECTS =3D %s\%s.obj %s.obj\n' % (self.OutputPath= , PcdValueInitName, > os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "= Source/C/Common/PcdValueCommon"))) + 'INC =3D ' > + MakeApp =3D MakeApp + 'APPFILE =3D %s\%s.exe\n' % (self.Out= putPath, PcdValueInitName) + 'APPNAME =3D %s\n' % > (PcdValueInitName) + 'OBJECTS =3D %s\%s.obj %s.obj\n' % (self.OutputPath= , PcdValueInitName, os.path.join(self.OutputPath, > PcdValueCommonName)) + 'INC =3D ' > else: > MakeApp =3D MakeApp + PcdGccMakefile > - MakeApp =3D MakeApp + 'APPFILE =3D %s/%s\n' % (self.OutputP= ath, PcdValueInitName) + 'APPNAME =3D %s\n' % (PcdValueInitName) > + 'OBJECTS =3D %s/%s.o %s.o\n' % (self.OutputPath, PcdValueInitName, > os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "= Source/C/Common/PcdValueCommon"))) + \ > + MakeApp =3D MakeApp + 'APPFILE =3D %s/%s\n' % (self.OutputP= ath, PcdValueInitName) + 'APPNAME =3D %s\n' % (PcdValueInitName) > + 'OBJECTS =3D %s/%s.o %s.o\n' % (self.OutputPath, PcdValueInitName, os.= path.join(self.OutputPath, PcdValueCommonName)) + \ > 'include $(MAKEROOT)/Makefiles/app.makefile\n' + = 'INCLUDE +=3D' >=20 > IncSearchList =3D [] > @@ -2742,6 +2743,14 @@ class DscBuildData(PlatformBuildClassObject): > IncFileList =3D GetDependencyList(IncludeFileFullPaths, SearchP= athList) > for include_file in IncFileList: > MakeApp +=3D "$(OBJECTS) : %s\n" % include_file > + if sys.platform =3D=3D "win32": > + PcdValueCommonPath =3D os.path.normpath(mws.join(GlobalData= .gGlobalDefines["EDK_TOOLS_PATH"], > "Source\C\Common\PcdValueCommon.c")) > + MakeApp =3D MakeApp + '%s\PcdValueCommon.c : %s\n' % (self.= OutputPath, PcdValueCommonPath) > + MakeApp =3D MakeApp + '\tcopy /y %s $@\n' % (PcdValueCommon= Path) > + else: > + PcdValueCommonPath =3D os.path.normpath(mws.join(GlobalData= .gGlobalDefines["EDK_TOOLS_PATH"], > "Source/C/Common/PcdValueCommon.c")) > + MakeApp =3D MakeApp + '%s/PcdValueCommon.c : %s\n' % (self.= OutputPath, PcdValueCommonPath) > + MakeApp =3D MakeApp + '\tcp -f %s %s/PcdValueCommon.c\n' % = (PcdValueCommonPath, self.OutputPath) > MakeFileName =3D os.path.join(self.OutputPath, 'Makefile') > MakeApp +=3D "$(OBJECTS) : %s\n" % MakeFileName > SaveFileOnChange(MakeFileName, MakeApp, False) > -- > 2.14.1.windows.1 >=20 >=20 >=20