summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python
diff options
context:
space:
mode:
Diffstat (limited to 'BaseTools/Source/Python')
-rw-r--r--BaseTools/Source/Python/AutoGen/GenMake.py2
-rw-r--r--BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py10
-rw-r--r--BaseTools/Source/Python/Workspace/DscBuildData.py3
-rw-r--r--BaseTools/Source/Python/build/build.py10
4 files changed, 18 insertions, 7 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py
index 724e64e0ba..ed2368f6a3 100644
--- a/BaseTools/Source/Python/AutoGen/GenMake.py
+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
@@ -710,7 +710,7 @@ cleanlib:
for index, Str in enumerate(FfsCmdList):
if '-o' == Str:
OutputFile = FfsCmdList[index + 1]
- if '-i' == Str:
+ if '-i' == Str or "-oi" == Str:
if DepsFileList == []:
DepsFileList = [FfsCmdList[index + 1]]
else:
diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
index eb7a56d252..c9c476cf61 100644
--- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
+++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
@@ -29,6 +29,7 @@ import Common.DataType as DataType
from Common.Misc import PathClass
from Common.LongFilePathSupport import OpenLongFilePath as open
from Common.MultipleWorkspace import MultipleWorkspace as mws
+import Common.GlobalData as GlobalData
## Global variables
#
@@ -495,6 +496,10 @@ class GenFdsGlobalVariable:
SaveFileOnChange(CommandFile, ' '.join(Cmd), False)
if IsMakefile:
+ if GlobalData.gGlobalDefines.get("FAMILY") == "MSFT":
+ Cmd = ['if', 'exist', Input[0]] + Cmd
+ else:
+ Cmd = ['test', '-e', Input[0], "&&"] + Cmd
if ' '.join(Cmd).strip() not in GenFdsGlobalVariable.SecCmdList:
GenFdsGlobalVariable.SecCmdList.append(' '.join(Cmd).strip())
elif GenFdsGlobalVariable.NeedsUpdate(Output, list(Input) + [CommandFile]):
@@ -536,7 +541,10 @@ class GenFdsGlobalVariable:
Cmd += ("-o", Output)
for I in range(0, len(Input)):
- Cmd += ("-i", Input[I])
+ if MakefilePath:
+ Cmd += ("-oi", Input[I])
+ else:
+ Cmd += ("-i", Input[I])
if SectionAlign and SectionAlign[I]:
Cmd += ("-n", SectionAlign[I])
diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
index f34cf18056..5431296b5a 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -314,6 +314,9 @@ class DscBuildData(PlatformBuildClassObject):
@property
def Arch(self):
return self._Arch
+ @property
+ def Dir(self):
+ return self.MetaFile.Dir
## Retrieve all information in [Defines] section
#
diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py
index 587370caaf..9e6e5c15b2 100644
--- a/BaseTools/Source/Python/build/build.py
+++ b/BaseTools/Source/Python/build/build.py
@@ -1663,7 +1663,7 @@ class Build():
# Add ffs build to makefile
CmdListDict = {}
if GlobalData.gEnableGenfdsMultiThread and self.Fdf:
- CmdListDict = self._GenFfsCmd()
+ CmdListDict = self._GenFfsCmd(Wa.ArchList)
for Arch in Wa.ArchList:
GlobalData.gGlobalDefines['ARCH'] = Arch
@@ -1756,7 +1756,7 @@ class Build():
# Add ffs build to makefile
CmdListDict = None
if GlobalData.gEnableGenfdsMultiThread and self.Fdf:
- CmdListDict = self._GenFfsCmd()
+ CmdListDict = self._GenFfsCmd(Wa.ArchList)
self.Progress.Stop("done!")
MaList = []
ExitFlag = threading.Event()
@@ -1875,11 +1875,11 @@ class Build():
#
self._SaveMapFile (MapBuffer, Wa)
- def _GenFfsCmd(self):
+ def _GenFfsCmd(self,ArchList):
# convert dictionary of Cmd:(Inf,Arch)
# to a new dictionary of (Inf,Arch):Cmd,Cmd,Cmd...
CmdSetDict = defaultdict(set)
- GenFfsDict = GenFds.GenFfsMakefile('', GlobalData.gFdfParser, self, self.ArchList, GlobalData)
+ GenFfsDict = GenFds.GenFfsMakefile('', GlobalData.gFdfParser, self, ArchList, GlobalData)
for Cmd in GenFfsDict:
tmpInf, tmpArch = GenFfsDict[Cmd]
CmdSetDict[tmpInf, tmpArch].add(Cmd)
@@ -1923,7 +1923,7 @@ class Build():
# Add ffs build to makefile
CmdListDict = None
if GlobalData.gEnableGenfdsMultiThread and self.Fdf:
- CmdListDict = self._GenFfsCmd()
+ CmdListDict = self._GenFfsCmd(Wa.ArchList)
# multi-thread exit flag
ExitFlag = threading.Event()