diff options
Diffstat (limited to 'BaseTools/Source/Python')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/AutoGen.py | 5 | ||||
-rw-r--r-- | BaseTools/Source/Python/Common/BuildVersion.py | 2 | ||||
-rw-r--r-- | BaseTools/Source/Python/Common/GlobalData.py | 4 | ||||
-rw-r--r-- | BaseTools/Source/Python/GenFds/FdfParser.py | 19 | ||||
-rw-r--r-- | BaseTools/Source/Python/build/build.py | 5 |
5 files changed, 30 insertions, 5 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index d51c59e204..55a6a81ccc 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -207,8 +207,13 @@ class WorkspaceAutoGen(AutoGen): # Make global macros available when parsing FDF file
#
InputMacroDict.update(self.BuildDatabase.WorkspaceDb._GlobalMacros)
+ #
+ # Mark now build in AutoGen Phase
+ #
+ GlobalData.gAutoGenPhase = True
Fdf = FdfParser(self.FdfFile.Path)
Fdf.ParseFile()
+ GlobalData.gAutoGenPhase = False
PcdSet = Fdf.Profile.PcdDict
ModuleList = Fdf.Profile.InfList
self.FdfProfile = Fdf.Profile
diff --git a/BaseTools/Source/Python/Common/BuildVersion.py b/BaseTools/Source/Python/Common/BuildVersion.py index 7425810fe3..48316716b1 100644 --- a/BaseTools/Source/Python/Common/BuildVersion.py +++ b/BaseTools/Source/Python/Common/BuildVersion.py @@ -1,3 +1,3 @@ #This file is for build version number auto generation
#
-gBUILD_VERSION = "Build 2318"
+gBUILD_VERSION = "Build 2322"
diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Source/Python/Common/GlobalData.py index ec6456faac..37ae2d33eb 100644 --- a/BaseTools/Source/Python/Common/GlobalData.py +++ b/BaseTools/Source/Python/Common/GlobalData.py @@ -34,3 +34,7 @@ gBuildingModule = '' ## Regular expression for matching macro used in DSC/DEC/INF file inclusion gMacroPattern = re.compile("\$\(([_A-Z][_A-Z0-9]*)\)", re.UNICODE) +# +# A global variable for whether current build in AutoGen phase or not. +# +gAutoGenPhase = False diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index c4b3f273f0..6a9e5b7b40 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -45,6 +45,7 @@ from Common.BuildToolError import * from Common import EdkLogger
from Common.Misc import PathClass
from Common.String import NormPath
+from Common import GlobalData
import re
import os
@@ -2416,10 +2417,20 @@ class FdfParser: else:
FfsFileObj.FileName = self.__Token
if FfsFileObj.FileName.replace('$(WORKSPACE)', '').find('$') == -1:
- #do case sensitive check for file path
- ErrorCode, ErrorInfo = PathClass(NormPath(FfsFileObj.FileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
- if ErrorCode != 0:
- EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
+ #
+ # For file in OUTPUT_DIRECTORY will not check whether it exist or not at AutoGen phase.
+ #
+ if not GlobalData.gAutoGenPhase:
+ #do case sensitive check for file path
+ ErrorCode, ErrorInfo = PathClass(NormPath(FfsFileObj.FileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
+ if ErrorCode != 0:
+ EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
+ else:
+ if not InputMacroDict["OUTPUT_DIRECTORY"] in FfsFileObj.FileName:
+ #do case sensitive check for file path
+ ErrorCode, ErrorInfo = PathClass(NormPath(FfsFileObj.FileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
+ if ErrorCode != 0:
+ EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
if not self.__IsToken( "}"):
raise Warning("expected '}'", self.FileName, self.CurrentLineNumber)
diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index 51deb3890c..9502bf3364 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -912,6 +912,10 @@ class Build(): EdkLogger.info("No flash definition file found. FV [%s] will be ignored." % " ".join(self.FvList))
self.FvList = []
else:
+ #
+ # Mark now build in AutoGen Phase
+ #
+ GlobalData.gAutoGenPhase = True
FdfParserObj = FdfParser(str(self.Fdf))
for key in self.Db._GlobalMacros:
InputMacroDict[key] = self.Db._GlobalMacros[key]
@@ -920,6 +924,7 @@ class Build(): if fvname.upper() not in FdfParserObj.Profile.FvDict.keys():
EdkLogger.error("build", OPTION_VALUE_INVALID,
"No such an FV in FDF file: %s" % fvname)
+ GlobalData.gAutoGenPhase = False
#
# Merge Arch
|