# @param Dict dictionary contains macro and its value\r
# @retval tuple (Generated file name list, section alignment)\r
#\r
- def GenSection(self, OutputPath, ModuleName, SecNum, keyStringList, FfsFile = None, Dict = {}):\r
+ def GenSection(self, OutputPath, ModuleName, SecNum, keyStringList, FfsFile = None, Dict = {}, IsMakefile = False):\r
#\r
# Prepare the parameter of GenSection\r
#\r
Filename = GenFdsGlobalVariable.MacroExtend(self.SectFileName)\r
if Filename[(len(Filename)-4):] == '.efi':\r
MapFile = Filename.replace('.efi', '.map')\r
- if os.path.exists(MapFile):\r
- CopyMapFile = os.path.join(OutputPath, ModuleName + '.map')\r
- if not os.path.exists(CopyMapFile) or (os.path.getmtime(MapFile) > os.path.getmtime(CopyMapFile)):\r
- CopyLongFilePath(MapFile, CopyMapFile)\r
+ CopyMapFile = os.path.join(OutputPath, ModuleName + '.map')\r
+ if IsMakefile:\r
+ if GenFdsGlobalVariable.CopyList == []:\r
+ GenFdsGlobalVariable.CopyList = [(MapFile, CopyMapFile)]\r
+ else:\r
+ GenFdsGlobalVariable.CopyList.append((MapFile, CopyMapFile))\r
+ else:\r
+ if os.path.exists(MapFile):\r
+ if not os.path.exists(CopyMapFile) or (os.path.getmtime(MapFile) > os.path.getmtime(CopyMapFile)):\r
+ CopyLongFilePath(MapFile, CopyMapFile)\r
\r
#Get PE Section alignment when align is set to AUTO\r
if self.Alignment == 'Auto' and self.SecType in ('TE', 'PE32'):\r
CopyLongFilePath(self.SectFileName, FileBeforeStrip)\r
StrippedFile = os.path.join(OutputPath, ModuleName + '.stripped')\r
GenFdsGlobalVariable.GenerateFirmwareImage(\r
- StrippedFile,\r
- [GenFdsGlobalVariable.MacroExtend(self.SectFileName, Dict)],\r
- Strip=True\r
- )\r
+ StrippedFile,\r
+ [GenFdsGlobalVariable.MacroExtend(self.SectFileName, Dict)],\r
+ Strip=True,\r
+ IsMakefile = IsMakefile\r
+ )\r
self.SectFileName = StrippedFile\r
\r
if self.SecType == 'TE':\r
TeFile = os.path.join( OutputPath, ModuleName + 'Te.raw')\r
GenFdsGlobalVariable.GenerateFirmwareImage(\r
- TeFile,\r
- [GenFdsGlobalVariable.MacroExtend(self.SectFileName, Dict)],\r
- Type='te'\r
- )\r
+ TeFile,\r
+ [GenFdsGlobalVariable.MacroExtend(self.SectFileName, Dict)],\r
+ Type='te',\r
+ IsMakefile = IsMakefile\r
+ )\r
self.SectFileName = TeFile\r
\r
OutputFile = os.path.join (OutputPath, ModuleName + 'SEC' + SecNum + Ffs.SectionSuffix.get(self.SecType))\r
OutputFile = os.path.normpath(OutputFile)\r
-\r
- GenFdsGlobalVariable.GenerateSection(OutputFile, [self.SectFileName], Section.Section.SectionType.get(self.SecType))\r
+ GenFdsGlobalVariable.GenerateSection(OutputFile, [self.SectFileName], Section.Section.SectionType.get(self.SecType), IsMakefile = IsMakefile)\r
FileList = [OutputFile]\r
return FileList, self.Alignment\r