From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 118AD2095BB74 for ; Fri, 29 Sep 2017 06:14:47 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Sep 2017 06:18:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,452,1500966000"; d="scan'208";a="1200421406" Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.121]) by fmsmga001.fm.intel.com with ESMTP; 29 Sep 2017 06:18:02 -0700 From: Yonghong Zhu To: edk2-devel@lists.01.org Cc: zwei4 Date: Fri, 29 Sep 2017 21:17:56 +0800 Message-Id: <1506691076-4920-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [Patch][edk2-platforms/devel-MinnowBoard3-UDK2017] Add option /m to enable multiple thread build X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Sep 2017 13:14:48 -0000 current in windows it takes ~10 minutes to build a image, so we add /m option to use EDK II build tool's multiple thread build function, it can save about half build time. Cc: zwei4 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu --- BuildBIOS.bat | 12 ++++++++++-- Platform/BroxtonPlatformPkg/BuildBios.bat | 8 ++++++++ Platform/BroxtonPlatformPkg/BuildIFWI.bat | 13 +++++++++++-- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/BuildBIOS.bat b/BuildBIOS.bat index 4bb4b03..baf7cdd 100644 --- a/BuildBIOS.bat +++ b/BuildBIOS.bat @@ -10,10 +10,11 @@ set PlatformName= set BuildTarget=Debug set Compiler=/vs13 set Arch=/x64 set FabId=/B set BoardId=/MN +set buildthread= :: Optional arguments :OptLoop if /i "%~1"=="" goto Usage @@ -84,22 +85,29 @@ if /i "%~1"=="/BG" ( echo. shift goto OptLoop ) +if /i "%~1"=="/m" ( + set buildthread=/m + echo. + shift + goto OptLoop +) + :: Required argument(s) :: Require 2 input parameters if "%~2"=="" goto Usage :: Assign required arguments set PlatformName=%~1 set BuildTarget=%~2 :OptLoopEnd echo ---- Call Build Script of Broxton ---- -echo calling : Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %Compiler% %Arch% %BoardId% %FabId% /fspw %BuildFlags% MINN %BuildTarget% -call Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %Compiler% %Arch% %BoardId% %FabId% /fspw %BuildFlags% MINN %BuildTarget% +echo calling : Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %buildthread% %Compiler% %Arch% %BoardId% %FabId% /fspw %BuildFlags% MINN %BuildTarget% +call Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %buildthread% %Compiler% %Arch% %BoardId% %FabId% /fspw %BuildFlags% MINN %BuildTarget% goto Exit :Usage echo Usage: BuildBIOS.bat [options] ^ ^ diff --git a/Platform/BroxtonPlatformPkg/BuildBios.bat b/Platform/BroxtonPlatformPkg/BuildBios.bat index 3ac411e..1e240e8 100644 --- a/Platform/BroxtonPlatformPkg/BuildBios.bat +++ b/Platform/BroxtonPlatformPkg/BuildBios.bat @@ -177,10 +177,18 @@ if /i "%~1"=="/BG" ( echo. shift goto OptLoop ) +if /i "%~1"=="/m" ( + if defined NUMBER_OF_PROCESSORS ( + set /a build_threads=%NUMBER_OF_PROCESSORS% + ) + shift + goto OptLoop +) + :: Required argument(s) if "%~2"=="" ( echo. & echo -- ERROR: Not Enough Arguments Provided echo -- Please review the Help screen "/?" -- & echo. goto ExitFail diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.bat b/Platform/BroxtonPlatformPkg/BuildIFWI.bat index 1af0bf9..5042580 100644 --- a/Platform/BroxtonPlatformPkg/BuildIFWI.bat +++ b/Platform/BroxtonPlatformPkg/BuildIFWI.bat @@ -6,10 +6,11 @@ set exitCode=0 set "Build_Flags= " set Arch=X64 set SkipUsageFlag=FALSE set FabId=B set BoardId=MN +set buildthread= set WORKSPACE=%CD% if %WORKSPACE:~-1%==\ ( set WORKSPACE=%WORKSPACE:~0,-1% ) set CORE_PATH=%WORKSPACE%\Core @@ -102,10 +103,18 @@ if /i "%~1"=="/BG" ( set Build_Flags=%Build_Flags% /BG shift goto OptLoop ) +if /i "%~1"=="/m" ( + set buildthread=/m + echo. + shift + goto OptLoop +) + + :: Require 2 input parameters if "%~2"=="" ( echo. & echo -- ERROR: Not Enough Arguments Provided echo -- Please review the Help screen "/?" -- & echo. goto exit @@ -118,12 +127,12 @@ set Build_Target=%~2 :: Build BIOS echo ================================================================================ echo Build_IFWI: Calling BIOS build Script... echo. -echo - call BuildBios.bat %Build_Flags% %Platform_Type% %Build_Target% -call %WORKSPACE%\%PLATFORM_PATH%\BuildBios.bat %Build_Flags% %Platform_Type% %Build_Target% +echo - call BuildBios.bat %buildthread% %Build_Flags% %Platform_Type% %Build_Target% +call %WORKSPACE%\%PLATFORM_PATH%\BuildBios.bat %buildthread% %Build_Flags% %Platform_Type% %Build_Target% if ErrorLevel 1 ( echo echo -- Error Building BIOS & echo. set exitCode=1 goto exit ) -- 2.6.1.windows.1