diff options
Diffstat (limited to 'BaseTools/Source/Python/AutoGen')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/AutoGen.py | 16 | ||||
-rw-r--r-- | BaseTools/Source/Python/AutoGen/GenC.py | 27 | ||||
-rw-r--r-- | BaseTools/Source/Python/AutoGen/GenMake.py | 4 |
3 files changed, 23 insertions, 24 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index 259abc519b..fe56574357 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -40,7 +40,7 @@ from GenPatchPcdTable.GenPatchPcdTable import parsePcdInfoFromMapFile import Common.VpdInfoFile as VpdInfoFile
from GenPcdDb import CreatePcdDatabaseCode
from Workspace.MetaFileCommentParser import UsageList
-
+from Common.MultipleWorkspace import MultipleWorkspace as mws
import InfSectionParser
## Regular expression for splitting Dependency Expression string into tokens
@@ -953,7 +953,7 @@ class PlatformAutoGen(AutoGen): self._GuidValue = {}
FdfModuleList = []
for InfName in self._AsBuildInfList:
- InfName = os.path.join(self.WorkspaceDir, InfName)
+ InfName = mws.join(self.WorkspaceDir, InfName)
FdfModuleList.append(os.path.normpath(InfName))
for F in self.Platform.Modules.keys():
M = ModuleAutoGen(self.Workspace, F, self.BuildTarget, self.ToolChain, self.Arch, self.MetaFile)
@@ -1288,7 +1288,7 @@ class PlatformAutoGen(AutoGen): def _GetFdfFile(self):
if self._FdfFile == None:
if self.Workspace.FdfFile != "":
- self._FdfFile= path.join(self.WorkspaceDir, self.Workspace.FdfFile)
+ self._FdfFile= mws.join(self.WorkspaceDir, self.Workspace.FdfFile)
else:
self._FdfFile = ''
return self._FdfFile
@@ -2115,8 +2115,11 @@ class PlatformAutoGen(AutoGen): BuildOptions[Tool][Attr] = ""
# check if override is indicated
if Value.startswith('='):
- BuildOptions[Tool][Attr] = Value[1:]
+ ToolPath = Value[1:]
+ ToolPath = mws.handleWsMacro(ToolPath)
+ BuildOptions[Tool][Attr] = ToolPath
else:
+ Value = mws.handleWsMacro(Value)
BuildOptions[Tool][Attr] += " " + Value
if Module.AutoGenVersion < 0x00010005 and self.Workspace.UniFlag != None:
#
@@ -2193,8 +2196,7 @@ class ModuleAutoGen(AutoGen): return False
self.SourceDir = self.MetaFile.SubDir
- if self.SourceDir.upper().find(self.WorkspaceDir.upper()) == 0:
- self.SourceDir = self.SourceDir[len(self.WorkspaceDir) + 1:]
+ self.SourceDir = mws.relpath(self.SourceDir, self.WorkspaceDir)
self.SourceOverrideDir = None
# use overrided path defined in DSC file
@@ -3042,7 +3044,7 @@ class ModuleAutoGen(AutoGen): self._IncludePathList.append(self.DebugDir)
for Package in self.Module.Packages:
- PackageDir = path.join(self.WorkspaceDir, Package.MetaFile.Dir)
+ PackageDir = mws.join(self.WorkspaceDir, Package.MetaFile.Dir)
if PackageDir not in self._IncludePathList:
self._IncludePathList.append(PackageDir)
for Inc in Package.Includes:
diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Python/AutoGen/GenC.py index 77de1657f0..45fb9899f2 100644 --- a/BaseTools/Source/Python/AutoGen/GenC.py +++ b/BaseTools/Source/Python/AutoGen/GenC.py @@ -1384,22 +1384,21 @@ def CreateModuleUnloadImageCode(Info, AutoGenC, AutoGenH): # @param AutoGenH The TemplateString object for header file
#
def CreateGuidDefinitionCode(Info, AutoGenC, AutoGenH):
- if Info.IsLibrary:
- return
-
if Info.ModuleType in ["USER_DEFINED", "BASE"]:
GuidType = "GUID"
else:
GuidType = "EFI_GUID"
if Info.GuidList:
- AutoGenC.Append("\n// Guids\n")
+ if not Info.IsLibrary:
+ AutoGenC.Append("\n// Guids\n")
AutoGenH.Append("\n// Guids\n")
#
# GUIDs
#
for Key in Info.GuidList:
- AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s = %s;\n' % (GuidType, Key, Info.GuidList[Key]))
+ if not Info.IsLibrary:
+ AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s = %s;\n' % (GuidType, Key, Info.GuidList[Key]))
AutoGenH.Append('extern %s %s;\n' % (GuidType, Key))
## Create code for protocol
@@ -1409,22 +1408,21 @@ def CreateGuidDefinitionCode(Info, AutoGenC, AutoGenH): # @param AutoGenH The TemplateString object for header file
#
def CreateProtocolDefinitionCode(Info, AutoGenC, AutoGenH):
- if Info.IsLibrary:
- return
-
if Info.ModuleType in ["USER_DEFINED", "BASE"]:
GuidType = "GUID"
else:
GuidType = "EFI_GUID"
if Info.ProtocolList:
- AutoGenC.Append("\n// Protocols\n")
+ if not Info.IsLibrary:
+ AutoGenC.Append("\n// Protocols\n")
AutoGenH.Append("\n// Protocols\n")
#
# Protocol GUIDs
#
for Key in Info.ProtocolList:
- AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s = %s;\n' % (GuidType, Key, Info.ProtocolList[Key]))
+ if not Info.IsLibrary:
+ AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s = %s;\n' % (GuidType, Key, Info.ProtocolList[Key]))
AutoGenH.Append('extern %s %s;\n' % (GuidType, Key))
## Create code for PPI
@@ -1434,22 +1432,21 @@ def CreateProtocolDefinitionCode(Info, AutoGenC, AutoGenH): # @param AutoGenH The TemplateString object for header file
#
def CreatePpiDefinitionCode(Info, AutoGenC, AutoGenH):
- if Info.IsLibrary:
- return
-
if Info.ModuleType in ["USER_DEFINED", "BASE"]:
GuidType = "GUID"
else:
GuidType = "EFI_GUID"
if Info.PpiList:
- AutoGenC.Append("\n// PPIs\n")
+ if not Info.IsLibrary:
+ AutoGenC.Append("\n// PPIs\n")
AutoGenH.Append("\n// PPIs\n")
#
# PPI GUIDs
#
for Key in Info.PpiList:
- AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s = %s;\n' % (GuidType, Key, Info.PpiList[Key]))
+ if not Info.IsLibrary:
+ AutoGenC.Append('GLOBAL_REMOVE_IF_UNREFERENCED %s %s = %s;\n' % (GuidType, Key, Info.PpiList[Key]))
AutoGenH.Append('extern %s %s;\n' % (GuidType, Key))
## Create code for PCD
diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py index 0342709a3a..d9b219e1c7 100644 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -19,7 +19,7 @@ import string import re
import os.path as path
from Common.LongFilePathSupport import OpenLongFilePath as open
-
+from Common.MultipleWorkspace import MultipleWorkspace as mws
from Common.BuildToolError import *
from Common.Misc import *
from Common.String import *
@@ -559,7 +559,7 @@ cleanlib: found = False
while not found and os.sep in package_rel_dir:
index = package_rel_dir.index(os.sep)
- current_dir = os.path.join(current_dir, package_rel_dir[:index])
+ current_dir = mws.join(current_dir, package_rel_dir[:index])
for fl in os.listdir(current_dir):
if fl.endswith('.dec'):
found = True
|