]>
Commit | Line | Data |
---|---|---|
f51461c8 LG |
1 | ## @file\r |
2 | # This file is used to define common static strings used by INF/DEC/DSC files\r | |
3 | #\r | |
0f17c9fe | 4 | # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r |
2e351cbe | 5 | # SPDX-License-Identifier: BSD-2-Clause-Patent\r |
f51461c8 LG |
6 | \r |
7 | import re\r | |
8 | \r | |
9 | gIsWindows = None\r | |
f51461c8 | 10 | gWorkspace = "."\r |
f51461c8 LG |
11 | gOptions = None\r |
12 | gCaseInsensitive = False\r | |
13 | gAllFiles = None\r | |
f0dc69e6 | 14 | gCommand = None\r |
e651d06c | 15 | gSKUID_CMD = None\r |
f51461c8 LG |
16 | \r |
17 | gGlobalDefines = {}\r | |
18 | gPlatformDefines = {}\r | |
19 | # PCD name and value pair for fixed at build and feature flag\r | |
20 | gPlatformPcds = {}\r | |
21 | # PCDs with type that are not fixed at build and feature flag\r | |
22 | gPlatformOtherPcds = {}\r | |
23 | gActivePlatform = None\r | |
24 | gCommandLineDefines = {}\r | |
25 | gEdkGlobal = {}\r | |
725cdb8f | 26 | gCommandMaxLength = 4096\r |
f51461c8 LG |
27 | # for debug trace purpose when problem occurs\r |
28 | gProcessingFile = ''\r | |
29 | gBuildingModule = ''\r | |
e651d06c LG |
30 | gSkuids = []\r |
31 | gDefaultStores = []\r | |
f51461c8 | 32 | \r |
0f17c9fe CJ |
33 | # definition for a MACRO name. used to create regular expressions below.\r |
34 | _MacroNamePattern = "[A-Z][A-Z0-9_]*"\r | |
35 | \r | |
f51461c8 | 36 | ## Regular expression for matching macro used in DSC/DEC/INF file inclusion\r |
0f17c9fe | 37 | gMacroRefPattern = re.compile("\$\(({})\)".format(_MacroNamePattern), re.UNICODE)\r |
f51461c8 | 38 | gMacroDefPattern = re.compile("^(DEFINE|EDK_GLOBAL)[ \t]+")\r |
0f17c9fe | 39 | gMacroNamePattern = re.compile("^{}$".format(_MacroNamePattern))\r |
7878f706 | 40 | \r |
cd67d664 | 41 | # definition for a GUID. used to create regular expressions below.\r |
256e2d88 CJ |
42 | _HexChar = r"[0-9a-fA-F]"\r |
43 | _GuidPattern = r"{Hex}{{8}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{12}}".format(Hex=_HexChar)\r | |
cd67d664 CJ |
44 | \r |
45 | ## Regular expressions for GUID matching\r | |
46 | gGuidPattern = re.compile(r'{}'.format(_GuidPattern))\r | |
47 | gGuidPatternEnd = re.compile(r'{}$'.format(_GuidPattern))\r | |
48 | \r | |
0760ed06 | 49 | ## Regular expressions for HEX matching\r |
9e7790a3 | 50 | g4HexChar = re.compile(r'{}{{4}}'.format(_HexChar))\r |
0760ed06 | 51 | gHexPattern = re.compile(r'0[xX]{}+'.format(_HexChar))\r |
6553c617 | 52 | gHexPatternAll = re.compile(r'0[xX]{}+$'.format(_HexChar))\r |
9e7790a3 | 53 | \r |
7da06eee CJ |
54 | ## Regular expressions for string identifier checking\r |
55 | gIdentifierPattern = re.compile('^[a-zA-Z][a-zA-Z0-9_]*$', re.UNICODE)\r | |
85e5d3cf FY |
56 | ## Regular expression for GUID c structure format\r |
57 | _GuidCFormatPattern = r"{{\s*0[xX]{Hex}{{1,8}}\s*,\s*0[xX]{Hex}{{1,4}}\s*,\s*0[xX]{Hex}{{1,4}}" \\r | |
58 | r"\s*,\s*{{\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \\r | |
59 | r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \\r | |
60 | r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \\r | |
61 | r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}\s*}}\s*}}".format(Hex=_HexChar)\r | |
62 | gGuidCFormatPattern = re.compile(r"{}".format(_GuidCFormatPattern))\r | |
7da06eee | 63 | \r |
f51461c8 LG |
64 | #\r |
65 | # A global variable for whether current build in AutoGen phase or not.\r | |
66 | #\r | |
67 | gAutoGenPhase = False\r | |
68 | \r | |
69 | #\r | |
70 | # The Conf dir outside the workspace dir\r | |
71 | #\r | |
72 | gConfDirectory = ''\r | |
73 | \r | |
97058144 | 74 | gBuildDirectory = ''\r |
f51461c8 LG |
75 | #\r |
76 | # The relative default database file path\r | |
77 | #\r | |
78 | gDatabasePath = ".cache/build.db"\r | |
79 | \r | |
80 | #\r | |
81 | # Build flag for binary build\r | |
82 | #\r | |
83 | gIgnoreSource = False\r | |
84 | \r | |
85 | #\r | |
86 | # FDF parser\r | |
87 | #\r | |
88 | gFdfParser = None\r | |
97fa0ee9 | 89 | \r |
763e8edf | 90 | BuildOptionPcd = []\r |
c8d07c5e | 91 | \r |
2a29017e YZ |
92 | #\r |
93 | # Mixed PCD name dict\r | |
94 | #\r | |
95 | MixedPcd = {}\r | |
96 | \r | |
ae7b6df8 LG |
97 | # Structure Pcd dict\r |
98 | gStructurePcd = {}\r | |
8a64c7ea | 99 | gPcdSkuOverrides={}\r |
c8d07c5e YZ |
100 | # Pcd name for the Pcd which used in the Conditional directives\r |
101 | gConditionalPcds = []\r | |
36d083ef YZ |
102 | \r |
103 | gUseHashCache = None\r | |
104 | gBinCacheDest = None\r | |
105 | gBinCacheSource = None\r | |
106 | gPlatformHash = None\r | |
107 | gPackageHash = {}\r | |
108 | gModuleHash = {}\r | |
37de70b7 | 109 | gEnableGenfdsMultiThread = False\r |
18ef4e71 | 110 | gSikpAutoGenCache = set()\r |
0eccea3f RC |
111 | \r |
112 | # Dictionary for tracking Module build status as success or failure\r | |
48b0bf64 RC |
113 | # Top Dict: Key: Arch Type Value: Dictionary\r |
114 | # Second Dict: Key: AutoGen Obj Value: 'SUCCESS'\'FAIL'\'FAIL_METAFILE'\r | |
0eccea3f | 115 | gModuleBuildTracking = dict()\r |
a7ef158b RC |
116 | \r |
117 | # Dictionary of booleans that dictate whether a module or\r | |
118 | # library can be skiped\r | |
119 | # Top Dict: Key: Arch Type Value: Dictionary\r | |
120 | # Second Dict: Key: Module\Library Name Value: True\False\r | |
121 | gBuildHashSkipTracking = dict()\r |