diff options
author | Carsey, Jaben <jaben.carsey@intel.com> | 2018-04-16 21:52:13 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-04-18 22:15:35 +0800 |
commit | 55c84777ee638be8735a5c421941e7eb71633bdf (patch) | |
tree | d7e686884a5caa82209b2d57db5c38d2f468ec4e /BaseTools/Source/Python/AutoGen/BuildEngine.py | |
parent | 5a693b89a1976f13d32a3ed302f5d6e0664979d6 (diff) | |
download | edk2-55c84777ee638be8735a5c421941e7eb71633bdf.tar.gz edk2-55c84777ee638be8735a5c421941e7eb71633bdf.tar.bz2 edk2-55c84777ee638be8735a5c421941e7eb71633bdf.zip |
BaseTools: use predefined constants instead of local strings
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/BuildEngine.py')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/BuildEngine.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/BaseTools/Source/Python/AutoGen/BuildEngine.py b/BaseTools/Source/Python/AutoGen/BuildEngine.py index 1663ddd21b..bbd1a4d5b2 100644 --- a/BaseTools/Source/Python/AutoGen/BuildEngine.py +++ b/BaseTools/Source/Python/AutoGen/BuildEngine.py @@ -1,7 +1,7 @@ ## @file
# The engine for building files
#
-# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2018, 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
@@ -364,7 +364,7 @@ class BuildRule: self.Parse()
# some intrinsic rules
- self.RuleDatabase[TAB_DEFAULT_BINARY_FILE, "COMMON", "COMMON", "COMMON"] = self._BinaryFileRule
+ self.RuleDatabase[TAB_DEFAULT_BINARY_FILE, TAB_COMMON, TAB_COMMON, TAB_COMMON] = self._BinaryFileRule
self.FileTypeList.add(TAB_DEFAULT_BINARY_FILE)
## Parse the build rule strings
@@ -424,8 +424,8 @@ class BuildRule: def EndOfSection(self):
Database = self.RuleDatabase
# if there's specific toochain family, 'COMMON' doesn't make sense any more
- if len(self._TotalToolChainFamilySet) > 1 and 'COMMON' in self._TotalToolChainFamilySet:
- self._TotalToolChainFamilySet.remove('COMMON')
+ if len(self._TotalToolChainFamilySet) > 1 and TAB_COMMON in self._TotalToolChainFamilySet:
+ self._TotalToolChainFamilySet.remove(TAB_COMMON)
for Family in self._TotalToolChainFamilySet:
Input = self._RuleInfo[Family, self._InputFile]
Output = self._RuleInfo[Family, self._OutputFile]
@@ -452,8 +452,8 @@ class BuildRule: FileType = ''
RuleNameList = self.RuleContent[LineIndex][1:-1].split(',')
for RuleName in RuleNameList:
- Arch = 'COMMON'
- BuildType = 'COMMON'
+ Arch = TAB_COMMON
+ BuildType = TAB_COMMON
TokenList = [Token.strip().upper() for Token in RuleName.split('.')]
# old format: Build.File-Type
if TokenList[0] == "BUILD":
@@ -486,12 +486,12 @@ class BuildRule: self._BuildTypeList.add(BuildType)
self._ArchList.add(Arch)
- if 'COMMON' in self._BuildTypeList and len(self._BuildTypeList) > 1:
+ if TAB_COMMON in self._BuildTypeList and len(self._BuildTypeList) > 1:
EdkLogger.error("build", FORMAT_INVALID,
"Specific build types must not be mixed with common one",
File=self.RuleFile, Line=LineIndex + 1,
ExtraData=self.RuleContent[LineIndex])
- if 'COMMON' in self._ArchList and len(self._ArchList) > 1:
+ if TAB_COMMON in self._ArchList and len(self._ArchList) > 1:
EdkLogger.error("build", FORMAT_INVALID,
"Specific ARCH must not be mixed with common one",
File=self.RuleFile, Line=LineIndex + 1,
@@ -524,7 +524,7 @@ class BuildRule: if len(TokenList) > 1:
Family = TokenList[1].strip().upper()
else:
- Family = "COMMON"
+ Family = TAB_COMMON
if Family not in FamilyList:
FamilyList.append(Family)
@@ -532,7 +532,7 @@ class BuildRule: self._FamilyList = FamilyList
self._TotalToolChainFamilySet.update(FamilyList)
self._State = SectionType.upper()
- if 'COMMON' in FamilyList and len(FamilyList) > 1:
+ if TAB_COMMON in FamilyList and len(FamilyList) > 1:
EdkLogger.error("build", FORMAT_INVALID,
"Specific tool chain family should not be mixed with general one",
File=self.RuleFile, Line=LineIndex + 1,
|