From 27ad524b9ac117ccb0438c9d4fac5cb49fdd17ee Mon Sep 17 00:00:00 2001 From: Marvin Haeuser Date: Sun, 21 Feb 2016 08:46:58 +0800 Subject: BaseTools: Add Multiple Workspaces support for custom Makefiles. This patch makes sure the MODULE_DIR variable points to the correct location when multiple workspaces are used. Currently, it is always prefixed with $(WORKSPACE), which only works as long as the package is in the Workspace. Code modules were not effected because the required paths were valid, but for custom Makefiles, the MODULE_DIR variable is used. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Marvin Haeuser Reviewed-by: Yonghong Zhu (cherry picked from commit 01e418d652bb3a7cbacc82d74fab1cc5260d0e1f) --- BaseTools/Source/Python/AutoGen/GenMake.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'BaseTools') diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py index 89285c1254..ec24c70fd3 100644 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -249,7 +249,7 @@ MODULE_FILE_BASE_NAME = ${module_file_base_name} BASE_NAME = $(MODULE_NAME) MODULE_RELATIVE_DIR = ${module_relative_directory} PACKAGE_RELATIVE_DIR = ${package_relative_directory} -MODULE_DIR = $(WORKSPACE)${separator}${module_relative_directory} +MODULE_DIR = ${module_dir} MODULE_ENTRY_POINT = ${module_entry_point} ARCH_ENTRY_POINT = ${arch_entry_point} @@ -584,6 +584,7 @@ cleanlib: "module_file" : self._AutoGenObject.MetaFile.Name, "module_file_base_name" : self._AutoGenObject.MetaFile.BaseName, "module_relative_directory" : self._AutoGenObject.SourceDir, + "module_dir" : mws.join (self.Macros["WORKSPACE"], self._AutoGenObject.SourceDir), "package_relative_directory": package_rel_dir, "module_extra_defines" : ["%s = %s" % (k, v) for k, v in self._AutoGenObject.Module.Defines.iteritems()], @@ -863,7 +864,7 @@ MODULE_FILE = ${module_file} MODULE_FILE_BASE_NAME = ${module_file_base_name} BASE_NAME = $(MODULE_NAME) MODULE_RELATIVE_DIR = ${module_relative_directory} -MODULE_DIR = $(WORKSPACE)${separator}${module_relative_directory} +MODULE_DIR = ${module_dir} # # Build Configuration Macro Definition @@ -944,7 +945,7 @@ ${BEGIN}\t-@${create_directory_command}\n${END}\ if self._FileType not in self._AutoGenObject.CustomMakefile: EdkLogger.error('build', OPTION_NOT_SUPPORTED, "No custom makefile for %s" % self._FileType, ExtraData="[%s]" % str(self._AutoGenObject)) - MakefilePath = os.path.join( + MakefilePath = mws.join( self._AutoGenObject.WorkspaceDir, self._AutoGenObject.CustomMakefile[self._FileType] ) @@ -987,6 +988,7 @@ ${BEGIN}\t-@${create_directory_command}\n${END}\ "module_file" : self._AutoGenObject.MetaFile, "module_file_base_name" : self._AutoGenObject.MetaFile.BaseName, "module_relative_directory" : self._AutoGenObject.SourceDir, + "module_dir" : mws.join (self._AutoGenObject.WorkspaceDir, self._AutoGenObject.SourceDir), "architecture" : self._AutoGenObject.Arch, "toolchain_tag" : self._AutoGenObject.ToolChain, -- cgit v1.2.3