Revision: 17642
          http://sourceforge.net/p/edk2/code/17642
Author:   yingke
Date:     2015-06-16 04:23:00 +0000 (Tue, 16 Jun 2015)
Log Message:
-----------
BaseTools: Fixed a bug to generate correct path of PACKAGE_RELATIVE_PATH

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yingke Liu <[email protected]>
Reviewed-by: Liming Gao <[email protected]>

Modified Paths:
--------------
    trunk/edk2/BaseTools/Source/Python/AutoGen/GenMake.py

Modified: trunk/edk2/BaseTools/Source/Python/AutoGen/GenMake.py
===================================================================
--- trunk/edk2/BaseTools/Source/Python/AutoGen/GenMake.py       2015-06-16 
02:55:54 UTC (rev 17641)
+++ trunk/edk2/BaseTools/Source/Python/AutoGen/GenMake.py       2015-06-16 
04:23:00 UTC (rev 17642)
@@ -555,8 +555,16 @@
             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],


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to