]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/build/build.py
BaseTools: Fix nmake failure due to command-line length limitation
[mirror_edk2.git] / BaseTools / Source / Python / build / build.py
index 23ca76e82c121777c7455bb35c0ba7e4abc160ca..5c1fda1a937d6dc10ff9763989fa364ae20f5a91 100644 (file)
@@ -53,7 +53,7 @@ import Common.GlobalData as GlobalData
 # Version and Copyright\r
 VersionNumber = "0.60" + ' ' + gBUILD_VERSION\r
 __version__ = "%prog Version " + VersionNumber\r
-__copyright__ = "Copyright (c) 2007 - 2014, Intel Corporation  All rights reserved."\r
+__copyright__ = "Copyright (c) 2007 - 2016, Intel Corporation  All rights reserved."\r
 \r
 ## standard targets of build command\r
 gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run']\r
@@ -304,6 +304,14 @@ def LaunchCommand(Command, WorkingDir):
     if Proc.returncode != 0:\r
         if type(Command) != type(""):\r
             Command = " ".join(Command)\r
+        # print out the Response file and its content when make failure\r
+        RespFile = os.path.join(WorkingDir, 'OUTPUT', 'respfilelist.txt')\r
+        if os.path.isfile(RespFile):\r
+            f = open(RespFile)\r
+            RespContent = f.read()\r
+            f.close()\r
+            EdkLogger.info(RespContent)\r
+\r
         EdkLogger.error("build", COMMAND_FAILURE, ExtraData="%s [%s]" % (Command, WorkingDir))\r
 \r
 ## The smallest unit that can be built in multi-thread build mode\r
@@ -747,6 +755,7 @@ class Build():
         self.BuildReport    = BuildReport(BuildOptions.ReportFile, BuildOptions.ReportType)\r
         self.TargetTxt      = TargetTxtClassObject()\r
         self.ToolDef        = ToolDefClassObject()\r
+        GlobalData.BuildOptionPcd     = BuildOptions.OptionPcd\r
         #Set global flag for build mode\r
         GlobalData.gIgnoreSource = BuildOptions.IgnoreSources\r
 \r
@@ -774,6 +783,9 @@ class Build():
         self.UniFlag        = BuildOptions.Flag\r
         self.BuildModules = []\r
 \r
+        if BuildOptions.CommandLength:\r
+            GlobalData.gCommandMaxLength = BuildOptions.CommandLength\r
+\r
         # print dot character during doing some time-consuming work\r
         self.Progress = Utils.Progressor()\r
 \r
@@ -1929,6 +1941,8 @@ def MyOptionParser():
     Parser.add_option("--conf", action="store", type="string", dest="ConfDirectory", help="Specify the customized Conf directory.")\r
     Parser.add_option("--check-usage", action="store_true", dest="CheckUsage", default=False, help="Check usage content of entries listed in INF file.")\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("-l", "--cmd-len", action="store", type="int", dest="CommandLength", help="Specify the maximum line length of build command. Default is 4096.")\r
 \r
     (Opt, Args) = Parser.parse_args()\r
     return (Opt, Args)\r