2014-01-27 06:23:15 +01:00
|
|
|
## @file
|
|
|
|
# This file is used to define common static strings used by INF/DEC/DSC files
|
|
|
|
#
|
2018-03-17 00:27:39 +01:00
|
|
|
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
|
2019-04-04 01:03:11 +02:00
|
|
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
2014-01-27 06:23:15 +01:00
|
|
|
|
|
|
|
import re
|
|
|
|
|
|
|
|
gIsWindows = None
|
|
|
|
gWorkspace = "."
|
|
|
|
gOptions = None
|
|
|
|
gCaseInsensitive = False
|
|
|
|
gAllFiles = None
|
2016-03-31 08:05:59 +02:00
|
|
|
gCommand = None
|
2017-12-22 13:07:54 +01:00
|
|
|
gSKUID_CMD = None
|
2014-01-27 06:23:15 +01:00
|
|
|
|
|
|
|
gGlobalDefines = {}
|
|
|
|
gPlatformDefines = {}
|
|
|
|
# PCD name and value pair for fixed at build and feature flag
|
|
|
|
gPlatformPcds = {}
|
|
|
|
# PCDs with type that are not fixed at build and feature flag
|
|
|
|
gPlatformOtherPcds = {}
|
|
|
|
gActivePlatform = None
|
|
|
|
gCommandLineDefines = {}
|
|
|
|
gEdkGlobal = {}
|
2016-03-16 04:06:44 +01:00
|
|
|
gCommandMaxLength = 4096
|
2014-01-27 06:23:15 +01:00
|
|
|
# for debug trace purpose when problem occurs
|
|
|
|
gProcessingFile = ''
|
|
|
|
gBuildingModule = ''
|
2017-12-22 13:07:54 +01:00
|
|
|
gSkuids = []
|
|
|
|
gDefaultStores = []
|
2014-01-27 06:23:15 +01:00
|
|
|
|
2018-03-17 00:27:39 +01:00
|
|
|
# definition for a MACRO name. used to create regular expressions below.
|
|
|
|
_MacroNamePattern = "[A-Z][A-Z0-9_]*"
|
|
|
|
|
2014-01-27 06:23:15 +01:00
|
|
|
## Regular expression for matching macro used in DSC/DEC/INF file inclusion
|
2018-03-17 00:27:39 +01:00
|
|
|
gMacroRefPattern = re.compile("\$\(({})\)".format(_MacroNamePattern), re.UNICODE)
|
2014-01-27 06:23:15 +01:00
|
|
|
gMacroDefPattern = re.compile("^(DEFINE|EDK_GLOBAL)[ \t]+")
|
2018-03-17 00:27:39 +01:00
|
|
|
gMacroNamePattern = re.compile("^{}$".format(_MacroNamePattern))
|
2018-03-08 01:45:18 +01:00
|
|
|
|
2018-03-17 00:27:40 +01:00
|
|
|
# definition for a GUID. used to create regular expressions below.
|
2018-03-23 18:48:56 +01:00
|
|
|
_HexChar = r"[0-9a-fA-F]"
|
|
|
|
_GuidPattern = r"{Hex}{{8}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{12}}".format(Hex=_HexChar)
|
2018-03-17 00:27:40 +01:00
|
|
|
|
|
|
|
## Regular expressions for GUID matching
|
|
|
|
gGuidPattern = re.compile(r'{}'.format(_GuidPattern))
|
|
|
|
gGuidPatternEnd = re.compile(r'{}$'.format(_GuidPattern))
|
|
|
|
|
2018-03-17 00:27:45 +01:00
|
|
|
## Regular expressions for HEX matching
|
2018-03-28 18:04:58 +02:00
|
|
|
g4HexChar = re.compile(r'{}{{4}}'.format(_HexChar))
|
2018-03-17 00:27:45 +01:00
|
|
|
gHexPattern = re.compile(r'0[xX]{}+'.format(_HexChar))
|
2018-04-20 17:51:44 +02:00
|
|
|
gHexPatternAll = re.compile(r'0[xX]{}+$'.format(_HexChar))
|
2018-03-28 18:04:58 +02:00
|
|
|
|
2018-04-04 00:34:04 +02:00
|
|
|
## Regular expressions for string identifier checking
|
|
|
|
gIdentifierPattern = re.compile('^[a-zA-Z][a-zA-Z0-9_]*$', re.UNICODE)
|
BaseTools: Check GUID C structure format
GUID C format must conform to {8,4,4,{2,2,2,2,2,2,2,2}}
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
2018-08-08 08:14:20 +02:00
|
|
|
## Regular expression for GUID c structure format
|
|
|
|
_GuidCFormatPattern = r"{{\s*0[xX]{Hex}{{1,8}}\s*,\s*0[xX]{Hex}{{1,4}}\s*,\s*0[xX]{Hex}{{1,4}}" \
|
|
|
|
r"\s*,\s*{{\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \
|
|
|
|
r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \
|
|
|
|
r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \
|
|
|
|
r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}\s*}}\s*}}".format(Hex=_HexChar)
|
|
|
|
gGuidCFormatPattern = re.compile(r"{}".format(_GuidCFormatPattern))
|
2018-04-04 00:34:04 +02:00
|
|
|
|
2014-01-27 06:23:15 +01:00
|
|
|
#
|
|
|
|
# A global variable for whether current build in AutoGen phase or not.
|
|
|
|
#
|
|
|
|
gAutoGenPhase = False
|
|
|
|
|
|
|
|
#
|
|
|
|
# The Conf dir outside the workspace dir
|
|
|
|
#
|
|
|
|
gConfDirectory = ''
|
2020-01-10 09:29:45 +01:00
|
|
|
gCmdConfDir = ''
|
2017-10-13 04:47:24 +02:00
|
|
|
gBuildDirectory = ''
|
2014-01-27 06:23:15 +01:00
|
|
|
#
|
|
|
|
# The relative default database file path
|
|
|
|
#
|
|
|
|
gDatabasePath = ".cache/build.db"
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build flag for binary build
|
|
|
|
#
|
|
|
|
gIgnoreSource = False
|
|
|
|
|
|
|
|
#
|
|
|
|
# FDF parser
|
|
|
|
#
|
|
|
|
gFdfParser = None
|
2014-08-28 15:53:34 +02:00
|
|
|
|
2016-02-25 09:13:31 +01:00
|
|
|
BuildOptionPcd = []
|
2016-03-23 10:34:13 +01:00
|
|
|
|
2016-04-12 04:31:55 +02:00
|
|
|
#
|
|
|
|
# Mixed PCD name dict
|
|
|
|
#
|
|
|
|
MixedPcd = {}
|
|
|
|
|
2017-11-24 07:30:11 +01:00
|
|
|
# Structure Pcd dict
|
|
|
|
gStructurePcd = {}
|
2019-02-18 10:53:09 +01:00
|
|
|
gPcdSkuOverrides={}
|
2016-03-23 10:34:13 +01:00
|
|
|
# Pcd name for the Pcd which used in the Conditional directives
|
|
|
|
gConditionalPcds = []
|
BaseTools: add support for BIOS build with binary cache
Add three new options:
--hash enables hash-based caching during build process. when --hash is
enabled, build tool will base on the module hash value to do the
incremental build, without --hash, build tool will base on the
timestamp to do the incremental build. --hash option use md5 method to
get every hash value, DSC/FDF, tools_def.txt, build_rule.txt and build
command are calculated as global hash value, Package DEC and its
include header files are calculated as package hash value, Module
source files and its INF file are calculated as module hash value.
Library hash value will combine the global hash value and its dependent
package hash value. Driver hash value will combine the global hash
value, its dependent package hash value and its linked library hash
value.
When --hash and --binary-destination are specified, build tool will
copy generated binary files for each module into the directory specified
by binary-destination at the build phase. Binary-destination directory
caches all generated binary files.
When --hash and --binary-source are specified, build tool will try to
get the binary files from the binary source directory at the build
phase.If the cached binary has the same hash value, it will be directly
used. Otherwise, build tool will compile the source files and generate
the binary files.
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-09-19 08:31:09 +02:00
|
|
|
|
|
|
|
gUseHashCache = None
|
|
|
|
gBinCacheDest = None
|
|
|
|
gBinCacheSource = None
|
|
|
|
gPlatformHash = None
|
2019-11-19 09:17:00 +01:00
|
|
|
gPlatformHashFile = None
|
|
|
|
gPackageHash = None
|
|
|
|
gPackageHashFile = None
|
|
|
|
gModuleHashFile = None
|
|
|
|
gCMakeHashFile = None
|
|
|
|
gHashChainStatus = None
|
|
|
|
gModulePreMakeCacheStatus = None
|
|
|
|
gModuleMakeCacheStatus = None
|
|
|
|
gFileHashDict = None
|
|
|
|
gModuleAllCacheStatus = None
|
|
|
|
gModuleCacheHit = None
|
|
|
|
|
2019-09-06 15:22:58 +02:00
|
|
|
gEnableGenfdsMultiThread = True
|
2018-07-02 03:15:47 +02:00
|
|
|
gSikpAutoGenCache = set()
|
2019-08-15 16:26:17 +02:00
|
|
|
# Common lock for the file access in multiple process AutoGens
|
|
|
|
file_lock = None
|
2019-11-19 09:17:00 +01:00
|
|
|
|