From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 33C4E2117AE75 for ; Wed, 24 Oct 2018 07:37:47 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2018 07:37:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,420,1534834800"; d="scan'208";a="85232040" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga006.jf.intel.com with ESMTP; 24 Oct 2018 07:37:45 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 24 Oct 2018 07:37:44 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.117]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.214]) with mapi id 14.03.0415.000; Wed, 24 Oct 2018 22:37:43 +0800 From: "Gao, Liming" To: "Feng, Bob C" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [Patch] BaseTools: Move PcdValueInit to platform build folder Thread-Index: AQHUabbHF6pDwIEokUK6dp9uppUND6UuesoA Date: Wed, 24 Oct 2018 14:37:43 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E35C933@SHSMSX104.ccr.corp.intel.com> References: <20181022032413.24428-1-bob.c.feng@intel.com> In-Reply-To: <20181022032413.24428-1-bob.c.feng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjRiYzdiYjEtNGQzYi00MWE2LWJkMzItOTJiNTkzMjRlNWYzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiQkppeU5IanRkUWh4M1JyUm0waGRjUG5qMGVERDZ6MFExWGZ1UzNiRW95OHRJaHU0ZWcyVFRYYmxNdnc4RWhydCJ9 dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTools: Move PcdValueInit to platform build folder X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2018 14:37:47 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Bo= bCF > Sent: Monday, October 22, 2018 11:24 AM > To: edk2-devel@lists.01.org > Cc: Gao, Liming > Subject: [edk2] [Patch] BaseTools: Move PcdValueInit to platform build fo= lder >=20 > PcdValueInit tool is platform scope. > It should be generated into Platform output directory. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Bob C Feng > Cc: Liming Gao > --- > .../Source/Python/Workspace/DscBuildData.py | 25 +++++++++++++------ > 1 file changed, 17 insertions(+), 8 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTool= s/Source/Python/Workspace/DscBuildData.py > index 17e6f62cac..6fe03ff91a 100644 > --- a/BaseTools/Source/Python/Workspace/DscBuildData.py > +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py > @@ -84,10 +84,16 @@ PcdMakefileEnd =3D ''' > LIBS =3D $(LIB_PATH)\Common.lib >=20 > !INCLUDE $(BASE_TOOLS_PATH)\Source\C\Makefiles\ms.app > ''' >=20 > +AppTarget =3D ''' > +all: $(APPFILE) > +$(APPFILE): $(OBJECTS) > +%s > +''' > + > PcdGccMakefile =3D ''' > MAKEROOT ?=3D $(EDK_TOOLS_PATH)/Source/C > LIBS =3D -lCommon > ''' >=20 > @@ -2253,14 +2259,14 @@ class DscBuildData(PlatformBuildClassObject): > CAppBaseFileName =3D os.path.join(self.OutputPath, PcdValueInitN= ame) > SaveFileOnChange(CAppBaseFileName + '.c', CApp, False) >=20 > MakeApp =3D PcdMakefileHeader > if sys.platform =3D=3D "win32": > - MakeApp =3D MakeApp + 'APPNAME =3D %s\n' % (PcdValueInitName= ) + 'OBJECTS =3D %s\%s.obj\n' % (self.OutputPath, > PcdValueInitName) + 'INC =3D ' > + MakeApp =3D MakeApp + 'APPFILE =3D %s\%s.exe\n' % (self.Outp= utPath, PcdValueInitName) + 'APPNAME =3D %s\n' % > (PcdValueInitName) + 'OBJECTS =3D %s\%s.obj\n' % (self.OutputPath, PcdVal= ueInitName) + 'INC =3D ' > else: > MakeApp =3D MakeApp + PcdGccMakefile > - MakeApp =3D MakeApp + 'APPNAME =3D %s\n' % (PcdValueInitName= ) + 'OBJECTS =3D %s/%s.o\n' % (self.OutputPath, > PcdValueInitName) + \ > + MakeApp =3D MakeApp + 'APPFILE =3D %s/%s\n' % (self.OutputPa= th, PcdValueInitName) + 'APPNAME =3D %s\n' % > (PcdValueInitName) + 'OBJECTS =3D %s/%s.o\n' % (self.OutputPath, PcdValue= InitName) + \ > 'include $(MAKEROOT)/Makefiles/app.makefile\n' + '= INCLUDE +=3D' >=20 > IncSearchList =3D [] > PlatformInc =3D OrderedDict() > for Cache in self._Bdb._CACHE_.values(): > @@ -2332,10 +2338,13 @@ class DscBuildData(PlatformBuildClassObject): > CC_FLAGS +=3D ' ' + Item > MakeApp +=3D CC_FLAGS >=20 > if sys.platform =3D=3D "win32": > MakeApp =3D MakeApp + PcdMakefileEnd > + MakeApp =3D MakeApp + AppTarget % ("""\tcopy $(APPLICATION) = $(APPFILE) /y """) > + else: > + MakeApp =3D MakeApp + AppTarget % ("""\tcp $(APPLICATION) $(= APPFILE) """) > MakeApp =3D MakeApp + '\n' > IncludeFileFullPaths =3D [] > for includefile in IncludeFiles: > for includepath in IncSearchList: > includefullpath =3D os.path.join(str(includepath), inclu= defile) > @@ -2355,25 +2364,25 @@ class DscBuildData(PlatformBuildClassObject): >=20 > InputValueFile =3D os.path.join(self.OutputPath, 'Input.txt') > OutputValueFile =3D os.path.join(self.OutputPath, 'Output.txt') > SaveFileOnChange(InputValueFile, InitByteValue, False) >=20 > - PcdValueInitExe =3D PcdValueInitName > + Dest_PcdValueInitExe =3D PcdValueInitName > if not sys.platform =3D=3D "win32": > - PcdValueInitExe =3D os.path.join(os.getenv("EDK_TOOLS_PATH")= , 'Source', 'C', 'bin', PcdValueInitName) > + Dest_PcdValueInitExe =3D os.path.join(self.OutputPath, PcdVa= lueInitName) > else: > - PcdValueInitExe =3D os.path.join(os.getenv("EDK_TOOLS_PATH")= , 'Bin', 'Win32', PcdValueInitName) +".exe" > - > + Dest_PcdValueInitExe =3D os.path.join(self.OutputPath, PcdVa= lueInitName) +".exe" > Messages =3D '' > if sys.platform =3D=3D "win32": > MakeCommand =3D 'nmake -f %s' % (MakeFileName) > returncode, StdOut, StdErr =3D DscBuildData.ExecuteCommand (= MakeCommand) > Messages =3D StdOut > else: > MakeCommand =3D 'make -f %s' % (MakeFileName) > returncode, StdOut, StdErr =3D DscBuildData.ExecuteCommand (= MakeCommand) > Messages =3D StdErr > + > Messages =3D Messages.split('\n') > MessageGroup =3D [] > if returncode !=3D 0: > CAppBaseFileName =3D os.path.join(self.OutputPath, PcdValueI= nitName) > File =3D open (CAppBaseFileName + '.c', 'r') > @@ -2414,12 +2423,12 @@ class DscBuildData(PlatformBuildClassObject): > if MessageGroup: > EdkLogger.error("build", PCD_STRUCTURE_PCD_ERROR, "\n".j= oin(MessageGroup) ) > else: > EdkLogger.error('Build', COMMAND_FAILURE, 'Can not execu= te command: %s' % MakeCommand) >=20 > - if DscBuildData.NeedUpdateOutput(OutputValueFile, PcdValueInitEx= e, InputValueFile): > - Command =3D PcdValueInitExe + ' -i %s -o %s' % (InputValueFi= le, OutputValueFile) > + if DscBuildData.NeedUpdateOutput(OutputValueFile, Dest_PcdValueI= nitExe, InputValueFile): > + Command =3D Dest_PcdValueInitExe + ' -i %s -o %s' % (InputVa= lueFile, OutputValueFile) > returncode, StdOut, StdErr =3D DscBuildData.ExecuteCommand (= Command) > if returncode !=3D 0: > EdkLogger.warn('Build', COMMAND_FAILURE, 'Can not collec= t output from command: %s' % Command) >=20 > File =3D open (OutputValueFile, 'r') > -- > 2.18.0.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel