From nobody Sat Nov 2 10:23:03 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1492024427374204.09140040321438; Wed, 12 Apr 2017 12:13:47 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9621820D7B907; Wed, 12 Apr 2017 12:13:43 -0700 (PDT) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 A3CCF21DFA7AF for ; Wed, 12 Apr 2017 12:13:42 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP; 12 Apr 2017 12:13:42 -0700 Received: from mdkinney-mobl.amr.corp.intel.com ([10.252.134.215]) by fmsmga002.fm.intel.com with ESMTP; 12 Apr 2017 12:13:42 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,191,1488873600"; d="scan'208";a="1154987615" From: Michael Kinney To: edk2-devel@lists.01.org Date: Wed, 12 Apr 2017 12:13:37 -0700 Message-Id: <1492024417-29680-2-git-send-email-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.6.3.windows.1 In-Reply-To: <1492024417-29680-1-git-send-email-michael.d.kinney@intel.com> References: <1492024417-29680-1-git-send-email-michael.d.kinney@intel.com> Subject: [edk2] [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: , Cc: Kevin W Shaw , Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 environment 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 Reviewed-by: Yonghong Zhu =20 --- 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 environment -variables, `$(WORKSPACE)`, `$(EFI_SOURCE)`, `$(EDK_SOURCE)`, `$(ECP_SOURCE= )` in -the file name is permitted. If the file is still not found, the parsing to= ols -must terminate with an error. +variables `$(WORKSPACE)`, `$(EFI_SOURCE)`, `$(EDK_SOURCE)`, and +`$(ECP_SOURCE)`. If the file is still not found, the parsing tools must +terminate with an error. + +Macros, defined in this file, are permitted in the path or file name of the +!include statement, as these files are included prior to processing the fi= le +for macros. The system environment variables `$(WORKSPACE)`, `$(EDK_SOURCE= )`, +`$(EFI_SOURCE)`, and `$(ECP_SOURCE)` may also be used; 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 fi= le -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 section header, then the sect= ion being processed in the Platform DSC file is considered to have been termin= ated. =20 +If the `` contains "$" characters, then macros defined in the DSC +file and the system environment variables, `$(WORKSPACE)`, `$(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 ``, the +tools attempt to find the file in a WORKSPACE (or a directory listed in the +PACKAGES_PATH) relative path. If the file cannot be found, the build 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 same -directory as the DSC file. If the filename starts with a "$", then the sys= tem -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 t= ools -will attempt to find the file in an EDK II Package . If the file cannot be -found, the build system must exit with an appropriate error message. - #### Prototype =20 ` ::=3D "!include" ` @@ -676,6 +679,8 @@ found, the build system must exit with an appropriate e= rror message. ``` !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 = = = | | --=20 2.6.3.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel