]>
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 |
f51461c8 LG |
5 | # This program and the accompanying materials\r |
6 | # are licensed and made available under the terms and conditions of the BSD License\r | |
7 | # which accompanies this distribution. The full text of the license may be found at\r | |
8 | # http://opensource.org/licenses/bsd-license.php\r | |
9 | #\r | |
10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | import re\r | |
14 | \r | |
15 | gIsWindows = None\r | |
f51461c8 | 16 | gWorkspace = "."\r |
f51461c8 LG |
17 | gOptions = None\r |
18 | gCaseInsensitive = False\r | |
19 | gAllFiles = None\r | |
f0dc69e6 | 20 | gCommand = None\r |
e651d06c | 21 | gSKUID_CMD = None\r |
f51461c8 LG |
22 | \r |
23 | gGlobalDefines = {}\r | |
24 | gPlatformDefines = {}\r | |
25 | # PCD name and value pair for fixed at build and feature flag\r | |
26 | gPlatformPcds = {}\r | |
27 | # PCDs with type that are not fixed at build and feature flag\r | |
28 | gPlatformOtherPcds = {}\r | |
29 | gActivePlatform = None\r | |
30 | gCommandLineDefines = {}\r | |
31 | gEdkGlobal = {}\r | |
32 | gOverrideDir = {}\r | |
725cdb8f | 33 | gCommandMaxLength = 4096\r |
f51461c8 LG |
34 | # for debug trace purpose when problem occurs\r |
35 | gProcessingFile = ''\r | |
36 | gBuildingModule = ''\r | |
e651d06c LG |
37 | gSkuids = []\r |
38 | gDefaultStores = []\r | |
f51461c8 | 39 | \r |
0f17c9fe CJ |
40 | # definition for a MACRO name. used to create regular expressions below.\r |
41 | _MacroNamePattern = "[A-Z][A-Z0-9_]*"\r | |
42 | \r | |
f51461c8 | 43 | ## Regular expression for matching macro used in DSC/DEC/INF file inclusion\r |
0f17c9fe | 44 | gMacroRefPattern = re.compile("\$\(({})\)".format(_MacroNamePattern), re.UNICODE)\r |
f51461c8 | 45 | gMacroDefPattern = re.compile("^(DEFINE|EDK_GLOBAL)[ \t]+")\r |
0f17c9fe | 46 | gMacroNamePattern = re.compile("^{}$".format(_MacroNamePattern))\r |
7878f706 | 47 | \r |
cd67d664 | 48 | # definition for a GUID. used to create regular expressions below.\r |
256e2d88 CJ |
49 | _HexChar = r"[0-9a-fA-F]"\r |
50 | _GuidPattern = r"{Hex}{{8}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{12}}".format(Hex=_HexChar)\r | |
cd67d664 CJ |
51 | \r |
52 | ## Regular expressions for GUID matching\r | |
53 | gGuidPattern = re.compile(r'{}'.format(_GuidPattern))\r | |
54 | gGuidPatternEnd = re.compile(r'{}$'.format(_GuidPattern))\r | |
55 | \r | |
0760ed06 | 56 | ## Regular expressions for HEX matching\r |
9e7790a3 | 57 | g4HexChar = re.compile(r'{}{{4}}'.format(_HexChar))\r |
0760ed06 | 58 | gHexPattern = re.compile(r'0[xX]{}+'.format(_HexChar))\r |
6553c617 | 59 | gHexPatternAll = re.compile(r'0[xX]{}+$'.format(_HexChar))\r |
9e7790a3 | 60 | \r |
7da06eee CJ |
61 | ## Regular expressions for string identifier checking\r |
62 | gIdentifierPattern = re.compile('^[a-zA-Z][a-zA-Z0-9_]*$', re.UNICODE)\r | |
85e5d3cf FY |
63 | ## Regular expression for GUID c structure format\r |
64 | _GuidCFormatPattern = r"{{\s*0[xX]{Hex}{{1,8}}\s*,\s*0[xX]{Hex}{{1,4}}\s*,\s*0[xX]{Hex}{{1,4}}" \\r | |
65 | r"\s*,\s*{{\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \\r | |
66 | r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \\r | |
67 | r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \\r | |
68 | r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}\s*}}\s*}}".format(Hex=_HexChar)\r | |
69 | gGuidCFormatPattern = re.compile(r"{}".format(_GuidCFormatPattern))\r | |
7da06eee | 70 | \r |
f51461c8 LG |
71 | #\r |
72 | # A global variable for whether current build in AutoGen phase or not.\r | |
73 | #\r | |
74 | gAutoGenPhase = False\r | |
75 | \r | |
76 | #\r | |
77 | # The Conf dir outside the workspace dir\r | |
78 | #\r | |
79 | gConfDirectory = ''\r | |
80 | \r | |
97058144 | 81 | gBuildDirectory = ''\r |
f51461c8 LG |
82 | #\r |
83 | # The relative default database file path\r | |
84 | #\r | |
85 | gDatabasePath = ".cache/build.db"\r | |
86 | \r | |
87 | #\r | |
88 | # Build flag for binary build\r | |
89 | #\r | |
90 | gIgnoreSource = False\r | |
91 | \r | |
92 | #\r | |
93 | # FDF parser\r | |
94 | #\r | |
95 | gFdfParser = None\r | |
97fa0ee9 | 96 | \r |
763e8edf | 97 | BuildOptionPcd = []\r |
c8d07c5e | 98 | \r |
2a29017e YZ |
99 | #\r |
100 | # Mixed PCD name dict\r | |
101 | #\r | |
102 | MixedPcd = {}\r | |
103 | \r | |
ae7b6df8 LG |
104 | # Structure Pcd dict\r |
105 | gStructurePcd = {}\r | |
106 | \r | |
c8d07c5e YZ |
107 | # Pcd name for the Pcd which used in the Conditional directives\r |
108 | gConditionalPcds = []\r | |
36d083ef YZ |
109 | \r |
110 | gUseHashCache = None\r | |
111 | gBinCacheDest = None\r | |
112 | gBinCacheSource = None\r | |
113 | gPlatformHash = None\r | |
114 | gPackageHash = {}\r | |
115 | gModuleHash = {}\r | |
37de70b7 | 116 | gEnableGenfdsMultiThread = False\r |
18ef4e71 | 117 | gSikpAutoGenCache = set()\r |