X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=Vlv2TbltDevicePkg%2Fbld_vlv.bat;h=b95dceb110ccabfd67f7bf6105e40c0e243aae3a;hb=ecf98fbcf858b9cb09ff0ac1c2a09c0111b4026b;hp=b9c86e356952b7962e6f853ac980348453b35844;hpb=3cbfba02fef9dae07a041fdbf2e89611d72d6f90;p=mirror_edk2.git diff --git a/Vlv2TbltDevicePkg/bld_vlv.bat b/Vlv2TbltDevicePkg/bld_vlv.bat index b9c86e3569..b95dceb110 100644 --- a/Vlv2TbltDevicePkg/bld_vlv.bat +++ b/Vlv2TbltDevicePkg/bld_vlv.bat @@ -1,7 +1,7 @@ @REM @file @REM Windows batch file to build BIOS ROM @REM -@REM Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
+@REM Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
@REM This program and the accompanying materials @REM are licensed and made available under the terms and conditions of the BSD License @REM which accompanies this distribution. The full text of the license may be found at @@ -17,6 +17,7 @@ echo. echo %date% %time% echo. + ::********************************************************************** :: Initial Setup ::********************************************************************** @@ -27,27 +28,31 @@ set "Build_Flags= " set exitCode=0 set Arch=X64 set Source=0 +set CORE_PATH=%WORKSPACE%\edk2 +set PLATFORM_PATH=%WORKSPACE%\edk2 +cd ./edk2 :: Clean up previous build files. -if exist %WORKSPACE%\edk2.log del %WORKSPACE%\edk2.log -if exist %WORKSPACE%\unitool.log del %WORKSPACE%\unitool.log -if exist %WORKSPACE%\Conf\target.txt del %WORKSPACE%\Conf\target.txt -if exist %WORKSPACE%\Conf\tools_def.txt del %WORKSPACE%\Conf\tools_def.txt -if exist %WORKSPACE%\Conf\build_rule.txt del %WORKSPACE%\Conf\build_rule.txt -if exist %WORKSPACE%\Conf\FrameworkDatabase.db del %WORKSPACE%\Conf\FrameworkDatabase.db +if exist %CORE_PATH%\edk2.log del %CORE_PATH%\edk2.log +if exist %CORE_PATH%\unitool.log del %CORE_PATH%\unitool.log +if exist %CORE_PATH%\Conf\target.txt del %CORE_PATH%\Conf\target.txt +if exist %CORE_PATH%\Conf\tools_def.txt del %CORE_PATH%\Conf\tools_def.txt +if exist %CORE_PATH%\Conf\build_rule.txt del %CORE_PATH%\Conf\build_rule.txt +if exist %CORE_PATH%\Conf\FrameworkDatabase.db del %CORE_PATH%\Conf\FrameworkDatabase.db if exist conf\.cache rmdir /q/s conf\.cache :: Setup EDK environment. Edksetup puts new copies of target.txt, tools_def.txt, build_rule.txt in WorkSpace\Conf :: Also run edksetup as soon as possible to avoid it from changing environment variables we're overriding -call edksetup.bat > nul +call %CORE_PATH%\edksetup.bat Rebuild @echo off :: Define platform specific environment variables. -set PLATFORM_PACKAGE=Vlv2TbltDevicePkg -set config_file=.\%PLATFORM_PACKAGE%\PlatformPkgConfig.dsc -set auto_config_inc=.\%PLATFORM_PACKAGE%\AutoPlatformCFG.txt +set PLATFORM_NAME=Vlv2TbltDevicePkg +set PLATFORM_PACKAGE=%PLATFORM_PATH%\Vlv2TbltDevicePkg +set config_file=%PLATFORM_PACKAGE%\PlatformPkgConfig.dsc +set auto_config_inc=%PLATFORM_PACKAGE%\AutoPlatformCFG.txt + -set EDK_SOURCE=%WORKSPACE%\EdkCompatibilityPkg ::create new AutoPlatformCFG.txt file copy /y nul %auto_config_inc% >nul @@ -65,14 +70,26 @@ if /i "%~1"=="/l" ( shift goto OptLoop ) +if /i "%~1"=="/y" ( + set Build_Flags=%Build_Flags% -y %PLATFORM_PACKAGE%\EDK2_%PLATFORM_PACKAGE%.report + shift + goto OptLoop +) +if /i "%~1"=="/m" ( + if defined NUMBER_OF_PROCESSORS ( + set /a build_threads=%NUMBER_OF_PROCESSORS%+1 + ) + shift + goto OptLoop +) if /i "%~1" == "/c" ( echo Removing previous build files ... if exist build ( - del /f/s/q build > null + del /f/s/q build > nul rmdir /s/q build ) if exist conf\.cache ( - del /f/s/q conf\.cache > null + del /f/s/q conf\.cache > nul rmdir /s/q conf\.cache ) echo. @@ -106,7 +123,7 @@ if "%Arch%"=="IA32" ( :: -- Build flags settings for each Platform -- echo Setting %1 platform configuration and BIOS ID... if /i "%~1" == "MNW2" ( - echo BOARD_ID = MNW2MAX >> %Conf\BiosId.env + echo BOARD_ID = MNW2MAX >> Conf\BiosId.env echo DEFINE ENBDT_PF_BUILD = TRUE >> %auto_config_inc% ) else ( @@ -127,29 +144,50 @@ if /i "%~2" == "RELEASE" ( :: Additional EDK Build Setup/Configuration ::********************************************************************** echo. -echo Setting the Build environment for VS2008/VS2010... -if defined VS90COMNTOOLS ( - if not defined VSINSTALLDIR call "%VS90COMNTOOLS%\vsvars32.bat" - if /I "%VS90COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\" ( - set TOOL_CHAIN_TAG=VS2008 - ) else ( - set TOOL_CHAIN_TAG=VS2008x86 - ) - ) else if defined VS100COMNTOOLS ( +echo Setting the Build environment for VS2015/VS2013/VS2012/VS2010/VS2008... +if defined VS140COMNTOOLS ( + if not defined VSINSTALLDIR call "%VS140COMNTOOLS%\vsvars32.bat" + if /I "%VS140COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 14.0\Common7\Tools\" ( + set TOOL_CHAIN_TAG=VS2015 + ) else ( + set TOOL_CHAIN_TAG=VS2015x86 + ) +) else if defined VS120COMNTOOLS ( + if not defined VSINSTALLDIR call "%VS120COMNTOOLS%\vsvars32.bat" + if /I "%VS120COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 12.0\Common7\Tools\" ( + set TOOL_CHAIN_TAG=VS2013 + ) else ( + set TOOL_CHAIN_TAG=VS2013x86 + ) +) else if defined VS110COMNTOOLS ( + if not defined VSINSTALLDIR call "%VS110COMNTOOLS%\vsvars32.bat" + if /I "%VS110COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 11.0\Common7\Tools\" ( + set TOOL_CHAIN_TAG=VS2012 + ) else ( + set TOOL_CHAIN_TAG=VS2012x86 + ) +) else if defined VS100COMNTOOLS ( if not defined VSINSTALLDIR call "%VS100COMNTOOLS%\vsvars32.bat" if /I "%VS100COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\" ( set TOOL_CHAIN_TAG=VS2010 -) else ( + ) else ( set TOOL_CHAIN_TAG=VS2010x86 - ) + ) +) else if defined VS90COMNTOOLS ( + if not defined VSINSTALLDIR call "%VS90COMNTOOLS%\vsvars32.bat" + if /I "%VS90COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\" ( + set TOOL_CHAIN_TAG=VS2008 + ) else ( + set TOOL_CHAIN_TAG=VS2008x86 + ) ) else ( - echo --ERROR: VS2008/VS2010 not installed correctly. VS90COMNTOOLS/VS100COMNTOOLS not defined ^^! - echo. - goto :BldFail + echo --ERROR: VS2015/VS2013/VS2012/VS2010/VS2008 not installed correctly. VS140COMNTOOLS/VS120COMNTOOLS/VS110COMNTOOLS/VS100COMNTOOLS/VS90COMNTOOLS not defined ^^! + echo. + goto :BldFail ) echo Ensuring correct build directory is present for GenBiosId... -set BUILD_PATH=Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG% +set BUILD_PATH=Build\%PLATFORM_NAME%\%TARGET%_%TOOL_CHAIN_TAG% echo Modifing Conf files for this build... :: Remove lines with these tags from target.txt @@ -157,7 +195,7 @@ findstr /V "TARGET TARGET_ARCH TOOL_CHAIN_TAG BUILD_RULE_CONF ACTIVE_PLATFOR echo TARGET = %TARGET% >> Conf\target.txt.tmp if "%Arch%"=="IA32" ( - echo TARGET_ARCH = IA32 >> Conf\target.txt.tmp + echo TARGET_ARCH = IA32 >> Conf\target.txt.tmp ) else if "%Arch%"=="X64" ( echo TARGET_ARCH = IA32 X64 >> Conf\target.txt.tmp ) @@ -178,11 +216,11 @@ move /Y Conf\target.txt.tmp Conf\target.txt >nul echo Creating BiosId... pushd %PLATFORM_PACKAGE% -if not exist ..\%BUILD_PATH%\IA32 mkdir ..\%BUILD_PATH%\IA32 - GenBiosId.exe -i ..\Conf\BiosId.env -o ..\%BUILD_PATH%\IA32\BiosId.bin -ob ..\Conf\BiosId.bat +if not exist %WORKSPACE%\%BUILD_PATH%\IA32 mkdir %WORKSPACE%\%BUILD_PATH%\IA32 + GenBiosId.exe -i %CORE_PATH%\Conf\BiosId.env -o %WORKSPACE%\%BUILD_PATH%\IA32\BiosId.bin -ob %CORE_PATH%\Conf\BiosId.bat if "%Arch%"=="X64" ( - if not exist ..\%BUILD_PATH%\X64 mkdir ..\%BUILD_PATH%\X64 - GenBiosId.exe -i ..\Conf\BiosId.env -o ..\%BUILD_PATH%\X64\BiosId.bin -ob ..\Conf\BiosId.bat + if not exist %WORKSPACE%\%BUILD_PATH%\X64 mkdir %WORKSPACE%\%BUILD_PATH%\X64 + GenBiosId.exe -i %CORE_PATH%\Conf\BiosId.env -o %WORKSPACE%\%BUILD_PATH%\X64\BiosId.bin -ob %CORE_PATH%\Conf\BiosId.bat ) popd @@ -191,7 +229,7 @@ if %ERRORLEVEL% NEQ 0 goto BldFail echo. echo Invoking EDK2 build... -build %Build_Flags% +call build %Build_Flags% if %ERRORLEVEL% NEQ 0 goto BldFail @@ -203,11 +241,10 @@ echo Running fce... pushd %PLATFORM_PACKAGE% :: Extract Hii data from build and store in HiiDefaultData.txt -fce read -i ..\%BUILD_PATH%\FV\Vlv.fd > ..\%BUILD_PATH%\FV\HiiDefaultData.txt 1>>EDK2.log 2>&1 - -:: copy the Setup variable to the SetupDefault variable and save changes to VlvXXX.fd -fce mirror -i ..\%BUILD_PATH%\FV\Vlv.fd -o ..\%BUILD_PATH%\FV\Vlv%Arch%.fd Setup SetupDefault 1>>EDK2.log 2>&1 +fce read -i %WORKSPACE%\%BUILD_PATH%\FV\Vlv.fd > %WORKSPACE%\%BUILD_PATH%\FV\HiiDefaultData.txt +:: save changes to VlvXXX.fd +fce update -i %WORKSPACE%\%BUILD_PATH%\FV\Vlv.fd -s %WORKSPACE%\%BUILD_PATH%\FV\HiiDefaultData.txt -o %WORKSPACE%\%BUILD_PATH%\FV\Vlv%Arch%.fd popd if %ERRORLEVEL% NEQ 0 goto BldFail @@ -219,7 +256,8 @@ for /f "tokens=1,3" %%i in (ver_strings) do set %%i=%%j del /f/q ver_strings >nul set BIOS_Name=%BOARD_ID%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%_%VERSION_MINOR%.ROM -copy /y/b %BUILD_PATH%\FV\Vlv%Arch%.fd %WORKSPACE%\%BIOS_Name% >nul +copy /y/b %WORKSPACE%\%BUILD_PATH%\FV\Vlv%Arch%.fd %PLATFORM_PATH%\%BIOS_Name% >nul +copy /y/b %WORKSPACE%\%BUILD_PATH%\FV\Vlv%Arch%.fd %WORKSPACE%\%BUILD_PATH%\FV\Vlv.ROM >nul echo. echo Build location: %BUILD_PATH% @@ -227,6 +265,16 @@ echo BIOS ROM Created: %BIOS_Name% echo. echo -------------------- The EDKII BIOS build has successfully completed. -------------------- echo. + +@REM build capsule here +@REMif "%openssl_path%" == "" ( +@REM echo -- Error: OPENSSL_PATH not set. Capule and Recovery images not generated. +@REM set exitCode=1 +@REM goto Exit +@REM +@REM echo > %BUILD_PATH%\FV\SYSTEMFIRMWAREUPDATECARGO.Fv +@REM build -p %PLATFORM_PACKAGE%\PlatformCapsule.dsc + goto Exit :Usage @@ -237,6 +285,9 @@ echo. echo Usage: bld_vlv.bat [options] PlatformType [Build Target] echo. echo /c CleanAll before building +echo /l Generate build log file +echo /y Generate build report file +echo /m Enable multi-processor build echo /IA32 Set Arch to IA32 (default: X64) echo /X64 Set Arch to X64 (default: X64) echo.