From nobody Sun Feb 8 12:38:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+44722+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44722+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1564628633; cv=none; d=zoho.com; s=zohoarc; b=hvWC6GQie2mC9GuylE6xdZpeI+wqrwolJE81aXWA1OCUikhL+8MUZA9oHiQPUALP03md7jpGmyqpaNHCSrhrzNqXEKMaOY4FepLvOT94VQD5qcZ9ChEx0KZScs/cudOreSpgRmUp5OaqANjdCknMAV29fN0Ubt6ZyPKe9QDMq0w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564628633; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=ihwy+SH+Ks/cZvDjNdXTqFeZHn1ThV/9UJ3OooGA1Ns=; b=AlMD2eq1Wu1zJ8CehXIqD0knWAYvzEM9p95L60oRMBrrl3OJYd/NYu1w+DUff1nBfHgHADVUtmXxwfwI/cn/hbiSDrkwdpXi8B5+b7qwpC3lQUsMBapVtEpIll/KJuFV3ChuLcl0Dc32fv4AfxvreO6BHa0j9yWsVICmqJMQH7Y= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44722+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 156462863362579.43632500884746; Wed, 31 Jul 2019 20:03:53 -0700 (PDT) Return-Path: X-Received: from mga02.intel.com (mga02.intel.com []) by groups.io with SMTP; Wed, 31 Jul 2019 20:03:52 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jul 2019 20:03:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,332,1559545200"; d="scan'208";a="324044543" X-Received: from shwdepsi1121.ccr.corp.intel.com ([10.239.158.47]) by orsmga004.jf.intel.com with ESMTP; 31 Jul 2019 20:03:50 -0700 From: "Bob Feng" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao Subject: [edk2-devel] [Patch 08/10 V6] BaseTools: Move BuildOption parser out of build.py Date: Thu, 1 Aug 2019 11:03:31 +0800 Message-Id: <20190801030333.8588-9-bob.c.feng@intel.com> In-Reply-To: <20190801030333.8588-1-bob.c.feng@intel.com> References: <20190801030333.8588-1-bob.c.feng@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,bob.c.feng@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1564628633; bh=96jS2Xqq2he17nfxFt32TfUOatwp/+7Qg1G6dlhogUM=; h=Cc:Date:From:Reply-To:Subject:To; b=kk+0LlnOIYfltUAeJ4s7n9uDfHhCSQgoam1iafm+3bhk/qOWejaKlTtOztF9v/Do01D DXZb3W9JndYBP6Hp7oYZi/iy45p6sZ33kHfKqXKAkEt0VAqlIQ74S2ljFvwEGxuAeXIeP wb/u+zyEQhBc/QADM2WQ7HzV3k8BHgkhR40= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1875 Build tool supports user to specify the conf folder. To make the build options be evaluated at the beginning of launching build, extract the buildoption function from build.py to a new .py file. Signed-off-by: Bob Feng Cc: Liming Gao --- .../Python/Common/TargetTxtClassObject.py | 28 ++++- BaseTools/Source/Python/build/build.py | 108 +----------------- BaseTools/Source/Python/build/buildoptions.py | 92 +++++++++++++++ 3 files changed, 121 insertions(+), 107 deletions(-) create mode 100644 BaseTools/Source/Python/build/buildoptions.py diff --git a/BaseTools/Source/Python/Common/TargetTxtClassObject.py b/BaseT= ools/Source/Python/Common/TargetTxtClassObject.py index 79a5acc01074..16cc75ccb7c8 100644 --- a/BaseTools/Source/Python/Common/TargetTxtClassObject.py +++ b/BaseTools/Source/Python/Common/TargetTxtClassObject.py @@ -8,16 +8,19 @@ ## # Import Modules # from __future__ import print_function from __future__ import absolute_import +from buildoptions import BuildOption,BuildTarget +import Common.GlobalData as GlobalData import Common.LongFilePathOs as os from . import EdkLogger from . import DataType from .BuildToolError import * -from . import GlobalData + from Common.LongFilePathSupport import OpenLongFilePath as open +from Common.MultipleWorkspace import MultipleWorkspace as mws =20 gDefaultTargetTxtFile =3D "target.txt" =20 ## TargetTxtClassObject # @@ -139,16 +142,33 @@ class TargetTxtClassObject(object): # # @param ConfDir: Conf dir # # @retval Target An instance of TargetTxtClassObject() with loaded target.= txt # -def TargetTxtDict(ConfDir): +def TargetTxtDict(): Target =3D TargetTxtClassObject() - Target.LoadTargetTxtFile(os.path.normpath(os.path.join(ConfDir, gDefau= ltTargetTxtFile))) + if BuildOption.ConfDirectory: + # Get alternate Conf location, if it is absolute, then just use th= e absolute directory name + ConfDirectoryPath =3D os.path.normpath(BuildOption.ConfDirectory) + + if not os.path.isabs(ConfDirectoryPath): + # Since alternate directory name is not absolute, the alternat= e directory is located within the WORKSPACE + # This also handles someone specifying the Conf directory in t= he workspace. Using --conf=3DConf + ConfDirectoryPath =3D mws.join(os.environ["WORKSPACE"], ConfDi= rectoryPath) + else: + if "CONF_PATH" in os.environ: + ConfDirectoryPath =3D os.path.normcase(os.path.normpath(os.env= iron["CONF_PATH"])) + else: + # Get standard WORKSPACE/Conf use the absolute path to the WOR= KSPACE/Conf + ConfDirectoryPath =3D mws.join(os.environ["WORKSPACE"], 'Conf') + GlobalData.gConfDirectory =3D ConfDirectoryPath + targettxt =3D os.path.normpath(os.path.join(ConfDirectoryPath, gDefaul= tTargetTxtFile)) + if os.path.exists(targettxt): + Target.LoadTargetTxtFile(targettxt) return Target =20 -TargetTxt =3D TargetTxtDict(os.path.join(os.getenv("WORKSPACE"),"Conf")) +TargetTxt =3D TargetTxtDict() =20 ## # # This acts like the main() function for the script, unless it is 'import'= ed into another # script. diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Pyth= on/build/build.py index 323fc8f64e31..1c03f063668b 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -24,11 +24,11 @@ import traceback import multiprocessing from threading import Thread,Event,BoundedSemaphore import threading from subprocess import Popen,PIPE from collections import OrderedDict, defaultdict -from optparse import OptionParser +from buildoptions import BuildOption,BuildTarget from AutoGen.PlatformAutoGen import PlatformAutoGen from AutoGen.ModuleAutoGen import ModuleAutoGen from AutoGen.WorkspaceAutoGen import WorkspaceAutoGen from AutoGen.AutoGenWorker import AutoGenWorkerInProcess,AutoGenManager,\ LogAgent @@ -41,11 +41,11 @@ from Common.Misc import PathClass,SaveFileOnChange,Remo= veDirectory from Common.StringUtils import NormPath from Common.MultipleWorkspace import MultipleWorkspace as mws from Common.BuildToolError import * from Common.DataType import * import Common.EdkLogger as EdkLogger -from Common.BuildVersion import gBUILD_VERSION + from Workspace.WorkspaceDatabase import BuildDB =20 from BuildReport import BuildReport from GenPatchPcdTable.GenPatchPcdTable import PeImageClass,parsePcdInfoFro= mMapFile from PatchPcdValue.PatchPcdValue import PatchBinaryFile @@ -53,14 +53,10 @@ from PatchPcdValue.PatchPcdValue import PatchBinaryFile import Common.GlobalData as GlobalData from GenFds.GenFds import GenFds, GenFdsApi import multiprocessing as mp from multiprocessing import Manager =20 -# Version and Copyright -VersionNumber =3D "0.60" + ' ' + gBUILD_VERSION -__version__ =3D "%prog Version " + VersionNumber -__copyright__ =3D "Copyright (c) 2007 - 2018, Intel Corporation All right= s reserved." =20 ## standard targets of build command gSupportedTarget =3D ['all', 'genc', 'genmake', 'modules', 'libraries', 'f= ds', 'clean', 'cleanall', 'cleanlib', 'run'] =20 ## build configuration file @@ -761,26 +757,11 @@ class Build(): GlobalData.gBinCacheDest =3D BinCacheDest else: if GlobalData.gBinCacheDest is not None: EdkLogger.error("build", OPTION_VALUE_INVALID, ExtraData= =3D"Invalid value of option --binary-destination.") =20 - if self.ConfDirectory: - # Get alternate Conf location, if it is absolute, then just us= e the absolute directory name - ConfDirectoryPath =3D os.path.normpath(self.ConfDirectory) - - if not os.path.isabs(ConfDirectoryPath): - # Since alternate directory name is not absolute, the alte= rnate directory is located within the WORKSPACE - # This also handles someone specifying the Conf directory = in the workspace. Using --conf=3DConf - ConfDirectoryPath =3D mws.join(self.WorkspaceDir, ConfDire= ctoryPath) - else: - if "CONF_PATH" in os.environ: - ConfDirectoryPath =3D os.path.normcase(os.path.normpath(os= .environ["CONF_PATH"])) - else: - # Get standard WORKSPACE/Conf use the absolute path to the= WORKSPACE/Conf - ConfDirectoryPath =3D mws.join(self.WorkspaceDir, 'Conf') - GlobalData.gConfDirectory =3D ConfDirectoryPath - GlobalData.gDatabasePath =3D os.path.normpath(os.path.join(ConfDir= ectoryPath, GlobalData.gDatabasePath)) + GlobalData.gDatabasePath =3D os.path.normpath(os.path.join(GlobalD= ata.gConfDirectory, GlobalData.gDatabasePath)) if not os.path.exists(os.path.join(GlobalData.gConfDirectory, '.ca= che')): os.makedirs(os.path.join(GlobalData.gConfDirectory, '.cache')) self.Db =3D BuildDB self.BuildDatabase =3D self.Db.BuildObject self.Platform =3D None @@ -2298,17 +2279,11 @@ def ParseDefines(DefineList=3D[]): DefineDict[DefineTokenList[0]] =3D "TRUE" else: DefineDict[DefineTokenList[0]] =3D DefineTokenList[1].stri= p() return DefineDict =20 -gParamCheck =3D [] -def SingleCheckCallback(option, opt_str, value, parser): - if option not in gParamCheck: - setattr(parser.values, option.dest, value) - gParamCheck.append(option) - else: - parser.error("Option %s only allows one instance in command line!"= % option) + =20 def LogBuildTime(Time): if Time: TimeDurStr =3D '' TimeDur =3D time.gmtime(Time) @@ -2318,83 +2293,10 @@ def LogBuildTime(Time): TimeDurStr =3D time.strftime("%H:%M:%S", TimeDur) return TimeDurStr else: return None =20 -## Parse command line options -# -# Using standard Python module optparse to parse command line option of th= is tool. -# -# @retval Opt A optparse.Values object containing the parsed options -# @retval Args Target of build command -# -def MyOptionParser(): - Parser =3D OptionParser(description=3D__copyright__, version=3D__versi= on__, prog=3D"build.exe", usage=3D"%prog [options] [all|fds|genc|genmake|cl= ean|cleanall|cleanlib|modules|libraries|run]") - Parser.add_option("-a", "--arch", action=3D"append", type=3D"choice", = choices=3D['IA32', 'X64', 'EBC', 'ARM', 'AARCH64'], dest=3D"TargetArch", - help=3D"ARCHS is one of list: IA32, X64, ARM, AARCH64 or EBC, whic= h overrides target.txt's TARGET_ARCH definition. To specify more archs, ple= ase repeat this option.") - Parser.add_option("-p", "--platform", action=3D"callback", type=3D"str= ing", dest=3D"PlatformFile", callback=3DSingleCheckCallback, - help=3D"Build the platform specified by the DSC file name argument= , overriding target.txt's ACTIVE_PLATFORM definition.") - Parser.add_option("-m", "--module", action=3D"callback", type=3D"strin= g", dest=3D"ModuleFile", callback=3DSingleCheckCallback, - help=3D"Build the module specified by the INF file name argument.") - Parser.add_option("-b", "--buildtarget", type=3D"string", dest=3D"Buil= dTarget", help=3D"Using the TARGET to build the platform, overriding target= .txt's TARGET definition.", - action=3D"append") - Parser.add_option("-t", "--tagname", action=3D"append", type=3D"string= ", dest=3D"ToolChain", - help=3D"Using the Tool Chain Tagname to build the platform, overri= ding target.txt's TOOL_CHAIN_TAG definition.") - Parser.add_option("-x", "--sku-id", action=3D"callback", type=3D"strin= g", dest=3D"SkuId", callback=3DSingleCheckCallback, - help=3D"Using this name of SKU ID to build the platform, overridin= g SKUID_IDENTIFIER in DSC file.") - - Parser.add_option("-n", action=3D"callback", type=3D"int", dest=3D"Thr= eadNumber", callback=3DSingleCheckCallback, - help=3D"Build the platform using multi-threaded compiler. The valu= e overrides target.txt's MAX_CONCURRENT_THREAD_NUMBER. When value is set to= 0, tool automatically detect number of "\ - "processor threads, set value to 1 means disable multi-thread= build, and set value to more than 1 means user specify the threads number = to build.") - - Parser.add_option("-f", "--fdf", action=3D"callback", type=3D"string",= dest=3D"FdfFile", callback=3DSingleCheckCallback, - help=3D"The name of the FDF file to use, which overrides the setti= ng in the DSC file.") - Parser.add_option("-r", "--rom-image", action=3D"append", type=3D"stri= ng", dest=3D"RomImage", default=3D[], - help=3D"The name of FD to be generated. The name must be from [FD]= section in FDF file.") - Parser.add_option("-i", "--fv-image", action=3D"append", type=3D"strin= g", dest=3D"FvImage", default=3D[], - help=3D"The name of FV to be generated. The name must be from [FV]= section in FDF file.") - Parser.add_option("-C", "--capsule-image", action=3D"append", type=3D"= string", dest=3D"CapName", default=3D[], - help=3D"The name of Capsule to be generated. The name must be from= [Capsule] section in FDF file.") - Parser.add_option("-u", "--skip-autogen", action=3D"store_true", dest= =3D"SkipAutoGen", help=3D"Skip AutoGen step.") - Parser.add_option("-e", "--re-parse", action=3D"store_true", dest=3D"R= eparse", help=3D"Re-parse all meta-data files.") - - Parser.add_option("-c", "--case-insensitive", action=3D"store_true", d= est=3D"CaseInsensitive", default=3DFalse, help=3D"Don't check case of file = name.") - - Parser.add_option("-w", "--warning-as-error", action=3D"store_true", d= est=3D"WarningAsError", help=3D"Treat warning in tools as error.") - Parser.add_option("-j", "--log", action=3D"store", dest=3D"LogFile", h= elp=3D"Put log in specified file as well as on console.") - - Parser.add_option("-s", "--silent", action=3D"store_true", type=3DNone= , dest=3D"SilentMode", - help=3D"Make use of silent mode of (n)make.") - Parser.add_option("-q", "--quiet", action=3D"store_true", type=3DNone,= help=3D"Disable all messages except FATAL ERRORS.") - Parser.add_option("-v", "--verbose", action=3D"store_true", type=3DNon= e, help=3D"Turn on verbose output with informational messages printed, "\ - = "including library instances selected, final dependency expression, "\ - = "and warning messages, etc.") - Parser.add_option("-d", "--debug", action=3D"store", type=3D"int", hel= p=3D"Enable debug messages at specified level.") - Parser.add_option("-D", "--define", action=3D"append", type=3D"string"= , dest=3D"Macros", help=3D"Macro: \"Name [=3D Value]\".") - - Parser.add_option("-y", "--report-file", action=3D"store", dest=3D"Rep= ortFile", help=3D"Create/overwrite the report to the specified filename.") - Parser.add_option("-Y", "--report-type", action=3D"append", type=3D"ch= oice", choices=3D['PCD', 'LIBRARY', 'FLASH', 'DEPEX', 'BUILD_FLAGS', 'FIXED= _ADDRESS', 'HASH', 'EXECUTION_ORDER'], dest=3D"ReportType", default=3D[], - help=3D"Flags that control the type of build report to generate. = Must be one of: [PCD, LIBRARY, FLASH, DEPEX, BUILD_FLAGS, FIXED_ADDRESS, HA= SH, EXECUTION_ORDER]. "\ - "To specify more than one flag, repeat this option on the com= mand line and the default flag set is [PCD, LIBRARY, FLASH, DEPEX, HASH, BU= ILD_FLAGS, FIXED_ADDRESS]") - Parser.add_option("-F", "--flag", action=3D"store", type=3D"string", d= est=3D"Flag", - help=3D"Specify the specific option to parse EDK UNI file. Must be= one of: [-c, -s]. -c is for EDK framework UNI file, and -s is for EDK UEFI= UNI file. "\ - "This option can also be specified by setting *_*_*_BUILD_FLA= GS in [BuildOptions] section of platform DSC. If they are both specified, t= his value "\ - "will override the setting in [BuildOptions] section of platf= orm DSC.") - Parser.add_option("-N", "--no-cache", action=3D"store_true", dest=3D"D= isableCache", default=3DFalse, help=3D"Disable build cache mechanism") - Parser.add_option("--conf", action=3D"store", type=3D"string", dest=3D= "ConfDirectory", help=3D"Specify the customized Conf directory.") - Parser.add_option("--check-usage", action=3D"store_true", dest=3D"Chec= kUsage", default=3DFalse, help=3D"Check usage content of entries listed in = INF file.") - Parser.add_option("--ignore-sources", action=3D"store_true", dest=3D"I= gnoreSources", default=3DFalse, help=3D"Focus to a binary build and ignore = all source files") - Parser.add_option("--pcd", action=3D"append", dest=3D"OptionPcd", help= =3D"Set PCD value by command line. Format: \"PcdName=3DValue\" ") - Parser.add_option("-l", "--cmd-len", action=3D"store", type=3D"int", d= est=3D"CommandLength", help=3D"Specify the maximum line length of build com= mand. Default is 4096.") - Parser.add_option("--hash", action=3D"store_true", dest=3D"UseHashCach= e", default=3DFalse, help=3D"Enable hash-based caching during build process= .") - Parser.add_option("--binary-destination", action=3D"store", type=3D"st= ring", dest=3D"BinCacheDest", help=3D"Generate a cache of binary files in t= he specified directory.") - Parser.add_option("--binary-source", action=3D"store", type=3D"string"= , dest=3D"BinCacheSource", help=3D"Consume a cache of binary files from the= specified directory.") - Parser.add_option("--genfds-multi-thread", action=3D"store_true", dest= =3D"GenfdsMultiThread", default=3DFalse, help=3D"Enable GenFds multi thread= to generate ffs file.") - Parser.add_option("--disable-include-path-check", action=3D"store_true= ", dest=3D"DisableIncludePathCheck", default=3DFalse, help=3D"Disable the i= nclude path check for outside of package.") - (Opt, Args) =3D Parser.parse_args() - return (Opt, Args) - ## Tool entrance method # # This method mainly dispatch specific methods per the command line option= s. # If no error found, return zero value so the caller of this tool can know # if it's executed successfully or not. @@ -2413,11 +2315,11 @@ def Main(): EdkLogger.LogClientInitialize(LogQ) GlobalData.gCommand =3D sys.argv[1:] # # Parse the options and args # - (Option, Target) =3D MyOptionParser() + Option, Target =3D BuildOption, BuildTarget GlobalData.gOptions =3D Option GlobalData.gCaseInsensitive =3D Option.CaseInsensitive =20 # Set log level LogLevel =3D EdkLogger.INFO diff --git a/BaseTools/Source/Python/build/buildoptions.py b/BaseTools/Sour= ce/Python/build/buildoptions.py new file mode 100644 index 000000000000..7161aa66f23e --- /dev/null +++ b/BaseTools/Source/Python/build/buildoptions.py @@ -0,0 +1,92 @@ +## @file +# build a platform or a module +# +# Copyright (c) 2014, Hewlett-Packard Development Company, L.P.
+# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +# Version and Copyright +from Common.BuildVersion import gBUILD_VERSION +from optparse import OptionParser +VersionNumber =3D "0.60" + ' ' + gBUILD_VERSION +__version__ =3D "%prog Version " + VersionNumber +__copyright__ =3D "Copyright (c) 2007 - 2018, Intel Corporation All right= s reserved." + +gParamCheck =3D [] +def SingleCheckCallback(option, opt_str, value, parser): + if option not in gParamCheck: + setattr(parser.values, option.dest, value) + gParamCheck.append(option) + else: + parser.error("Option %s only allows one instance in command line!"= % option) + +def MyOptionParser(): + Parser =3D OptionParser(description=3D__copyright__, version=3D__versi= on__, prog=3D"build.exe", usage=3D"%prog [options] [all|fds|genc|genmake|cl= ean|cleanall|cleanlib|modules|libraries|run]") + Parser.add_option("-a", "--arch", action=3D"append", type=3D"choice", = choices=3D['IA32', 'X64', 'EBC', 'ARM', 'AARCH64'], dest=3D"TargetArch", + help=3D"ARCHS is one of list: IA32, X64, ARM, AARCH64 or EBC, whic= h overrides target.txt's TARGET_ARCH definition. To specify more archs, ple= ase repeat this option.") + Parser.add_option("-p", "--platform", action=3D"callback", type=3D"str= ing", dest=3D"PlatformFile", callback=3DSingleCheckCallback, + help=3D"Build the platform specified by the DSC file name argument= , overriding target.txt's ACTIVE_PLATFORM definition.") + Parser.add_option("-m", "--module", action=3D"callback", type=3D"strin= g", dest=3D"ModuleFile", callback=3DSingleCheckCallback, + help=3D"Build the module specified by the INF file name argument.") + Parser.add_option("-b", "--buildtarget", type=3D"string", dest=3D"Buil= dTarget", help=3D"Using the TARGET to build the platform, overriding target= .txt's TARGET definition.", + action=3D"append") + Parser.add_option("-t", "--tagname", action=3D"append", type=3D"string= ", dest=3D"ToolChain", + help=3D"Using the Tool Chain Tagname to build the platform, overri= ding target.txt's TOOL_CHAIN_TAG definition.") + Parser.add_option("-x", "--sku-id", action=3D"callback", type=3D"strin= g", dest=3D"SkuId", callback=3DSingleCheckCallback, + help=3D"Using this name of SKU ID to build the platform, overridin= g SKUID_IDENTIFIER in DSC file.") + + Parser.add_option("-n", action=3D"callback", type=3D"int", dest=3D"Thr= eadNumber", callback=3DSingleCheckCallback, + help=3D"Build the platform using multi-threaded compiler. The valu= e overrides target.txt's MAX_CONCURRENT_THREAD_NUMBER. When value is set to= 0, tool automatically detect number of "\ + "processor threads, set value to 1 means disable multi-thread= build, and set value to more than 1 means user specify the threads number = to build.") + + Parser.add_option("-f", "--fdf", action=3D"callback", type=3D"string",= dest=3D"FdfFile", callback=3DSingleCheckCallback, + help=3D"The name of the FDF file to use, which overrides the setti= ng in the DSC file.") + Parser.add_option("-r", "--rom-image", action=3D"append", type=3D"stri= ng", dest=3D"RomImage", default=3D[], + help=3D"The name of FD to be generated. The name must be from [FD]= section in FDF file.") + Parser.add_option("-i", "--fv-image", action=3D"append", type=3D"strin= g", dest=3D"FvImage", default=3D[], + help=3D"The name of FV to be generated. The name must be from [FV]= section in FDF file.") + Parser.add_option("-C", "--capsule-image", action=3D"append", type=3D"= string", dest=3D"CapName", default=3D[], + help=3D"The name of Capsule to be generated. The name must be from= [Capsule] section in FDF file.") + Parser.add_option("-u", "--skip-autogen", action=3D"store_true", dest= =3D"SkipAutoGen", help=3D"Skip AutoGen step.") + Parser.add_option("-e", "--re-parse", action=3D"store_true", dest=3D"R= eparse", help=3D"Re-parse all meta-data files.") + + Parser.add_option("-c", "--case-insensitive", action=3D"store_true", d= est=3D"CaseInsensitive", default=3DFalse, help=3D"Don't check case of file = name.") + + Parser.add_option("-w", "--warning-as-error", action=3D"store_true", d= est=3D"WarningAsError", help=3D"Treat warning in tools as error.") + Parser.add_option("-j", "--log", action=3D"store", dest=3D"LogFile", h= elp=3D"Put log in specified file as well as on console.") + + Parser.add_option("-s", "--silent", action=3D"store_true", type=3DNone= , dest=3D"SilentMode", + help=3D"Make use of silent mode of (n)make.") + Parser.add_option("-q", "--quiet", action=3D"store_true", type=3DNone,= help=3D"Disable all messages except FATAL ERRORS.") + Parser.add_option("-v", "--verbose", action=3D"store_true", type=3DNon= e, help=3D"Turn on verbose output with informational messages printed, "\ + = "including library instances selected, final dependency expression, "\ + = "and warning messages, etc.") + Parser.add_option("-d", "--debug", action=3D"store", type=3D"int", hel= p=3D"Enable debug messages at specified level.") + Parser.add_option("-D", "--define", action=3D"append", type=3D"string"= , dest=3D"Macros", help=3D"Macro: \"Name [=3D Value]\".") + + Parser.add_option("-y", "--report-file", action=3D"store", dest=3D"Rep= ortFile", help=3D"Create/overwrite the report to the specified filename.") + Parser.add_option("-Y", "--report-type", action=3D"append", type=3D"ch= oice", choices=3D['PCD', 'LIBRARY', 'FLASH', 'DEPEX', 'BUILD_FLAGS', 'FIXED= _ADDRESS', 'HASH', 'EXECUTION_ORDER'], dest=3D"ReportType", default=3D[], + help=3D"Flags that control the type of build report to generate. = Must be one of: [PCD, LIBRARY, FLASH, DEPEX, BUILD_FLAGS, FIXED_ADDRESS, HA= SH, EXECUTION_ORDER]. "\ + "To specify more than one flag, repeat this option on the com= mand line and the default flag set is [PCD, LIBRARY, FLASH, DEPEX, HASH, BU= ILD_FLAGS, FIXED_ADDRESS]") + Parser.add_option("-F", "--flag", action=3D"store", type=3D"string", d= est=3D"Flag", + help=3D"Specify the specific option to parse EDK UNI file. Must be= one of: [-c, -s]. -c is for EDK framework UNI file, and -s is for EDK UEFI= UNI file. "\ + "This option can also be specified by setting *_*_*_BUILD_FLA= GS in [BuildOptions] section of platform DSC. If they are both specified, t= his value "\ + "will override the setting in [BuildOptions] section of platf= orm DSC.") + Parser.add_option("-N", "--no-cache", action=3D"store_true", dest=3D"D= isableCache", default=3DFalse, help=3D"Disable build cache mechanism") + Parser.add_option("--conf", action=3D"store", type=3D"string", dest=3D= "ConfDirectory", help=3D"Specify the customized Conf directory.") + Parser.add_option("--check-usage", action=3D"store_true", dest=3D"Chec= kUsage", default=3DFalse, help=3D"Check usage content of entries listed in = INF file.") + Parser.add_option("--ignore-sources", action=3D"store_true", dest=3D"I= gnoreSources", default=3DFalse, help=3D"Focus to a binary build and ignore = all source files") + Parser.add_option("--pcd", action=3D"append", dest=3D"OptionPcd", help= =3D"Set PCD value by command line. Format: \"PcdName=3DValue\" ") + Parser.add_option("-l", "--cmd-len", action=3D"store", type=3D"int", d= est=3D"CommandLength", help=3D"Specify the maximum line length of build com= mand. Default is 4096.") + Parser.add_option("--hash", action=3D"store_true", dest=3D"UseHashCach= e", default=3DFalse, help=3D"Enable hash-based caching during build process= .") + Parser.add_option("--binary-destination", action=3D"store", type=3D"st= ring", dest=3D"BinCacheDest", help=3D"Generate a cache of binary files in t= he specified directory.") + Parser.add_option("--binary-source", action=3D"store", type=3D"string"= , dest=3D"BinCacheSource", help=3D"Consume a cache of binary files from the= specified directory.") + Parser.add_option("--genfds-multi-thread", action=3D"store_true", dest= =3D"GenfdsMultiThread", default=3DFalse, help=3D"Enable GenFds multi thread= to generate ffs file.") + Parser.add_option("--disable-include-path-check", action=3D"store_true= ", dest=3D"DisableIncludePathCheck", default=3DFalse, help=3D"Disable the i= nclude path check for outside of package.") + (Opt, Args) =3D Parser.parse_args() + return (Opt, Args) + +BuildOption, BuildTarget =3D MyOptionParser() --=20 2.20.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#44722): https://edk2.groups.io/g/devel/message/44722 Mute This Topic: https://groups.io/mt/32675214/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-