@REM @file\r
@REM Windows batch file to build BIOS ROM\r
@REM\r
-@REM Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
-@REM This program and the accompanying materials\r
-@REM are licensed and made available under the terms and conditions of the BSD License\r
-@REM which accompanies this distribution. The full text of the license may be found at\r
-@REM http://opensource.org/licenses/bsd-license.php\r
-@REM\r
-@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+@REM Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
+@REM SPDX-License-Identifier: BSD-2-Clause-Patent\r
@REM\r
\r
@echo off\r
echo %date% %time%\r
echo.\r
\r
+\r
::**********************************************************************\r
:: Initial Setup\r
::**********************************************************************\r
-set WORKSPACE=%CD%\r
if %WORKSPACE:~-1%==\ set WORKSPACE=%WORKSPACE:~0,-1%\r
set /a build_threads=1\r
set "Build_Flags= "\r
set exitCode=0\r
set Arch=X64\r
set Source=0\r
+set PLATFORM_NAME=Vlv2TbltDevicePkg\r
+\r
+set CORE_PATH=%WORKSPACE%\r
+if not exist %CORE_PATH%\edksetup.bat (\r
+ if defined PACKAGES_PATH (\r
+ for %%i IN (%PACKAGES_PATH%) DO (\r
+ if exist %%~fi\edksetup.bat (\r
+ set CORE_PATH=%%~fi\r
+ goto CorePathFound\r
+ )\r
+ )\r
+ ) else (\r
+ echo.\r
+ echo !!! ERROR !!! Cannot find edksetup.bat !!!\r
+ echo.\r
+ goto BldFail\r
+ )\r
+)\r
+:CorePathFound\r
+\r
+set PLATFORM_PACKAGE=%WORKSPACE%\%PLATFORM_NAME%\r
+if not exist %PLATFORM_PACKAGE% (\r
+ if defined PACKAGES_PATH (\r
+ for %%i IN (%PACKAGES_PATH%) DO (\r
+ if exist %%~fi\%PLATFORM_NAME% (\r
+ set PLATFORM_PACKAGE=%%~fi\%PLATFORM_NAME%\r
+ goto PlatformPackageFound\r
+ )\r
+ )\r
+ ) else (\r
+ echo.\r
+ echo !!! ERROR !!! Cannot find %PLATFORM_NAME% !!!\r
+ echo.\r
+ goto BldFail\r
+ )\r
+)\r
+:PlatformPackageFound\r
+\r
+cd %CORE_PATH%\r
\r
:: Clean up previous build files.\r
-if exist %WORKSPACE%\%PLATFORM_PACKAGE%\EDK2_%PLATFORM_PACKAGE%.log del %WORKSPACE%\%PLATFORM_PACKAGE%\EDK2_%PLATFORM_PACKAGE%.log\r
-if exist %WORKSPACE%\%PLATFORM_PACKAGE%\EDK2_%PLATFORM_PACKAGE%.report del %WORKSPACE%\%PLATFORM_PACKAGE%\EDK2_%PLATFORM_PACKAGE%.report\r
+if exist %WORKSPACE%\edk2.log del %WORKSPACE%\edk2.log\r
if exist %WORKSPACE%\unitool.log del %WORKSPACE%\unitool.log\r
if exist %WORKSPACE%\Conf\target.txt del %WORKSPACE%\Conf\target.txt\r
if exist %WORKSPACE%\Conf\tools_def.txt del %WORKSPACE%\Conf\tools_def.txt\r
if exist %WORKSPACE%\Conf\build_rule.txt del %WORKSPACE%\Conf\build_rule.txt\r
-if exist %WORKSPACE%\Conf\FrameworkDatabase.db del %WORKSPACE%\Conf\FrameworkDatabase.db\r
-if exist conf\.cache rmdir /q/s conf\.cache\r
+if exist %WORKSPACE%\Conf\.cache rmdir /q/s %WORKSPACE%\Conf\.cache\r
\r
:: Setup EDK environment. Edksetup puts new copies of target.txt, tools_def.txt, build_rule.txt in WorkSpace\Conf\r
:: Also run edksetup as soon as possible to avoid it from changing environment variables we're overriding\r
-call edksetup.bat > nul\r
+call %CORE_PATH%\edksetup.bat Rebuild\r
@echo off\r
\r
:: Define platform specific environment variables.\r
-set PLATFORM_PACKAGE=Vlv2TbltDevicePkg\r
-set config_file=.\%PLATFORM_PACKAGE%\PlatformPkgConfig.dsc\r
-set auto_config_inc=.\%PLATFORM_PACKAGE%\AutoPlatformCFG.txt\r
+set config_file=%PLATFORM_PACKAGE%\PlatformPkgConfig.dsc\r
+set auto_config_inc=%PLATFORM_PACKAGE%\AutoPlatformCFG.txt\r
+\r
\r
-set EDK_SOURCE=%WORKSPACE%\EdkCompatibilityPkg\r
\r
::create new AutoPlatformCFG.txt file\r
copy /y nul %auto_config_inc% >nul\r
if /i "%~1"=="/?" goto Usage\r
\r
if /i "%~1"=="/l" (\r
- set Build_Flags=%Build_Flags% -j %PLATFORM_PACKAGE%\EDK2_%PLATFORM_PACKAGE%.log\r
+ set Build_Flags=%Build_Flags% -j EDK2.log\r
shift\r
goto OptLoop\r
)\r
del /f/s/q build > nul\r
rmdir /s/q build\r
)\r
- if exist conf\.cache (\r
- del /f/s/q conf\.cache > nul\r
- rmdir /s/q conf\.cache\r
+ if exist %WORKSPACE%\Conf\.cache (\r
+ del /f/s/q %WORKSPACE%\Conf\.cache > nul\r
+ rmdir /s/q %WORKSPACE%\Conf\.cache\r
)\r
echo.\r
shift\r
\r
::Remove the values for Platform_Type and Build_Target from BiosIdX.env and stage in Conf\\r
if "%Arch%"=="IA32" (\r
- findstr /b /v "BOARD_ID BUILD_TYPE" %PLATFORM_PACKAGE%\BiosIdR.env > Conf\BiosId.env\r
+ findstr /b /v "BOARD_ID BUILD_TYPE" %PLATFORM_PACKAGE%\BiosIdR.env > %WORKSPACE%\Conf\BiosId.env\r
echo DEFINE X64_CONFIG = FALSE >> %auto_config_inc%\r
) else if "%Arch%"=="X64" (\r
- findstr /b /v "BOARD_ID BUILD_TYPE" %PLATFORM_PACKAGE%\BiosIdx64R.env > Conf\BiosId.env\r
+ findstr /b /v "BOARD_ID BUILD_TYPE" %PLATFORM_PACKAGE%\BiosIdx64R.env > %WORKSPACE%\Conf\BiosId.env\r
echo DEFINE X64_CONFIG = TRUE >> %auto_config_inc%\r
)\r
\r
:: -- Build flags settings for each Platform --\r
echo Setting %1 platform configuration and BIOS ID...\r
if /i "%~1" == "MNW2" (\r
- echo BOARD_ID = MNW2MAX >> %Conf\BiosId.env\r
+ echo BOARD_ID = MNW2MAX >> %WORKSPACE%\Conf\BiosId.env\r
echo DEFINE ENBDT_PF_BUILD = TRUE >> %auto_config_inc%\r
\r
) else (\r
\r
if /i "%~2" == "RELEASE" (\r
set target=RELEASE\r
- echo BUILD_TYPE = R >> Conf\BiosId.env\r
+ echo BUILD_TYPE = R >> %WORKSPACE%\Conf\BiosId.env\r
) else (\r
set target=DEBUG\r
- echo BUILD_TYPE = D >> Conf\BiosId.env\r
+ echo BUILD_TYPE = D >> %WORKSPACE%\Conf\BiosId.env\r
)\r
\r
::**********************************************************************\r
-:: Additional EDK Build Setup/Configuration
-::**********************************************************************
-echo.
-echo Setting the Build environment for VS2008/VS2010/VS2012/VS2013...\r
-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\r
- ) else (\r
- set TOOL_CHAIN_TAG=VS2008x86\r
- )\r
- ) else if defined VS100COMNTOOLS (\r
- if not defined VSINSTALLDIR call "%VS100COMNTOOLS%\vsvars32.bat"\r
- if /I "%VS100COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\" (\r
- set TOOL_CHAIN_TAG=VS2010\r
+:: Additional EDK Build Setup/Configuration\r
+::**********************************************************************\r
+echo.\r
+echo Setting the Build environment for VS2015/VS2013/VS2012/VS2010/VS2008...\r
+if defined VS140COMNTOOLS (\r
+ if not defined VSINSTALLDIR call "%VS140COMNTOOLS%\vsvars32.bat"\r
+ if /I "%VS140COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 14.0\Common7\Tools\" (\r
+ set TOOL_CHAIN_TAG=VS2015\r
) else (\r
- set TOOL_CHAIN_TAG=VS2010x86
+ set TOOL_CHAIN_TAG=VS2015x86\r
+ ) \r
+) else if defined VS120COMNTOOLS (\r
+ if not defined VSINSTALLDIR call "%VS120COMNTOOLS%\vsvars32.bat"\r
+ if /I "%VS120COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 12.0\Common7\Tools\" (\r
+ set TOOL_CHAIN_TAG=VS2013\r
+ ) else (\r
+ set TOOL_CHAIN_TAG=VS2013x86\r
)\r
) else if defined VS110COMNTOOLS (\r
if not defined VSINSTALLDIR call "%VS110COMNTOOLS%\vsvars32.bat"\r
) else (\r
set TOOL_CHAIN_TAG=VS2012x86\r
)\r
-) else if defined VS120COMNTOOLS (\r
- if not defined VSINSTALLDIR call "%VS120COMNTOOLS%\vsvars32.bat"\r
- if /I "%VS120COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 12.0\Common7\Tools\" (\r
- set TOOL_CHAIN_TAG=VS2013\r
+) else if defined VS100COMNTOOLS (\r
+ if not defined VSINSTALLDIR call "%VS100COMNTOOLS%\vsvars32.bat"\r
+ if /I "%VS100COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\" (\r
+ set TOOL_CHAIN_TAG=VS2010\r
) else (\r
- set TOOL_CHAIN_TAG=VS2013x86\r
+ set TOOL_CHAIN_TAG=VS2010x86\r
)\r
-) else (
- echo --ERROR: VS2008/VS2010/VS2012/VS2013 not installed correctly. VS90COMNTOOLS/VS100COMNTOOLS/VS110COMNTOOLS/VS120COMNTOOLS not defined ^^!\r
+) else if defined VS90COMNTOOLS (\r
+ if not defined VSINSTALLDIR call "%VS90COMNTOOLS%\vsvars32.bat"\r
+ if /I "%VS90COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\" (\r
+ set TOOL_CHAIN_TAG=VS2008\r
+ ) else (\r
+ set TOOL_CHAIN_TAG=VS2008x86\r
+ )\r
+) else (\r
+ echo --ERROR: VS2015/VS2013/VS2012/VS2010/VS2008 not installed correctly. VS140COMNTOOLS/VS120COMNTOOLS/VS110COMNTOOLS/VS100COMNTOOLS/VS90COMNTOOLS not defined ^^!\r
echo.\r
goto :BldFail\r
-)
+)\r
\r
echo Ensuring correct build directory is present for GenBiosId...\r
-set BUILD_PATH=Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\r
+set BUILD_PATH=%WORKSPACE%\Build\%PLATFORM_NAME%\%TARGET%_%TOOL_CHAIN_TAG%\r
\r
echo Modifing Conf files for this build...\r
:: Remove lines with these tags from target.txt\r
-findstr /V "TARGET TARGET_ARCH TOOL_CHAIN_TAG BUILD_RULE_CONF ACTIVE_PLATFORM MAX_CONCURRENT_THREAD_NUMBER" Conf\target.txt > Conf\target.txt.tmp\r
+findstr /V "TARGET TARGET_ARCH TOOL_CHAIN_TAG BUILD_RULE_CONF ACTIVE_PLATFORM MAX_CONCURRENT_THREAD_NUMBER" %WORKSPACE%\Conf\target.txt > %WORKSPACE%\Conf\target.txt.tmp\r
\r
-echo TARGET = %TARGET% >> Conf\target.txt.tmp\r
+echo TARGET = %TARGET% >> %WORKSPACE%\Conf\target.txt.tmp\r
if "%Arch%"=="IA32" (\r
- echo TARGET_ARCH = IA32 >> Conf\target.txt.tmp\r
+ echo TARGET_ARCH = IA32 >> %WORKSPACE%\Conf\target.txt.tmp\r
) else if "%Arch%"=="X64" (\r
- echo TARGET_ARCH = IA32 X64 >> Conf\target.txt.tmp\r
+ echo TARGET_ARCH = IA32 X64 >> %WORKSPACE%\Conf\target.txt.tmp\r
)\r
-echo TOOL_CHAIN_TAG = %TOOL_CHAIN_TAG% >> Conf\target.txt.tmp\r
-echo BUILD_RULE_CONF = Conf/build_rule.txt >> Conf\target.txt.tmp\r
+echo TOOL_CHAIN_TAG = %TOOL_CHAIN_TAG% >> %WORKSPACE%\Conf\target.txt.tmp\r
+echo BUILD_RULE_CONF = Conf/build_rule.txt >> %WORKSPACE%\Conf\target.txt.tmp\r
if %Source% == 0 (\r
- echo ACTIVE_PLATFORM = %PLATFORM_PACKAGE%/PlatformPkg%Arch%.dsc >> Conf\target.txt.tmp\r
+ echo ACTIVE_PLATFORM = %PLATFORM_PACKAGE%/PlatformPkg%Arch%.dsc >> %WORKSPACE%\Conf\target.txt.tmp\r
) else (\r
- echo ACTIVE_PLATFORM = %PLATFORM_PACKAGE%/PlatformPkg%Arch%Source.dsc >> Conf\target.txt.tmp\r
+ echo ACTIVE_PLATFORM = %PLATFORM_PACKAGE%/PlatformPkg%Arch%Source.dsc >> %WORKSPACE%\Conf\target.txt.tmp\r
)\r
-echo MAX_CONCURRENT_THREAD_NUMBER = %build_threads% >> Conf\target.txt.tmp\r
+echo MAX_CONCURRENT_THREAD_NUMBER = %build_threads% >> %WORKSPACE%\Conf\target.txt.tmp\r
\r
-move /Y Conf\target.txt.tmp Conf\target.txt >nul\r
+move /Y %WORKSPACE%\Conf\target.txt.tmp %WORKSPACE%\Conf\target.txt >nul\r
\r
::**********************************************************************\r
:: Build BIOS\r
::**********************************************************************\r
\r
echo Creating BiosId...\r
-pushd %PLATFORM_PACKAGE%\r
-if not exist ..\%BUILD_PATH%\IA32 mkdir ..\%BUILD_PATH%\IA32\r
- GenBiosId.exe -i ..\Conf\BiosId.env -o ..\%BUILD_PATH%\IA32\BiosId.bin -ob ..\Conf\BiosId.bat\r
+if not exist %BUILD_PATH%\IA32 mkdir %BUILD_PATH%\IA32\r
+%PLATFORM_PACKAGE%\GenBiosId.exe -i %WORKSPACE%\Conf\BiosId.env -o %BUILD_PATH%\IA32\BiosId.bin -ob %WORKSPACE%\Conf\BiosId.bat\r
if "%Arch%"=="X64" (\r
- if not exist ..\%BUILD_PATH%\X64 mkdir ..\%BUILD_PATH%\X64\r
- GenBiosId.exe -i ..\Conf\BiosId.env -o ..\%BUILD_PATH%\X64\BiosId.bin -ob ..\Conf\BiosId.bat\r
+ if not exist %BUILD_PATH%\X64 mkdir %BUILD_PATH%\X64\r
+ %PLATFORM_PACKAGE%\GenBiosId.exe -i %WORKSPACE%\Conf\BiosId.env -o %BUILD_PATH%\X64\BiosId.bin -ob %WORKSPACE%\Conf\BiosId.bat\r
)\r
-popd\r
-\r
\r
if %ERRORLEVEL% NEQ 0 goto BldFail\r
\r
\r
pushd %PLATFORM_PACKAGE%\r
:: Extract Hii data from build and store in HiiDefaultData.txt\r
-fce read -i ..\%BUILD_PATH%\FV\Vlv.fd > ..\%BUILD_PATH%\FV\HiiDefaultData.txt\r
+%PLATFORM_PACKAGE%\fce read -i %BUILD_PATH%\FV\Vlv.fd > %BUILD_PATH%\FV\HiiDefaultData.txt\r
\r
:: save changes to VlvXXX.fd\r
-fce update -i ..\%BUILD_PATH%\FV\Vlv.fd -s ..\%BUILD_PATH%\FV\HiiDefaultData.txt -o ..\%BUILD_PATH%\FV\Vlv%Arch%.fd\r
-\r
+%PLATFORM_PACKAGE%\fce update -i %BUILD_PATH%\FV\Vlv.fd -s %BUILD_PATH%\FV\HiiDefaultData.txt -o %BUILD_PATH%\FV\Vlv%Arch%.fd\r
popd\r
\r
if %ERRORLEVEL% NEQ 0 goto BldFail\r
::echo FD successfully updated with default Hii values.\r
\r
:: Set the Board_Id, Build_Type, Version_Major, and Version_Minor environment variables\r
-find /v "#" Conf\BiosId.env > ver_strings\r
+find /v "#" %WORKSPACE%\Conf\BiosId.env > ver_strings\r
for /f "tokens=1,3" %%i in (ver_strings) do set %%i=%%j\r
del /f/q ver_strings >nul\r
\r
set BIOS_Name=%BOARD_ID%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%_%VERSION_MINOR%.ROM\r
-copy /y/b %BUILD_PATH%\FV\Vlv%Arch%.fd %WORKSPACE%\%BIOS_Name% >nul\r
+copy /y/b %BUILD_PATH%\FV\Vlv%Arch%.fd %PLATFORM_PACKAGE%\Stitch\%BIOS_Name% >nul\r
copy /y/b %BUILD_PATH%\FV\Vlv%Arch%.fd %BUILD_PATH%\FV\Vlv.ROM >nul\r
\r
echo.\r
echo.\r
\r
@REM build capsule here\r
-if "%openssl_path%" == "" goto Exit\r
echo > %BUILD_PATH%\FV\SYSTEMFIRMWAREUPDATECARGO.Fv\r
build -p %PLATFORM_PACKAGE%\PlatformCapsule.dsc\r
\r