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 <Marvin.Haeuser@outlook.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
Marvin Haeuser 2016-02-21 08:46:58 +08:00 committed by Yonghong Zhu
parent 7c50b34343
commit 01e418d652
1 changed files with 5 additions and 3 deletions

View File

@ -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,