diff options
Diffstat (limited to 'BaseTools/Source/Python/build/build.py')
-rw-r--r-- | BaseTools/Source/Python/build/build.py | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index 84f5636414..b794c0a361 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -1,7 +1,7 @@ ## @file
# build a platform or a module
#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2011, 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
@@ -102,7 +102,8 @@ def CheckEnvVariable(): #
# Check EFI_SOURCE (R8 build convention). EDK_SOURCE will always point to ECP
#
- os.environ["ECP_SOURCE"] = os.path.join(WorkspaceDir, GlobalData.gEdkCompatibilityPkg)
+ if "ECP_SOURCE" not in os.environ:
+ os.environ["ECP_SOURCE"] = os.path.join(WorkspaceDir, GlobalData.gEdkCompatibilityPkg)
if "EFI_SOURCE" not in os.environ:
os.environ["EFI_SOURCE"] = os.environ["ECP_SOURCE"]
if "EDK_SOURCE" not in os.environ:
@@ -888,7 +889,7 @@ class Build(): self.LoadFixAddress = int (LoadFixAddressString, 16)
else:
self.LoadFixAddress = int (LoadFixAddressString)
- except: + except:
EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMORY_ADDRESS %s is not valid dec or hex string" % (LoadFixAddressString))
if self.LoadFixAddress < 0:
EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMORY_ADDRESS is set to the invalid negative value %s" % (LoadFixAddressString))
@@ -908,6 +909,8 @@ class Build(): self.FvList = []
else:
FdfParserObj = FdfParser(str(self.Fdf))
+ for key in self.Db._GlobalMacros:
+ InputMacroDict[key] = self.Db._GlobalMacros[key]
FdfParserObj.ParseFile()
for fvname in self.FvList:
if fvname.upper() not in FdfParserObj.Profile.FvDict.keys():
@@ -974,6 +977,7 @@ class Build(): if not self.SkipAutoGen or Target == 'genmake':
self.Progress.Start("Generating makefile")
AutoGenObject.CreateMakeFile(CreateDepsMakeFile)
+ AutoGenObject.CreateAsBuiltInf()
self.Progress.Stop("done!")
if Target == "genmake":
return True
@@ -1007,8 +1011,8 @@ class Build(): InfFileNameList = ModuleList.keys()
#InfFileNameList.sort()
for InfFile in InfFileNameList:
- sys.stdout.write (".") - sys.stdout.flush() + sys.stdout.write (".")
+ sys.stdout.flush()
ModuleInfo = ModuleList[InfFile]
ModuleName = ModuleInfo.BaseName
ModuleOutputImage = ModuleInfo.Image.FileName
@@ -1141,8 +1145,8 @@ class Build(): ## Collect MAP information of all modules
#
def _CollectModuleMapBuffer (self, MapBuffer, ModuleList):
- sys.stdout.write ("Generate Load Module At Fix Address Map") - sys.stdout.flush() + sys.stdout.write ("Generate Load Module At Fix Address Map")
+ sys.stdout.flush()
PatchEfiImageList = []
PeiModuleList = {}
BtModuleList = {}
@@ -1187,11 +1191,11 @@ class Build(): SmmModuleList[Module.MetaFile] = ImageInfo
SmmSize += ImageInfo.Image.Size
if Module.ModuleType == 'DXE_SMM_DRIVER':
- PiSpecVersion = 0 - if 'PI_SPECIFICATION_VERSION' in Module.Module.Specification: - PiSpecVersion = Module.Module.Specification['PI_SPECIFICATION_VERSION'] + PiSpecVersion = '0x00000000'
+ if 'PI_SPECIFICATION_VERSION' in Module.Module.Specification:
+ PiSpecVersion = Module.Module.Specification['PI_SPECIFICATION_VERSION']
# for PI specification < PI1.1, DXE_SMM_DRIVER also runs as BOOT time driver.
- if PiSpecVersion < 0x0001000A:
+ if int(PiSpecVersion, 16) < 0x0001000A:
BtModuleList[Module.MetaFile] = ImageInfo
BtSize += ImageInfo.Image.Size
break
@@ -1245,7 +1249,7 @@ class Build(): #
# Get PCD offset in EFI image by GenPatchPcdTable function
#
- PcdTable = parsePcdInfoFromMapFile(EfiImageMap, EfiImage) + PcdTable = parsePcdInfoFromMapFile(EfiImageMap, EfiImage)
#
# Patch real PCD value by PatchPcdValue tool
#
@@ -1277,8 +1281,8 @@ class Build(): self._RebaseModule (MapBuffer, RtBaseAddr, RtModuleList, TopMemoryAddress == 0)
self._RebaseModule (MapBuffer, 0x1000, SmmModuleList, AddrIsOffset = False, ModeIsSmm = True)
MapBuffer.write('\n\n')
- sys.stdout.write ("\n") - sys.stdout.flush() + sys.stdout.write ("\n")
+ sys.stdout.flush()
## Save platform Map file
#
@@ -1291,10 +1295,10 @@ class Build(): # Save address map into MAP file.
#
SaveFileOnChange(MapFilePath, MapBuffer.getvalue(), False)
- MapBuffer.close() - if self.LoadFixAddress != 0: - sys.stdout.write ("\nLoad Module At Fix Address Map file can be found at %s\n" %(MapFilePath)) - sys.stdout.flush() + MapBuffer.close()
+ if self.LoadFixAddress != 0:
+ sys.stdout.write ("\nLoad Module At Fix Address Map file can be found at %s\n" %(MapFilePath))
+ sys.stdout.flush()
## Build active platform for different build targets and different tool chains
#
@@ -1487,6 +1491,7 @@ class Build(): if not self.SkipAutoGen or self.Target == 'genmake':
Ma.CreateMakeFile(True)
+ Ma.CreateAsBuiltInf()
if self.Target == "genmake":
continue
self.Progress.Stop("done!")
|