]>
Commit | Line | Data |
---|---|---|
1 | ## @file\r | |
2 | # This file is used to define common static strings used by INF/DEC/DSC files\r | |
3 | #\r | |
4 | # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r | |
5 | # SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
6 | \r | |
7 | import re\r | |
8 | \r | |
9 | gIsWindows = None\r | |
10 | gWorkspace = "."\r | |
11 | gOptions = None\r | |
12 | gCaseInsensitive = False\r | |
13 | gAllFiles = None\r | |
14 | gCommand = None\r | |
15 | gSKUID_CMD = None\r | |
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 | |
26 | gCommandMaxLength = 4096\r | |
27 | # for debug trace purpose when problem occurs\r | |
28 | gProcessingFile = ''\r | |
29 | gBuildingModule = ''\r | |
30 | gSkuids = []\r | |
31 | gDefaultStores = []\r | |
32 | \r | |
33 | # definition for a MACRO name. used to create regular expressions below.\r | |
34 | _MacroNamePattern = "[A-Z][A-Z0-9_]*"\r | |
35 | \r | |
36 | ## Regular expression for matching macro used in DSC/DEC/INF file inclusion\r | |
37 | gMacroRefPattern = re.compile("\$\(({})\)".format(_MacroNamePattern), re.UNICODE)\r | |
38 | gMacroDefPattern = re.compile("^(DEFINE|EDK_GLOBAL)[ \t]+")\r | |
39 | gMacroNamePattern = re.compile("^{}$".format(_MacroNamePattern))\r | |
40 | \r | |
41 | # definition for a GUID. used to create regular expressions below.\r | |
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 | |
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 | |
49 | ## Regular expressions for HEX matching\r | |
50 | g4HexChar = re.compile(r'{}{{4}}'.format(_HexChar))\r | |
51 | gHexPattern = re.compile(r'0[xX]{}+'.format(_HexChar))\r | |
52 | gHexPatternAll = re.compile(r'0[xX]{}+$'.format(_HexChar))\r | |
53 | \r | |
54 | ## Regular expressions for string identifier checking\r | |
55 | gIdentifierPattern = re.compile('^[a-zA-Z][a-zA-Z0-9_]*$', re.UNICODE)\r | |
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 | |
63 | \r | |
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 | |
74 | gBuildDirectory = ''\r | |
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 | |
89 | \r | |
90 | BuildOptionPcd = []\r | |
91 | \r | |
92 | #\r | |
93 | # Mixed PCD name dict\r | |
94 | #\r | |
95 | MixedPcd = {}\r | |
96 | \r | |
97 | # Structure Pcd dict\r | |
98 | gStructurePcd = {}\r | |
99 | gPcdSkuOverrides={}\r | |
100 | # Pcd name for the Pcd which used in the Conditional directives\r | |
101 | gConditionalPcds = []\r | |
102 | \r | |
103 | gUseHashCache = None\r | |
104 | gBinCacheDest = None\r | |
105 | gBinCacheSource = None\r | |
106 | gPlatformHash = None\r | |
107 | gPackageHash = {}\r | |
108 | gModuleHash = {}\r | |
109 | gEnableGenfdsMultiThread = False\r | |
110 | gSikpAutoGenCache = set()\r |