\r
EdkLogger.verbose("\nFLASH_DEFINITION = %s" % self.FdfFile)\r
\r
- if Progress:\r
- Progress.Start("\nProcessing meta-data")\r
+# if Progress:\r
+# Progress.Start("\nProcessing meta-data")\r
\r
if self.FdfFile:\r
#\r
content += 'Flash Image Definition: '\r
content += str(self.FdfFile)\r
content += os.linesep\r
- if GlobalData.gBinCacheDest:\r
- content += 'Cache of .efi location: '\r
- content += str(GlobalData.gBinCacheDest)\r
SaveFileOnChange(os.path.join(self.BuildDir, 'BuildOptions'), content, False)\r
\r
#\r
# @param CreateModuleMakeFile Flag indicating if the makefile for\r
# modules will be created as well\r
#\r
- def CreateMakeFile(self, CreateModuleMakeFile=False):\r
+ def CreateMakeFile(self, CreateModuleMakeFile=False, FfsCommand = {}):\r
if CreateModuleMakeFile:\r
for ModuleFile in self.Platform.Modules:\r
Ma = ModuleAutoGen(self.Workspace, ModuleFile, self.BuildTarget,\r
self.ToolChain, self.Arch, self.MetaFile)\r
- Ma.CreateMakeFile(True)\r
+ if (ModuleFile.File, self.Arch) in FfsCommand:\r
+ Ma.CreateMakeFile(True, FfsCommand[ModuleFile.File, self.Arch])\r
+ else:\r
+ Ma.CreateMakeFile(True)\r
#Ma.CreateAsBuiltInf()\r
\r
# no need to create makefile for the platform more than once\r
if pcd not in self._PlatformPcds.keys():\r
self._PlatformPcds[pcd] = self.Platform.Pcds[pcd]\r
\r
+ for item in self._PlatformPcds:\r
+ if self._PlatformPcds[item].DatumType and self._PlatformPcds[item].DatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64, TAB_VOID, "BOOLEAN"]:\r
+ self._PlatformPcds[item].DatumType = "VOID*"\r
+\r
if (self.Workspace.ArchList[-1] == self.Arch): \r
for Pcd in self._DynamicPcdList:\r
# just pick the a value to determine whether is unicode string type\r
Sku = Pcd.SkuInfoList[Pcd.SkuInfoList.keys()[0]]\r
Sku.VpdOffset = Sku.VpdOffset.strip()\r
\r
+ if Pcd.DatumType not in [TAB_UINT8, TAB_UINT16, TAB_UINT32, TAB_UINT64, TAB_VOID, "BOOLEAN"]:\r
+ Pcd.DatumType = "VOID*"\r
+\r
PcdValue = Sku.DefaultValue\r
if Pcd.DatumType == 'VOID*' and PcdValue.startswith("L"):\r
# if found PCD which datum value is unicode string the insert to left size of UnicodeIndex\r
\r
self._BuildDir = None\r
self._OutputDir = None\r
+ self._FfsOutputDir = None\r
self._DebugDir = None\r
self._MakeFileDir = None\r
\r
self._Macro["PLATFORM_RELATIVE_DIR" ] = self.PlatformInfo.SourceDir\r
self._Macro["PLATFORM_DIR" ] = mws.join(self.WorkspaceDir, self.PlatformInfo.SourceDir)\r
self._Macro["PLATFORM_OUTPUT_DIR" ] = self.PlatformInfo.OutputDir\r
+ self._Macro["FFS_OUTPUT_DIR" ] = self.FfsOutputDir\r
return self._Macro\r
\r
## Return the module build data object\r
CreateDirectory(self._OutputDir)\r
return self._OutputDir\r
\r
+ ## Return the directory to store ffs file\r
+ def _GetFfsOutputDir(self):\r
+ if self._FfsOutputDir == None:\r
+ if GlobalData.gFdfParser != None:\r
+ self._FfsOutputDir = path.join(self.PlatformInfo.BuildDir, "FV", "Ffs", self.Guid + self.Name)\r
+ else:\r
+ self._FfsOutputDir = ''\r
+ return self._FfsOutputDir\r
+\r
## Return the directory to store auto-gened source files of the mdoule\r
def _GetDebugDir(self):\r
if self._DebugDir == None:\r
EdkLogger.debug(EdkLogger.DEBUG_9, "The toolchain [%s] for processing file [%s] is found, "\r
"but [%s] is needed" % (F.TagName, str(F), self.ToolChain))\r
continue\r
- # match tool chain family\r
- if F.ToolChainFamily not in ("", "*", self.ToolChainFamily):\r
+ # match tool chain family or build rule family\r
+ if F.ToolChainFamily not in ("", "*", self.ToolChainFamily, self.BuildRuleFamily):\r
EdkLogger.debug(\r
EdkLogger.DEBUG_0,\r
"The file [%s] must be built by tools of [%s], " \\r
- "but current toolchain family is [%s]" \\r
- % (str(F), F.ToolChainFamily, self.ToolChainFamily))\r
+ "but current toolchain family is [%s], buildrule family is [%s]" \\r
+ % (str(F), F.ToolChainFamily, self.ToolChainFamily, self.BuildRuleFamily))\r
continue\r
\r
# add the file path into search path list for file including\r
\r
## Create AsBuilt INF file the module\r
#\r
- def CreateAsBuiltInf(self):\r
+ def CreateAsBuiltInf(self, IsOnlyCopy = False):\r
+ self.OutputFile = []\r
+ if IsOnlyCopy:\r
+ if GlobalData.gBinCacheDest:\r
+ self.CopyModuleToCache()\r
+ return\r
+\r
if self.IsAsBuiltInfCreated:\r
return\r
\r
AsBuiltInfDict['module_pi_specification_version'] += [self.Specification['PI_SPECIFICATION_VERSION']]\r
\r
OutputDir = self.OutputDir.replace('\\', '/').strip('/')\r
- self.OutputFile = []\r
for Item in self.CodaTargetList:\r
File = Item.Target.Path.replace('\\', '/').strip('/').replace(OutputDir, '').strip('/')\r
if File not in self.OutputFile:\r
elif BoolValue == 'FALSE':\r
Pcd.DefaultValue = '0'\r
\r
- if Pcd.DatumType != 'VOID*':\r
+ if Pcd.DatumType in ['UINT8', 'UINT16', 'UINT32', 'UINT64', 'BOOLEAN']:\r
HexFormat = '0x%02x'\r
if Pcd.DatumType == 'UINT16':\r
HexFormat = '0x%04x'\r
shutil.copy2(HashFile, FileDir)\r
if os.path.exists(ModuleFile):\r
shutil.copy2(ModuleFile, FileDir)\r
+ if not self.OutputFile:\r
+ Ma = self.Workspace.BuildDatabase[PathClass(ModuleFile), self.Arch, self.BuildTarget, self.ToolChain]\r
+ self.OutputFile = Ma.Binaries\r
if self.OutputFile:\r
for File in self.OutputFile:\r
+ File = str(File)\r
if not os.path.isabs(File):\r
File = os.path.join(self.OutputDir, File)\r
if os.path.exists(File):\r
# @param CreateLibraryMakeFile Flag indicating if or not the makefiles of\r
# dependent libraries will be created\r
#\r
- def CreateMakeFile(self, CreateLibraryMakeFile=True):\r
+ def CreateMakeFile(self, CreateLibraryMakeFile=True, GenFfsList = []):\r
# Ignore generating makefile when it is a binary module\r
if self.IsBinaryModule:\r
return\r
\r
if self.IsMakeFileCreated:\r
return\r
- if self.CanSkip():\r
- return\r
-\r
+ self.GenFfsList = GenFfsList\r
if not self.IsLibrary and CreateLibraryMakeFile:\r
for LibraryAutoGen in self.LibraryAutoGenList:\r
LibraryAutoGen.CreateMakeFile()\r
\r
+ if self.CanSkip():\r
+ return\r
+\r
if len(self.CustomMakefile) == 0:\r
Makefile = GenMake.ModuleMakefile(self)\r
else:\r
def CreateCodeFile(self, CreateLibraryCodeFile=True):\r
if self.IsCodeFileCreated:\r
return\r
- if self.CanSkip():\r
- return\r
\r
# Need to generate PcdDatabase even PcdDriver is binarymodule\r
if self.IsBinaryModule and self.PcdIsDriver != '':\r
for LibraryAutoGen in self.LibraryAutoGenList:\r
LibraryAutoGen.CreateCodeFile()\r
\r
+ if self.CanSkip():\r
+ return\r
+\r
AutoGenList = []\r
IgoredAutoGenList = []\r
\r
IsBinaryModule = property(_IsBinaryModule)\r
BuildDir = property(_GetBuildDir)\r
OutputDir = property(_GetOutputDir)\r
+ FfsOutputDir = property(_GetFfsOutputDir)\r
DebugDir = property(_GetDebugDir)\r
MakeFileDir = property(_GetMakeFileDir)\r
CustomMakefile = property(_GetCustomMakefile)\r