]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Common/GlobalData.py
BaseTools: GlobalData Add a regular expression for a hex number
[mirror_edk2.git] / BaseTools / Source / Python / Common / GlobalData.py
index 6c7f085810100ddab0eac964c93248c176165844..fab67601a9e5f49c4bdcc023f5caf65805119736 100644 (file)
-## @file
-# This file is used to define common static strings used by INF/DEC/DSC files
-#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-# 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
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-import re
-
-gIsWindows = None
-
-gEdkCompatibilityPkg = "EdkCompatibilityPkg"
-gWorkspace = "."
-gEdkSource = "EdkCompatibilityPkg"
-gEfiSource = "."
-gEcpSource = "EdkCompatibilityPkg"
-
-gOptions = None
-gCaseInsensitive = False
-gGlobalDefines = {}
-gAllFiles = None
-
-gEdkGlobal = {}
-gOverrideDir = {}
-
-# for debug trace purpose when problem occurs
-gProcessingFile = ''
-gBuildingModule = ''
-
-## Regular expression for matching macro used in DSC/DEC/INF file inclusion
-gMacroPattern = re.compile("\$\(([_A-Z][_A-Z0-9]*)\)", re.UNICODE)
-
+## @file\r
+# This file is used to define common static strings used by INF/DEC/DSC files\r
+#\r
+# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
+# This program and the accompanying materials\r
+# are licensed and made available under the terms and conditions of the BSD License\r
+# which accompanies this distribution.  The full text of the license may be found at\r
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+import re\r
+\r
+gIsWindows = None\r
+\r
+gEdkCompatibilityPkg = "EdkCompatibilityPkg"\r
+gWorkspace = "."\r
+gEdkSource = "EdkCompatibilityPkg"\r
+gEfiSource = "."\r
+gEcpSource = "EdkCompatibilityPkg"\r
+\r
+gOptions = None\r
+gCaseInsensitive = False\r
+gAllFiles = None\r
+gCommand = None\r
+gSKUID_CMD = None\r
+\r
+gGlobalDefines = {}\r
+gPlatformDefines = {}\r
+# PCD name and value pair for fixed at build and feature flag\r
+gPlatformPcds = {}\r
+# PCDs with type that are not fixed at build and feature flag\r
+gPlatformOtherPcds = {}\r
+gActivePlatform = None\r
+gCommandLineDefines = {}\r
+gEdkGlobal = {}\r
+gOverrideDir = {}\r
+gCommandMaxLength = 4096\r
+# for debug trace purpose when problem occurs\r
+gProcessingFile = ''\r
+gBuildingModule = ''\r
+gSkuids = []\r
+gDefaultStores = []\r
+\r
+# definition for a MACRO name.  used to create regular expressions below.\r
+_MacroNamePattern = "[A-Z][A-Z0-9_]*"\r
+\r
+## Regular expression for matching macro used in DSC/DEC/INF file inclusion\r
+gMacroRefPattern = re.compile("\$\(({})\)".format(_MacroNamePattern), re.UNICODE)\r
+gMacroDefPattern = re.compile("^(DEFINE|EDK_GLOBAL)[ \t]+")\r
+gMacroNamePattern = re.compile("^{}$".format(_MacroNamePattern))\r
+\r
+# definition for a GUID.  used to create regular expressions below.\r
+_HexChar = r"[0-9a-fA-F]"\r
+_GuidPattern = r"{Hex}{{8}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{12}}".format(Hex=_HexChar)\r
+\r
+## Regular expressions for GUID matching\r
+gGuidPattern = re.compile(r'{}'.format(_GuidPattern))\r
+gGuidPatternEnd = re.compile(r'{}$'.format(_GuidPattern))\r
+\r
+## Regular expressions for HEX matching\r
+g4HexChar = re.compile(r'{}{{4}}'.format(_HexChar))\r
+gHexPattern = re.compile(r'0[xX]{}+'.format(_HexChar))\r
+\r
+#\r
+# A global variable for whether current build in AutoGen phase or not.\r
+#\r
+gAutoGenPhase = False\r
+\r
+#\r
+# The Conf dir outside the workspace dir\r
+#\r
+gConfDirectory = ''\r
+\r
+gBuildDirectory = ''\r
+#\r
+# The relative default database file path\r
+#\r
+gDatabasePath = ".cache/build.db"\r
+\r
+#\r
+# Build flag for binary build\r
+#\r
+gIgnoreSource = False\r
+\r
+#\r
+# FDF parser\r
+#\r
+gFdfParser = None\r
+\r
+#\r
+# If a module is built more than once with different PCDs or library classes\r
+# a temporary INF file with same content is created, the temporary file is removed\r
+# when build exits.\r
+#\r
+gTempInfs = []\r
+\r
+BuildOptionPcd = []\r
+\r
+#\r
+# Mixed PCD name dict\r
+#\r
+MixedPcd = {}\r
+\r
+# Structure Pcd dict\r
+gStructurePcd = {}\r
+\r
+# Pcd name for the Pcd which used in the Conditional directives\r
+gConditionalPcds = []\r
+\r
+gUseHashCache = None\r
+gBinCacheDest = None\r
+gBinCacheSource = None\r
+gPlatformHash = None\r
+gPackageHash = {}\r
+gModuleHash = {}\r
+gEnableGenfdsMultiThread = False\r