From nobody Sun Apr 28 07:25:01 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 1492477549810600.5063033255989; Mon, 17 Apr 2017 18:05:49 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 77A5A2195409F; Mon, 17 Apr 2017 18:05:45 -0700 (PDT) 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 359EE2195408C for ; Mon, 17 Apr 2017 18:05:44 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP; 17 Apr 2017 18:05:43 -0700 Received: from mdkinney-mobl.amr.corp.intel.com ([10.241.98.47]) by orsmga005.jf.intel.com with ESMTP; 17 Apr 2017 18:05:44 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,217,1488873600"; d="scan'208";a="88648971" From: Michael Kinney To: edk2-devel@lists.01.org Date: Mon, 17 Apr 2017 18:05:40 -0700 Message-Id: <1492477540-41700-2-git-send-email-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.6.3.windows.1 In-Reply-To: <1492477540-41700-1-git-send-email-michael.d.kinney@intel.com> References: <1492477540-41700-1-git-send-email-michael.d.kinney@intel.com> Subject: [edk2] [edk2-BuildSpecification PATCH] Declare Pre/Post build scripts in [Defines] section 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=3D483 Add support for PREBUILD and POSTBUILD defines in the [Defines] section of an DSC to declare scripts that are executed before and after normal DSC/FDF file processing. 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 --- .../106_post_build_processing.md | 61 ++++++++++++++++++= ++++ .../82_auto-generation_process.md | 33 ++++++++++++ README.md | 1 + SUMMARY.md | 1 + 4 files changed, 96 insertions(+) create mode 100644 10_post-build_imagegen_stage_-_flash/106_post_build_pro= cessing.md diff --git a/10_post-build_imagegen_stage_-_flash/106_post_build_processing= .md b/10_post-build_imagegen_stage_-_flash/106_post_build_processing.md new file mode 100644 index 0000000..6b48a4f --- /dev/null +++ b/10_post-build_imagegen_stage_-_flash/106_post_build_processing.md @@ -0,0 +1,61 @@ + + + +## 10.6 Post Build Processing + +If the `[Defines]` section of the DSC file contains a `POSTBUILD =3D entry` +statement, prior to exiting, the script specified in the `POSTBUILD` state= ment +is executed. If the script file is not found, the **build** command exits = with +an appropriate error message. If the script fails, it must terminate with a +non-zero exit code and the **build** command terminates with the exit value +from the post-build script. The script is required to generate error messa= ges +that provide the reason for the termination. + +All of the command line options passed into the **build** command are also +passed into the script along with the command line options for `TARGET`, +`ARCH`, and `TOOL_CHAIN_TAG`. The values for `TARGET`, `ARCH`, and +`TOOL_CHAIN_TAG` are from the command line options passed into the **build= ** +command. If these values are not passed into the **build** command, then t= hey +are retrieved from `target.txt`. + +If the script terminates successfully (exit value of 0), then the **build** +command terminates normally. + +********** +**Note:** This entry may be wrapped in a conditional directive. Unlike the +`PREBUILD` entry, there are no restrictions on the MACRO values used in a +conditional directive. +********** +**Note:** Quotes are needed when the script's additional options are prese= nt. +Quotes are also required if the path to the post-build command contains sp= ace +or special characters. +********** diff --git a/8_pre-build_autogen_stage/82_auto-generation_process.md b/8_pr= e-build_autogen_stage/82_auto-generation_process.md index deb1c47..4175552 100644 --- a/8_pre-build_autogen_stage/82_auto-generation_process.md +++ b/8_pre-build_autogen_stage/82_auto-generation_process.md @@ -958,6 +958,39 @@ If the `[Defines]` section has the `PCD_VAR_CHECK_GENE= RATION` entry set to TRUE, then a binary file will be created in the FV directory for Dynamic a= nd DynamicEx PCD HII Variable checking. =20 +#### 8.2.4.13 Pre Build Processing + +The DSC file is parsed after the tool meta-data files. If the `[Defines]` +section of the DSC file contains a `PREBUILD =3D entry` statement, process= ing +of the DSC file is suspended and the script specified in the `PREBUILD` +statement is executed. If the script file is not found, the **build** comm= and +exits with an appropriate error message. If the script fails, it must term= inate +with a non-zero exit code and the **build** command terminates with the ex= it +value from the pre-build script. The script is required to generate error +messages that provide the reason for the termination. + +All of the command line options passed into the **build** command are also +passed into the script along with the command line options for `TARGET`, +`ARCH`, and `TOOL_CHAIN_TAG`. The values for `TARGET`, `ARCH`, and +`TOOL_CHAIN_TAG` are from the command line options passed into the **build= ** +command. If these values are not passed into the **build** command, then t= hey +are retrieved from `target.txt`. + +If the script terminates successfully (exit value of 0), parsing of the DSC +file continues, and build tools may retrieve environment variables that ha= ve +been updated by the script. + +********** +**Note:** This entry may be wrapped in a conditional directive that uses t= he +value of the `TOOL_CHAIN_TAG` determined earlier. Using a MACRO value other +than `$(TOOL_CHAIN_TAG)` is prohibited, as the DSC file has not been proce= ssed +at the time the ENTRY was found. +********** +**Note:** Quotes are needed when the script's additional options are prese= nt. +Quotes are also required if the path to the pre-build command contains spa= ce +or special characters. +********** + ### 8.2.5 Post processing =20 Once all files are parsed, the build tools will do following work for each= EDK diff --git a/README.md b/README.md index 71c4511..3f9ef99 100644 --- a/README.md +++ b/README.md @@ -203,3 +203,4 @@ Copyright (c) 2008-2017, Intel Corporation. All rights = reserved. | 1.27 | Convert to Gitbook = = = = | A= pril 2017 | | | [#471](https://bugzilla.tianocore.org/show_bug.cgi?id=3D471= ) Build spec: only copy the "TianoCore" Userextension section into "As Buil= t" INF = = |= | | | [#472](https://bugzilla.tianocore.org/show_bug.cgi?id=3D472= ) [Build Spec] Extend macro usage in the !include statements for DSC/FDF fi= les = = |= | +| | [#483](https://bugzilla.tianocore.org/show_bug.cgi?id=3D483= ) Build Spec: add description for merge Pre-build and Post-build into build= process = = |= | diff --git a/SUMMARY.md b/SUMMARY.md index fb76372..e374319 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -90,6 +90,7 @@ * [10.3 Build Intermediate Images](10_post-build_imagegen_stage_-_flash/= 103_build_intermediate_images.md#103-build-intermediate-images) * [10.4 Create the FV Image File(s)](10_post-build_imagegen_stage_-_flas= h/104_create_the_fv_image_files.md#104-create-the-fv-image-files) * [10.5 Create the FD image file(s)](10_post-build_imagegen_stage_-_flas= h/105_create_the_fd_image_files.md#105-create-the-fd-image-files) + * [10.6 Post Build Processing](10_post-build_imagegen_stage_-_flash/106_= post_build_processing.md#106_post_build_processing) * [11 Post-Build ImageGen Stage - Other](11_post-build_imagegen_stage_-_ot= her/README.md#11-post-build-imagegen-stage---other) * [11.1 EFI PCI Option ROM Images](11_post-build_imagegen_stage_-_other/= 111_efi_pci_option_rom_images.md#111-efi-pci-option-rom-images) * [11.2 UEFI Applications](11_post-build_imagegen_stage_-_other/112_uefi= _applications.md#112-uefi-applications) --=20 2.6.3.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel