summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/AutoGen/GenMake.py
diff options
context:
space:
mode:
authorMarvin Haeuser <Marvin.Haeuser@outlook.com>2016-02-21 08:46:58 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2016-03-09 10:05:27 +0800
commit01e418d652bb3a7cbacc82d74fab1cc5260d0e1f (patch)
tree32951973819c25ff6af419187d036b76e4c51d23 /BaseTools/Source/Python/AutoGen/GenMake.py
parent7c50b3434377cbb49ce4514ee31339000a5cadc0 (diff)
downloadedk2-01e418d652bb3a7cbacc82d74fab1cc5260d0e1f.tar.gz
edk2-01e418d652bb3a7cbacc82d74fab1cc5260d0e1f.tar.bz2
edk2-01e418d652bb3a7cbacc82d74fab1cc5260d0e1f.zip
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>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/GenMake.py')
-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,