From f0dc69e61bf2316dcf7cc75eb7e4ba374a5b2832 Mon Sep 17 00:00:00 2001 From: Yonghong Zhu Date: Thu, 31 Mar 2016 14:05:59 +0800 Subject: BaseTools: Add support to merge Prebuild and Postbuild into build Process This feature is enhance build tool to incorporate execution of prebuild and postbuild. 1.Prebuild script a.DEFINE PREBUILD in DSC [Defines] section b.Build command -D PREBUILD to override the one in DSC [Defines] section 1)If PREBUILD is a file, then this file will be used as prebuild script. 2)If PREBUILD is empty, then prebuild script will be disabled. 3)If PREBUILD is not defined in [Defines] section and not passed in on command line, then prebuild script is also disabled. 2.Prebuild option a.All options of build tool b.TARGET, ARCH and TOOL_CHAIN_TAG value, Those value will be from target.txt file if they are not in build command line. c.Additional options following prebuild definition. Quotes are needed when these additional options are present. d.Quotes would also be required if the path to the prebuild command contains space or special characters. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/Python/Common/DscClassObject.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'BaseTools/Source/Python/Common/DscClassObject.py') diff --git a/BaseTools/Source/Python/Common/DscClassObject.py b/BaseTools/Source/Python/Common/DscClassObject.py index 788a75e267..c2fa1c275a 100644 --- a/BaseTools/Source/Python/Common/DscClassObject.py +++ b/BaseTools/Source/Python/Common/DscClassObject.py @@ -1,7 +1,7 @@ ## @file # This file is used to define each component of DSC file # -# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at @@ -98,11 +98,10 @@ class Dsc(DscObject): self.UserExtensions = '' self.WorkspaceDir = WorkspaceDir self.IsToDatabase = IsToDatabase - - self.Cur = Database.Cur - self.TblFile = Database.TblFile - self.TblDsc = Database.TblDsc - + if Database: + self.Cur = Database.Cur + self.TblFile = Database.TblFile + self.TblDsc = Database.TblDsc self.KeyList = [ TAB_SKUIDS, TAB_LIBRARIES, TAB_LIBRARY_CLASSES, TAB_BUILD_OPTIONS, TAB_PCDS_FIXED_AT_BUILD_NULL, \ @@ -252,6 +251,12 @@ class Dsc(DscObject): Fdf = PlatformFlashDefinitionFileClass() Fdf.FilePath = NormPath(QueryDefinesItem(self.TblDsc, TAB_DSC_DEFINES_FLASH_DEFINITION, Arch, self.FileID)[0]) self.Platform.FlashDefinitionFile = Fdf + Prebuild = BuildScriptClass() + Prebuild.FilePath = NormPath(QueryDefinesItem(self.TblDsc, TAB_DSC_PREBUILD, Arch, self.FileID)[0]) + self.Platform.Prebuild = Prebuild + Postbuild = BuildScriptClass() + Postbuild.FilePath = NormPath(QueryDefinesItem(self.TblDsc, TAB_DSC_POSTBUILD, Arch, self.FileID)[0]) + self.Platform.Postbuild = Postbuild ## GenBuildOptions # -- cgit v1.2.3