]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/Section.py
BaseTools: Autogen - modify to use standard parent/child class relationships
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / Section.py
index 32314d6b7fb3edc66cc1065981ff7be833da5a14..463faa378165084168b42db41b413a2ac642e851 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # section base class\r
 #\r
-#  Copyright (c) 2007-2014, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007-2017, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -110,7 +110,7 @@ class Section (SectionClassObject):
     #   @param  Dict        dictionary contains macro and its value\r
     #   @retval tuple       (File list, boolean)\r
     #\r
-    def GetFileList(FfsInf, FileType, FileExtension, Dict = {}):\r
+    def GetFileList(FfsInf, FileType, FileExtension, Dict = {}, IsMakefile=False):\r
         if FileType in Section.SectFileType.keys() :\r
             IsSect = True\r
         else :\r
@@ -141,7 +141,7 @@ class Section (SectionClassObject):
                 else:\r
                     GenFdsGlobalVariable.InfLogger ("\nCurrent ARCH \'%s\' of File %s is not in the Support Arch Scope of %s specified by INF %s in FDF" %(FfsInf.CurrentArch, File.File, File.Arch, FfsInf.InfFileName))\r
 \r
-        if Suffix != None and os.path.exists(FfsInf.EfiOutputPath):\r
+        if (not IsMakefile and Suffix != None and os.path.exists(FfsInf.EfiOutputPath)) or (IsMakefile and Suffix != None):\r
             #\r
             # Get Makefile path and time stamp\r
             #\r
@@ -149,20 +149,20 @@ class Section (SectionClassObject):
             Makefile = os.path.join(MakefileDir, 'Makefile')\r
             if not os.path.exists(Makefile):\r
                 Makefile = os.path.join(MakefileDir, 'GNUmakefile')\r
-            if not os.path.exists(Makefile):\r
-                SuffixMap = FfsInf.GetFinalTargetSuffixMap()\r
-                if Suffix in SuffixMap:\r
-                    FileList.extend(SuffixMap[Suffix])\r
-            else:\r
+            if os.path.exists(Makefile):\r
                 # Update to search files with suffix in all sub-dirs.\r
                 Tuple = os.walk(FfsInf.EfiOutputPath)\r
                 for Dirpath, Dirnames, Filenames in Tuple:\r
                     for F in Filenames:\r
-                        if os.path.splitext(F)[1] in (Suffix):\r
+                        if os.path.splitext(F)[1] == Suffix:\r
                             FullName = os.path.join(Dirpath, F)\r
                             if os.path.getmtime(FullName) > os.path.getmtime(Makefile):\r
                                 FileList.append(FullName)\r
-\r
+            if not FileList:\r
+                SuffixMap = FfsInf.GetFinalTargetSuffixMap()\r
+                if Suffix in SuffixMap:\r
+                    FileList.extend(SuffixMap[Suffix])\r
+                \r
         #Process the file lists is alphabetical for a same section type\r
         if len (FileList) > 1:\r
             FileList.sort()\r