summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BaseTools/Source/Python/AutoGen/GenMake.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py
index 1d49a0316d..0342709a3a 100644
--- a/BaseTools/Source/Python/AutoGen/GenMake.py
+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
@@ -555,8 +555,16 @@ cleanlib:
LibraryMakeCommandList.append(Command)
package_rel_dir = self._AutoGenObject.SourceDir
- if os.sep in package_rel_dir:
- package_rel_dir = package_rel_dir[package_rel_dir.index(os.sep) + 1:]
+ current_dir = self.Macros["WORKSPACE"]
+ 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])
+ for fl in os.listdir(current_dir):
+ if fl.endswith('.dec'):
+ found = True
+ break
+ package_rel_dir = package_rel_dir[index + 1:]
MakefileTemplateDict = {
"makefile_header" : self._FILE_HEADER_[self._FileType],