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.100; helo=mga07.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 BC6EB21180F4B for ; Thu, 25 Oct 2018 07:27:14 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Oct 2018 07:27:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,424,1534834800"; d="scan'208";a="98596616" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 25 Oct 2018 07:27:14 -0700 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 25 Oct 2018 07:27:13 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 25 Oct 2018 07:27:13 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.161]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.102]) with mapi id 14.03.0415.000; Thu, 25 Oct 2018 22:27:10 +0800 From: "Zhu, Yonghong" To: "Carsey, Jaben" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Zhu, Yonghong" Thread-Topic: [edk2] [Patch 1/2] BaseTools: Add $(INC)-like support when compiling .nasm files Thread-Index: AQHUbD3b16J7N6CEmE6CMgxyWWmdU6UvfSAAgACH6fA= Date: Thu, 25 Oct 2018 14:27:10 +0000 Message-ID: References: <1540453065-18824-1-git-send-email-yonghong.zhu@intel.com> <1540453065-18824-2-git-send-email-yonghong.zhu@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzdjMDdiZDctNDI1Yi00NjUyLThhNzItZWVmMGY2OGNmMGZmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZDBTeW5oa2dnV0VGaVdKWHhHUlUwVm9IQ0lFZEpNWFZ5SXU3MnBTYlFqNkRoOEp4akFxVk5SNjRaWThTWkN1USJ9 x-ctpclassification: CTP_NT 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 1/2] BaseTools: Add $(INC)-like support when compiling .nasm files 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: Thu, 25 Oct 2018 14:27:14 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Yes, I agree. I will help to update a V2. Best Regards, Zhu Yonghong -----Original Message----- From: Carsey, Jaben=20 Sent: Thursday, October 25, 2018 10:20 PM To: Zhu, Yonghong ; edk2-devel@lists.01.org Cc: Gao, Liming Subject: RE: [edk2] [Patch 1/2] BaseTools: Add $(INC)-like support when com= piling .nasm files > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of=20 > Yonghong Zhu > Sent: Thursday, October 25, 2018 12:38 AM > To: edk2-devel@lists.01.org > Cc: Gao, Liming > Subject: [edk2] [Patch 1/2] BaseTools: Add $(INC)-like support when=20 > compiling .nasm files >=20 > From: zhijufan >=20 > current edk2\BaseTools\Conf\build_rule.template, the compile of nasm=20 > source files does not have the $(INC) support. >=20 > The '-I' option only includes the directory of the nasm source file=20 > (${s_path}(+)). Hence, it will be impossible for nasm files to include=20 > files outside of the nasm source file directory. >=20 > As a comparison, the compile of both .s and .asm have $(INC) support=20 > in their compile commands. >=20 > Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1085 > Cc: Liming Gao > Cc: Yonghong Zhu > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Zhiju.Fan > --- > BaseTools/Source/Python/AutoGen/GenMake.py | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) >=20 > diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py > b/BaseTools/Source/Python/AutoGen/GenMake.py > index d94d8f9..8860d50 100644 > --- a/BaseTools/Source/Python/AutoGen/GenMake.py > +++ b/BaseTools/Source/Python/AutoGen/GenMake.py > @@ -165,11 +165,11 @@ class BuildFile(object): > _INCLUDE_CMD_ =3D { > "nmake" : '!INCLUDE', > "gmake" : "include" > } >=20 > - _INC_FLAG_ =3D {TAB_COMPILER_MSFT : "/I", "GCC" : "-I", "INTEL" : "-= I", > "RVCT" : "-I"} > + _INC_FLAG_ =3D {TAB_COMPILER_MSFT : "/I", "GCC" : "-I", "INTEL" :=20 > + "-I", > "RVCT" : "-I", "NASM" : "-I"} >=20 > ## Constructor of BuildFile > # > # @param AutoGenObject Object of AutoGen class > # > @@ -594,10 +594,22 @@ cleanlib: > "macro_name" : "IN= C", > "source_file" : Incl= udePathList > } > ) > FileMacroList.append(FileMacro) > + for File in self.FileCache.keys(): > + if not str(File).endswith('.nasm'): > + continue > + FileMacro =3D "" > + IncludePathList =3D [] > + for P in MyAgo.IncludePathList: > + IncludePathList.append(self._INC_FLAG_['NASM'] + > self.PlaceMacro(P, self.Macros)) > + if FileBuildRule.INC_LIST_MACRO in self.ListFileMacros: > + > self.ListFileMacros[FileBuildRule.INC_LIST_MACRO].append(self._INC_FLA > G > _['NASM'] + P) > + FileMacro +=3D > self._FILE_MACRO_TEMPLATE.Replace({"macro_name": "NASM_INC", > "source_file": IncludePathList}) Why do we use +=3D on FileMacro here? Seems like =3D will be fine. We can= also skip initializing the FileMacro since it's only ever assigned here. > + FileMacroList.append(FileMacro) > + break >=20 > # Generate macros used to represent files containing list of inp= ut files > for ListFileMacro in self.ListFileMacros: > ListFileName =3D os.path.join(MyAgo.OutputDir, "%s.lst" % > ListFileMacro.lower()[:len(ListFileMacro) - 5]) > FileMacroList.append("%s =3D %s" % (ListFileMacro,=20 > ListFileName)) > -- > 2.6.1.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel