]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/IncludesAutoGen.py
BaseTools: add '-p' for Linux 'cp' command.
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / IncludesAutoGen.py
index c3e6333217c44adcd104b2bdba6ce60eb24df5cc..5ec26eb98b428dc8dfdc92d0d6f2e814c7b20980 100644 (file)
@@ -201,7 +201,17 @@ ${END}
                             cc_options = line[len(cc_cmd)+2:].split()\r
                         else:\r
                             cc_options = line[len(cc_cmd):].split()\r
-                        SourceFileAbsPathMap = {os.path.basename(item):item for item in cc_options if not item.startswith("/") and os.path.exists(item)}\r
+                        for item in cc_options:\r
+                            if not item.startswith("/"):\r
+                                if item.endswith(".txt") and item.startswith("@"):\r
+                                    with open(item[1:], "r") as file:\r
+                                        source_files = file.readlines()[0].split()\r
+                                        SourceFileAbsPathMap = {os.path.basename(file): file for file in source_files if\r
+                                                                os.path.exists(file)}\r
+                                else:\r
+                                    if os.path.exists(item):\r
+                                        SourceFileAbsPathMap.update({os.path.basename(item): item.strip()})\r
+                        # SourceFileAbsPathMap = {os.path.basename(item):item for item in cc_options if not item.startswith("/") and os.path.exists(item)}\r
             if line in SourceFileAbsPathMap:\r
                 current_source = line\r
                 if current_source not in ModuleDepDict:\r
@@ -281,7 +291,8 @@ ${END}
                 targetitem = self.GetRealTarget(source_abs.strip(" :"))\r
 \r
                 targetitem += ": "\r
-                targetitem += lines[1]\r
+                if len(lines)>=2:\r
+                    targetitem += lines[1]\r
                 newcontent.append(targetitem)\r
                 newcontent.extend(lines[2:])\r
                 newcontent.append("\n")\r