]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/GenFds.py
BaseTools: Update Makefile to support FFS file generation
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / GenFds.py
index c19dc4075793b8c9ea0b10df3b1cbd2952c54125..4a5d6f476abdd2bdc3cffaee86f4c790f812c603 100644 (file)
@@ -99,6 +99,8 @@ def main():
                 GenFdsGlobalVariable.EdkSourceDir = os.path.normcase(os.environ['EDK_SOURCE'])\r
             if (Options.debug):\r
                 GenFdsGlobalVariable.VerboseLogger("Using Workspace:" + Workspace)\r
+            if Options.GenfdsMultiThread:\r
+                GenFdsGlobalVariable.EnableGenfdsMultiThread = True\r
         os.chdir(GenFdsGlobalVariable.WorkSpaceDir)\r
         \r
         # set multiple workspace\r
@@ -538,6 +540,7 @@ def myOptionParser():
     Parser.add_option("--conf", action="store", type="string", dest="ConfDirectory", help="Specify the customized Conf directory.")\r
     Parser.add_option("--ignore-sources", action="store_true", dest="IgnoreSources", default=False, help="Focus to a binary build and ignore all source files")\r
     Parser.add_option("--pcd", action="append", dest="OptionPcd", help="Set PCD value by command line. Format: \"PcdName=Value\" ")\r
+    Parser.add_option("--genfds-multi-thread", action="store_true", dest="GenfdsMultiThread", default=False, help="Enable GenFds multi thread to generate ffs file.")\r
 \r
     (Options, args) = Parser.parse_args()\r
     return Options\r
@@ -611,6 +614,23 @@ class GenFds :
                 for DriverName in GenFdsGlobalVariable.FdfParser.Profile.OptRomDict.keys():\r
                     OptRomObj = GenFdsGlobalVariable.FdfParser.Profile.OptRomDict[DriverName]\r
                     OptRomObj.AddToBuffer(None)\r
+    @staticmethod\r
+    def GenFfsMakefile(OutputDir, FdfParser, WorkSpace, ArchList, GlobalData):\r
+        GenFdsGlobalVariable.SetEnv(FdfParser, WorkSpace, ArchList, GlobalData)\r
+        for FdName in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys():\r
+            FdObj = GenFdsGlobalVariable.FdfParser.Profile.FdDict[FdName]\r
+            FdObj.GenFd(Flag=True)\r
+\r
+        for FvName in GenFdsGlobalVariable.FdfParser.Profile.FvDict.keys():\r
+            FvObj = GenFdsGlobalVariable.FdfParser.Profile.FvDict[FvName]\r
+            FvObj.AddToBuffer(Buffer=None, Flag=True)\r
+\r
+        if GenFdsGlobalVariable.FdfParser.Profile.OptRomDict != {}:\r
+            for DriverName in GenFdsGlobalVariable.FdfParser.Profile.OptRomDict.keys():\r
+                OptRomObj = GenFdsGlobalVariable.FdfParser.Profile.OptRomDict[DriverName]\r
+                OptRomObj.AddToBuffer(Buffer=None, Flag=True)\r
+\r
+        return GenFdsGlobalVariable.FfsCmdDict\r
 \r
     ## GetFvBlockSize()\r
     #\r