From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 68F8D21A04820 for ; Wed, 12 Apr 2017 19:22:03 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP; 12 Apr 2017 19:22:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,192,1488873600"; d="scan'208";a="86819927" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga005.jf.intel.com with ESMTP; 12 Apr 2017 19:22:02 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 12 Apr 2017 19:22:02 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 12 Apr 2017 19:22:01 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.117]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.224]) with mapi id 14.03.0319.002; Thu, 13 Apr 2017 10:21:58 +0800 From: "Zhu, Yonghong" To: "Kinney, Michael D" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Shaw, Kevin W" , "Zhu, Yonghong" Thread-Topic: [edk2-DscSpecification PATCH] Use macros in !include file paths Thread-Index: AQHSs8Dpe/t5hJpoa0mJAqSGj3o5mKHBlCeAgAD9uhA= Date: Thu, 13 Apr 2017 02:21:57 +0000 Message-ID: References: <1492024417-29680-1-git-send-email-michael.d.kinney@intel.com> <1492024417-29680-2-git-send-email-michael.d.kinney@intel.com> In-Reply-To: <1492024417-29680-2-git-send-email-michael.d.kinney@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZmE2NGUxN2YtZDRjZi00ODRiLWJiMzQtODNiZjMxZjhmZTU5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6InJ2dkh0UVUxdmV6OTFVQkw4Z1VuS29SbTJcL2hOWjBIcGs2N1FqbE5xbWdjPSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [edk2-DscSpecification PATCH] Use macros in !include file paths X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Apr 2017 02:22:03 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yonghong Zhu =20 Best Regards, Zhu Yonghong -----Original Message----- From: Kinney, Michael D=20 Sent: Thursday, April 13, 2017 3:14 AM To: edk2-devel@lists.01.org Cc: Gao, Liming ; Zhu, Yonghong ; Shaw, Kevin W Subject: [edk2-DscSpecification PATCH] Use macros in !include file paths https://bugzilla.tianocore.org/show_bug.cgi?id=3D351 The EBNF already allows !include statements to use $(MACRO) values in the file path. This change updates the description and = examples for !include statements to allow the use of macros and specific en= vironment variables in !include file paths. Cc: Liming Gao Cc: Yonghong Zhu Cc: Kevin W Shaw Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael Kinney --- 2_dsc_overview/22_build_description_file_format.md | 19 +++++++++------= ---- .../33_platform_dsc_definition.md | 19 ++++++++++++---= ---- README.md | 3 ++- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/2_dsc_overview/22_build_description_file_format.md b/2_dsc_ove= rview/22_build_description_file_format.md index ebe4cca..d32c9b0 100644 --- a/2_dsc_overview/22_build_description_file_format.md +++ b/2_dsc_overview/22_build_description_file_format.md @@ -230,9 +230,15 @@ definition, contain complete sections, or combination = of both. The argument of this statement is a filename. The file is relative to the = directory that contains this DSC file, and if not found the tool must atte= mpt to find the file relative to the paths listed in the system environmen= t -variables, `$(WORKSPACE)`, `$(EFI_SOURCE)`, `$(EDK_SOURCE)`, `$(ECP_SOUR= CE)` in -the file name is permitted. If the file is still not found, the pa= rsing tools -must terminate with an error. +variables `$(WORKSPACE)`, `$(EFI_SOURCE)`, `$(EDK_SOURCE)`, and=20 +`$(ECP_SOURCE)`. If the file is still not found, the parsing tools must=20 +terminate with an error. + +Macros, defined in this file, are permitted in the path or file name of=20 +the !include statement, as these files are included prior to processing=20 +the file for macros. The system environment variables `$(WORKSPACE)`,=20 +`$(EDK_SOURCE)`, `$(EFI_SOURCE)`, and `$(ECP_SOURCE)` may also be used;=20 +only these system environment variables are permitted to start the path of= the included file. =20 Files specified by `!include` statements may not contain `!include` statem= ents. =20 @@ -241,13 +247,6 @@ the included file is read in by tools in the exact pos= ition of the file, and is functionally equivalent of copying the contents = of the included file and inserting (paste) the content into the DSC file. =20 -Macros, defined in this file, are not permitted in the path or file name o= f the -!include statement, as these files are included prior to processing = the file -for macros. If the path starts with a "$" character, then one of = the system -environment variables, `$(WORKSPACE)`, `$(EDK_SOURCE)`, `$(EFI_= SOURCE)`, or -`$(ECP_SOURCE)` is being used; only these system environment = variables are -permitted to start the path of the included file. - The following examples show the valid usage of the `!include` statement. =20 ```ini diff --git a/3_edk_ii_dsc_file_format/33_platform_dsc_definition.md b/3_edk= _ii_dsc_file_format/33_platform_dsc_definition.md index 8119ee4..1ed3f7e 100644 --- a/3_edk_ii_dsc_file_format/33_platform_dsc_definition.md +++ b/3_edk_ii_dsc_file_format/33_platform_dsc_definition.md @@ -655,18 +655,21 @@ section that the `!include` statement resides, or it = may contain completely new sections. If the included file starts with a se= ction header, then the section being processed in the Platform DSC file is= considered to have been terminated. =20 +If the `` contains "$" characters, then macros defined in the=20 +DSC file and the system environment variables, `$(WORKSPACE)`,=20 +`$(EDK_SOURCE)`, `$(EFI_SOURCE)`, and `$(ECP_SOURCE)` are substituted into= ``. + +The tools look for `` relative to the directory the DSC file res= ides. +If the file is not found, and a directory separator is in ``,=20 +the tools attempt to find the file in a WORKSPACE (or a directory=20 +listed in the +PACKAGES_PATH) relative path. If the file cannot be found, the build=20 +system must exit with an appropriate error message. + The `!include` file cannot contain additional `!include` statements. =20 Statements in the include file are permitted to override previous definiti= ons as well as to define new entries. =20 -If the filename is a filename, the tools will look for the file in the sam= e -directory as the DSC file. If the filename starts with a "$", then the s= ystem -environment variable will be used to locate the file. If neither of = these -methods find the file, and a directory separator is in the filename,= the tools -will attempt to find the file in an EDK II Package . If the fil= e cannot be -found, the build system must exit with an appropriate error me= ssage. - #### Prototype =20 ` ::=3D "!include" ` @@ -676,= 6 +679,8 @@ found, the build system must exit with an appropriate error mes= sage. ``` !include MyPlatformPkg/feature_pcds.mak !include MyFeatures.mak +!include $(WORKSPACE)/PackageDir/Features.dsc +!include $(MACRO1)/AnotherDir/$(MACRO2)/Features.dsc ``` =20 ********** diff --git a/README.md b/README.md index 7a87ccf..64bf2b7 100644 --- a/README.md +++ b/README.md @@ -176,4 +176,5 @@ Copyright (c) 2006-2017, Intel Corporation. All rights = reserved. | | Update the DSC_SPECIFICATION version to 0x0001001A = = = = | | | | Revised WORKSPACE wording for updated build system that can= handle packages located outside of the WORKSPACE directory tree (refer to = the TianoCore.org/ EDKII website for additional instructions on setting up = a development environment). = | | | | Added new system environment variables used by the build sy= stem. = = = | | -| 1.27 | Convert to GitBooks = = = = | March 2017 | +| 1.27 | Convert to GitBooks = = = = | April 2017 | +| | [#351](https://bugzilla.tianocore.org/show_bug.cgi?id=3D351= ) [DSC Spec] Extend macro usage in the !include statement = = = | | -- 2.6.3.windows.1