X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FGenFds%2FSection.py;h=fc25447dfdcd57b857930dbbadef6e44e9c5014a;hb=b21a13fbb61e0232ea98b0d7b305e24e67e50b0a;hp=2e24697a3dc7b4ee18abdae99752a975e0527c52;hpb=52302d4dee589a5df43a464420c9fe68ba83937d;p=mirror_edk2.git diff --git a/BaseTools/Source/Python/GenFds/Section.py b/BaseTools/Source/Python/GenFds/Section.py index 2e24697a3d..fc25447dfd 100644 --- a/BaseTools/Source/Python/GenFds/Section.py +++ b/BaseTools/Source/Python/GenFds/Section.py @@ -1,9 +1,9 @@ ## @file # section base class # -# Copyright (c) 2007, Intel Corporation +# Copyright (c) 2007-2015, Intel Corporation. All rights reserved.
# -# All rights reserved. This program and the accompanying materials +# This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found at # http://opensource.org/licenses/bsd-license.php @@ -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 * @@ -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 (FfsInf.PiSpecVersion >= 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: @@ -140,14 +142,27 @@ class Section (SectionClassObject): 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 and os.path.exists(FfsInf.EfiOutputPath): - # 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] in (Suffix): - FullName = os.path.join(Dirpath, F) - FileList.append(FullName) - + # + # 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] in (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()