X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FGenFds%2FSection.py;h=463faa378165084168b42db41b413a2ac642e851;hb=56326323e6579d4cde9802c684baba06acbdb1d2;hp=ef9720a660674cff33d872fadf66186cb4d4834a;hpb=b36d134faf4305247830522b8e2bb255e98c5699;p=mirror_edk2.git diff --git a/BaseTools/Source/Python/GenFds/Section.py b/BaseTools/Source/Python/GenFds/Section.py index ef9720a660..463faa3781 100644 --- a/BaseTools/Source/Python/GenFds/Section.py +++ b/BaseTools/Source/Python/GenFds/Section.py @@ -1,7 +1,7 @@ ## @file # section base class # -# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
+# Copyright (c) 2007-2017, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -17,7 +17,7 @@ # from CommonDataClass.FdfClass import SectionClassObject from GenFdsGlobalVariable import GenFdsGlobalVariable -import os, glob +import Common.LongFilePathOs as os, glob from Common import EdkLogger from Common.BuildToolError import * @@ -110,7 +110,7 @@ class Section (SectionClassObject): # @param Dict dictionary contains macro and its value # @retval tuple (File list, boolean) # - def GetFileList(FfsInf, FileType, FileExtension, Dict = {}): + def GetFileList(FfsInf, FileType, FileExtension, Dict = {}, IsMakefile=False): if FileType in Section.SectFileType.keys() : IsSect = True else : @@ -129,9 +129,11 @@ class Section (SectionClassObject): if FileType != None: for File in FfsInf.BinFileList: if File.Arch == "COMMON" or FfsInf.CurrentArch == File.Arch: - if File.Type == FileType or (int(FfsInf.PiSpecVersion, 16) >= 0x0001000A and FileType == 'DXE_DPEX'and File.Type == 'SMM_DEPEX'): + if File.Type == FileType or (int(FfsInf.PiSpecVersion, 16) >= 0x0001000A \ + and FileType == 'DXE_DPEX'and File.Type == 'SMM_DEPEX') \ + or (FileType == 'TE'and File.Type == 'PE32'): if '*' in FfsInf.TargetOverrideList or File.Target == '*' or File.Target in FfsInf.TargetOverrideList or FfsInf.TargetOverrideList == []: - FileList.append(File.Path) + FileList.append(FfsInf.PatchEfiFile(File.Path, File.Type)) else: GenFdsGlobalVariable.InfLogger ("\nBuild Target \'%s\' of File %s is not in the Scope of %s specified by INF %s in FDF" %(File.Target, File.File, FfsInf.TargetOverrideList, FfsInf.InfFileName)) else: @@ -139,11 +141,28 @@ class Section (SectionClassObject): else: 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)) - if Suffix != None: - SuffixMap = FfsInf.GetFinalTargetSuffixMap() - if Suffix in SuffixMap: - FileList.extend(SuffixMap[Suffix]) - + if (not IsMakefile and Suffix != None and os.path.exists(FfsInf.EfiOutputPath)) or (IsMakefile and Suffix != None): + # + # Get Makefile path and time stamp + # + MakefileDir = FfsInf.EfiOutputPath[:-len('OUTPUT')] + Makefile = os.path.join(MakefileDir, 'Makefile') + if not os.path.exists(Makefile): + Makefile = os.path.join(MakefileDir, 'GNUmakefile') + if os.path.exists(Makefile): + # Update to search files with suffix in all sub-dirs. + Tuple = os.walk(FfsInf.EfiOutputPath) + for Dirpath, Dirnames, Filenames in Tuple: + for F in Filenames: + if os.path.splitext(F)[1] == Suffix: + FullName = os.path.join(Dirpath, F) + if os.path.getmtime(FullName) > os.path.getmtime(Makefile): + FileList.append(FullName) + if not FileList: + SuffixMap = FfsInf.GetFinalTargetSuffixMap() + if Suffix in SuffixMap: + FileList.extend(SuffixMap[Suffix]) + #Process the file lists is alphabetical for a same section type if len (FileList) > 1: FileList.sort()