X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FGenFds%2FDataSection.py;h=2d2975f75c0f5ae0ba8509a9cf6e836fcc9a6fdf;hp=78c0af4db1ab2c4e9e8a6782f5831ad4ef1e1a78;hb=37de70b764200718cc39a21abc491c335e3da7b3;hpb=b37b108d92aa08cc7eed5f52feea53b0e7563068 diff --git a/BaseTools/Source/Python/GenFds/DataSection.py b/BaseTools/Source/Python/GenFds/DataSection.py index 78c0af4db1..2d2975f75c 100644 --- a/BaseTools/Source/Python/GenFds/DataSection.py +++ b/BaseTools/Source/Python/GenFds/DataSection.py @@ -48,7 +48,7 @@ class DataSection (DataSectionClassObject): # @param Dict dictionary contains macro and its value # @retval tuple (Generated file name list, section alignment) # - def GenSection(self, OutputPath, ModuleName, SecNum, keyStringList, FfsFile = None, Dict = {}): + def GenSection(self, OutputPath, ModuleName, SecNum, keyStringList, FfsFile = None, Dict = {}, IsMakefile = False): # # Prepare the parameter of GenSection # @@ -69,10 +69,16 @@ class DataSection (DataSectionClassObject): Filename = GenFdsGlobalVariable.MacroExtend(self.SectFileName) if Filename[(len(Filename)-4):] == '.efi': MapFile = Filename.replace('.efi', '.map') - if os.path.exists(MapFile): - CopyMapFile = os.path.join(OutputPath, ModuleName + '.map') - if not os.path.exists(CopyMapFile) or (os.path.getmtime(MapFile) > os.path.getmtime(CopyMapFile)): - CopyLongFilePath(MapFile, CopyMapFile) + CopyMapFile = os.path.join(OutputPath, ModuleName + '.map') + if IsMakefile: + if GenFdsGlobalVariable.CopyList == []: + GenFdsGlobalVariable.CopyList = [(MapFile, CopyMapFile)] + else: + GenFdsGlobalVariable.CopyList.append((MapFile, CopyMapFile)) + else: + if os.path.exists(MapFile): + if not os.path.exists(CopyMapFile) or (os.path.getmtime(MapFile) > os.path.getmtime(CopyMapFile)): + CopyLongFilePath(MapFile, CopyMapFile) #Get PE Section alignment when align is set to AUTO if self.Alignment == 'Auto' and self.SecType in ('TE', 'PE32'): @@ -96,24 +102,25 @@ class DataSection (DataSectionClassObject): CopyLongFilePath(self.SectFileName, FileBeforeStrip) StrippedFile = os.path.join(OutputPath, ModuleName + '.stripped') GenFdsGlobalVariable.GenerateFirmwareImage( - StrippedFile, - [GenFdsGlobalVariable.MacroExtend(self.SectFileName, Dict)], - Strip=True - ) + StrippedFile, + [GenFdsGlobalVariable.MacroExtend(self.SectFileName, Dict)], + Strip=True, + IsMakefile = IsMakefile + ) self.SectFileName = StrippedFile if self.SecType == 'TE': TeFile = os.path.join( OutputPath, ModuleName + 'Te.raw') GenFdsGlobalVariable.GenerateFirmwareImage( - TeFile, - [GenFdsGlobalVariable.MacroExtend(self.SectFileName, Dict)], - Type='te' - ) + TeFile, + [GenFdsGlobalVariable.MacroExtend(self.SectFileName, Dict)], + Type='te', + IsMakefile = IsMakefile + ) self.SectFileName = TeFile OutputFile = os.path.join (OutputPath, ModuleName + 'SEC' + SecNum + Ffs.SectionSuffix.get(self.SecType)) OutputFile = os.path.normpath(OutputFile) - - GenFdsGlobalVariable.GenerateSection(OutputFile, [self.SectFileName], Section.Section.SectionType.get(self.SecType)) + GenFdsGlobalVariable.GenerateSection(OutputFile, [self.SectFileName], Section.Section.SectionType.get(self.SecType), IsMakefile = IsMakefile) FileList = [OutputFile] return FileList, self.Alignment