From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web10.7856.1583933027184103330 for ; Wed, 11 Mar 2020 06:23:47 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: bob.c.feng@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Mar 2020 06:23:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,518,1574150400"; d="scan'208";a="261142223" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga002.jf.intel.com with ESMTP; 11 Mar 2020 06:23:46 -0700 Received: from shsmsx605.ccr.corp.intel.com (10.109.6.215) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 11 Mar 2020 06:23:45 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX605.ccr.corp.intel.com (10.109.6.215) 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 21:23:43 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.1713.004; Wed, 11 Mar 2020 21:23:43 +0800 From: "Bob Feng" To: "Fan, ZhijuX" , "devel@edk2.groups.io" CC: "Gao, Liming" Subject: Re: [PATCH V4] BaseTools:copy the common PcdValueCommon.c to output directory Thread-Topic: [PATCH V4] BaseTools:copy the common PcdValueCommon.c to output directory Thread-Index: AQHV94rYZ9z+q996a0uRnlDT/2IgWqhDYW4g Date: Wed, 11 Mar 2020 13:23:43 +0000 Message-ID: <328cab3943e64ffb91da248e40dee626@intel.com> References: <20200311095121.18788-1-zhijux.fan@intel.com> In-Reply-To: <20200311095121.18788-1-zhijux.fan@intel.com> Accept-Language: zh-CN, 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: bob.c.feng@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bob Feng -----Original Message----- From: Fan, ZhijuX =20 Sent: Wednesday, March 11, 2020 5:51 PM To: devel@edk2.groups.io Cc: Gao, Liming ; Feng, Bob C ;= Fan, ZhijuX Subject: [PATCH V4] BaseTools:copy the common PcdValueCommon.c to output di= rectory REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2568 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 Cc: Liming Gao Cc: Bob Feng Signed-off-by: Zhiju.Fan --- Optimized the generated Makefile and script code '%s' % PcdValueCommonName = change to PcdValueCommonName BaseTools/Source/Python/Workspace/DscBuildData.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/= 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.Output= Path, PcdValueInitName) + 'APPNAME =3D %s\n' % (PcdValueInitName) + 'OBJECT= S =3D %s\%s.obj %s.obj\n' % (self.OutputPath, PcdValueInitName, os.path.nor= mpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "Source/C/Commo= n/PcdValueCommon"))) + 'INC =3D ' + MakeApp =3D MakeApp + 'APPFILE =3D %s\%s.exe\n' % (self.Output= Path, PcdValueInitName) + 'APPNAME =3D %s\n' % (PcdValueInitName) + 'OBJECT= S =3D %s\%s.obj %s.obj\n' % (self.OutputPath, PcdValueInitName, os.path.joi= n(self.OutputPath, PcdValueCommonName)) + 'INC =3D ' else: MakeApp =3D MakeApp + PcdGccMakefile - MakeApp =3D MakeApp + 'APPFILE =3D %s/%s\n' % (self.OutputPath= , 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/PcdV= alueCommon"))) + \ + MakeApp =3D MakeApp + 'APPFILE =3D %s/%s\n' % (self.OutputPath= ,=20 + PcdValueInitName) + 'APPNAME =3D %s\n' % (PcdValueInitName) + 'OBJECTS = =3D=20 + %s/%s.o %s.o\n' % (self.OutputPath, PcdValueInitName,=20 + os.path.join(self.OutputPath, PcdValueCommonName)) + \ 'include $(MAKEROOT)/Makefiles/app.makefile\n' + 'IN= CLUDE +=3D' =20 IncSearchList =3D [] @@ -2742,6 +2743,14 @@ class DscBuildData(PlatformBuildClassObject): IncFileList =3D GetDependencyList(IncludeFileFullPaths, SearchPath= List) 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.gG= lobalDefines["EDK_TOOLS_PATH"], "Source\C\Common\PcdValueCommon.c")) + MakeApp =3D MakeApp + '%s\PcdValueCommon.c : %s\n' % (self.Out= putPath, PcdValueCommonPath) + MakeApp =3D MakeApp + '\tcopy /y %s $@\n' % (PcdValueCommonPat= h) + else: + PcdValueCommonPath =3D os.path.normpath(mws.join(GlobalData.gG= lobalDefines["EDK_TOOLS_PATH"], "Source/C/Common/PcdValueCommon.c")) + MakeApp =3D MakeApp + '%s/PcdValueCommon.c : %s\n' % (self.Out= putPath, PcdValueCommonPath) + MakeApp =3D MakeApp + '\tcp -f %s %s/PcdValueCommon.c\n' %=20 + (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