# @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, FfsInf = None, Dict = {}) :\r
+ def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, FfsInf = None, Dict = {}, IsMakefile = False) :\r
\r
if self.FileName != None and self.FileName.startswith('PCD('):\r
self.FileName = GenFdsGlobalVariable.GetPcdValue(self.FileName)\r
FileList.append(Filename)\r
elif os.path.exists(Filename):\r
FileList.append(Filename)\r
+ elif '.depex' in FfsInf.FinalTargetSuffixMap or FfsInf.Depex:\r
+ FileList.append(Filename)\r
else:\r
FileList, IsSect = Section.Section.GetFileList(FfsInf, self.FileType, self.FileExtension, Dict)\r
if IsSect :\r
Num = SecNum\r
OutputFile = os.path.join( OutputPath, ModuleName + 'SEC' + str(Num) + Ffs.SectionSuffix.get(SectionType))\r
GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_SECTION_VERSION',\r
- #Ui=StringData, \r
- Ver=BuildNum)\r
+ #Ui=StringData,\r
+ Ver=BuildNum,\r
+ IsMakefile=IsMakefile)\r
OutputFileList.append(OutputFile)\r
\r
elif FileList != []:\r
if BuildNum != None and BuildNum != '':\r
BuildNumTuple = ('-j', BuildNum)\r
GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_SECTION_VERSION',\r
- #Ui=VerString, \r
- Ver=BuildNum)\r
+ #Ui=VerString,\r
+ Ver=BuildNum,\r
+ IsMakefile=IsMakefile)\r
OutputFileList.append(OutputFile)\r
\r
else:\r
Num = SecNum\r
OutputFile = os.path.join( OutputPath, ModuleName + 'SEC' + str(Num) + Ffs.SectionSuffix.get(SectionType))\r
GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_SECTION_VERSION',\r
- #Ui=VerString, \r
- Ver=BuildNum)\r
+ #Ui=VerString,\r
+ Ver=BuildNum,\r
+ IsMakefile=IsMakefile)\r
OutputFileList.append(OutputFile)\r
\r
#\r
Num = SecNum\r
OutputFile = os.path.join( OutputPath, ModuleName + 'SEC' + str(Num) + Ffs.SectionSuffix.get(SectionType))\r
GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_SECTION_USER_INTERFACE',\r
- Ui=StringData)\r
+ Ui=StringData, IsMakefile=IsMakefile)\r
OutputFileList.append(OutputFile)\r
\r
elif FileList != []:\r
UiString = f.read()\r
f.close()\r
GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_SECTION_USER_INTERFACE',\r
- Ui=UiString)\r
+ Ui=UiString, IsMakefile=IsMakefile)\r
OutputFileList.append(OutputFile)\r
else:\r
if StringData != None and len(StringData) > 0:\r
Num = SecNum\r
OutputFile = os.path.join( OutputPath, ModuleName + 'SEC' + str(Num) + Ffs.SectionSuffix.get(SectionType))\r
GenFdsGlobalVariable.GenerateSection(OutputFile, [], 'EFI_SECTION_USER_INTERFACE',\r
- Ui=StringData)\r
+ Ui=StringData, IsMakefile=IsMakefile)\r
OutputFileList.append(OutputFile)\r
\r
\r
\r
if File[(len(File)-4):] == '.efi':\r
MapFile = File.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 \\r
- (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 \\r
+ (os.path.getmtime(MapFile) > os.path.getmtime(CopyMapFile)):\r
+ CopyLongFilePath(MapFile, CopyMapFile)\r
\r
if not NoStrip:\r
FileBeforeStrip = os.path.join(OutputPath, ModuleName + '.efi')\r
- if not os.path.exists(FileBeforeStrip) or \\r
- (os.path.getmtime(File) > os.path.getmtime(FileBeforeStrip)):\r
- CopyLongFilePath(File, FileBeforeStrip)\r
+ if IsMakefile:\r
+ if GenFdsGlobalVariable.CopyList == []:\r
+ GenFdsGlobalVariable.CopyList = [(File, FileBeforeStrip)]\r
+ else:\r
+ GenFdsGlobalVariable.CopyList.append((File, FileBeforeStrip))\r
+ else:\r
+ if not os.path.exists(FileBeforeStrip) or \\r
+ (os.path.getmtime(File) > os.path.getmtime(FileBeforeStrip)):\r
+ CopyLongFilePath(File, FileBeforeStrip)\r
StrippedFile = os.path.join(OutputPath, ModuleName + '.stripped')\r
GenFdsGlobalVariable.GenerateFirmwareImage(\r
- StrippedFile,\r
- [File],\r
- Strip=True\r
- )\r
+ StrippedFile,\r
+ [File],\r
+ Strip=True,\r
+ IsMakefile = IsMakefile\r
+ )\r
File = StrippedFile\r
\r
"""For TE Section call GenFw to generate TE image"""\r
if SectionType == 'TE':\r
TeFile = os.path.join( OutputPath, ModuleName + 'Te.raw')\r
GenFdsGlobalVariable.GenerateFirmwareImage(\r
- TeFile,\r
- [File],\r
- Type='te'\r
- )\r
+ TeFile,\r
+ [File],\r
+ Type='te',\r
+ IsMakefile = IsMakefile\r
+ )\r
File = TeFile\r
\r
"""Call GenSection"""\r
GenFdsGlobalVariable.GenerateSection(OutputFile,\r
- [File],\r
- Section.Section.SectionType.get (SectionType)\r
- )\r
+ [File],\r
+ Section.Section.SectionType.get (SectionType),\r
+ IsMakefile=IsMakefile\r
+ )\r
OutputFileList.append(OutputFile)\r
\r
return OutputFileList, Align\r