summaryrefslogtreecommitdiff
path: root/BaseTools/Source
diff options
context:
space:
mode:
authorMarvin Haeuser <Marvin.Haeuser@outlook.com>2016-02-21 08:46:58 +0800
committerHao Wu <hao.a.wu@intel.com>2016-03-11 10:44:49 +0800
commit27ad524b9ac117ccb0438c9d4fac5cb49fdd17ee (patch)
treed3f98005aba79c0f950b59a8ae5685a62793f279 /BaseTools/Source
parent4349c91a34c981a87691500af849943cabbd54d3 (diff)
downloadedk2-platforms-27ad524b9ac117ccb0438c9d4fac5cb49fdd17ee.tar.xz
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> (cherry picked from commit 01e418d652bb3a7cbacc82d74fab1cc5260d0e1f)
Diffstat (limited to 'BaseTools/Source')
-rw-r--r--BaseTools/Source/Python/AutoGen/GenMake.py8
1 files changed, 5 insertions, 3 deletions
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,