2 @REM Windows batch file to build BIOS ROM
4 @REM Copyright
(c
) 2006 - 2014, Intel Corporation. All rights reserved.
<BR
>
5 @REM This program and the accompanying materials
6 @REM are licensed and made available under the terms and conditions of the BSD License
7 @REM which accompanies this distribution. The full text of the license may be found at
8 @REM http
://opensource.org
/licenses
/bsd
-license.php
10 @REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN
"AS IS" BASIS
,
11 @REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND
, EITHER EXPRESS OR IMPLIED.
18 @
if exist %WORKSPACE%\edk2.log
del %WORKSPACE%\edk2.log
19 @
if exist %WORKSPACE%\unitool.log
del %WORKSPACE%\unitool.log
20 @
if exist %WORKSPACE%\Conf
\build_rule.txt
del %WORKSPACE%\Conf
\build_rule.txt
21 @
if exist %WORKSPACE%\Conf\FrameworkDatabase.db
del %WORKSPACE%\Conf\FrameworkDatabase.db
22 @
if exist %WORKSPACE%\Conf
\target.txt
del %WORKSPACE%\Conf
\target.txt
23 @
if exist %WORKSPACE%\Conf
\tools_def.txt
del %WORKSPACE%\Conf
\tools_def.txt
24 @
if exist conf\.
cache rmdir /q
/s conf\.
cache
28 @
if /i
"%1" == "release" set TARGET
=RELEASE
29 @
if /i
"%2" == "release" set TARGET
=RELEASE
30 @
if /i
"%3" == "release" set TARGET
=RELEASE
31 @
if /i
"%4" == "release" set TARGET
=RELEASE
32 @
if /i
"%5" == "release" set TARGET
=RELEASE
34 @
set PlatformType
=NO_PLATFORM
35 @
set config_file
=.\Vlv2TbltDevicePkg\PlatformPkgConfig.dsc
36 @
set EVN_debug_file
=.\Vlv2TbltDevicePkg\BiosIdx64D.env
37 @
set EVN_release_file
=.\Vlv2TbltDevicePkg\BiosIdx64R.env
38 @
set auto_config_inc
=.\Vlv2TbltDevicePkg\AutoPlatformCFG.txt
41 set %PlatformType% = MNW2
42 @
echo Setting Baley Bay platform configration and BIOS ID ...
43 findstr
/b
/v BOARD_ID
%EVN_debug_file% > newfile.env
44 echo BOARD_ID
= MNW2MAX
>> newfile.env
45 type newfile.env
> %EVN_debug_file%
46 findstr
/b
/v BOARD_ID
%EVN_release_file% > newfile.env
47 echo BOARD_ID
= MNW2MAX
>> newfile.env
48 type newfile.env
> %EVN_release_file%
49 echo DEFINE ENBDT_PF_BUILD
= TRUE
>> %auto_config_inc%
50 echo DEFINE X64_CONFIG
= TRUE
>> %auto_config_inc%
51 goto PLATFORM_SETTING_DONE
54 @
if "%PlatformType%" == "NO_PLATFORM" (
58 rem clearup the temp file
59 :PLATFORM_SETTING_DONE
63 @REM Define platform specific environment variables.
65 @
set PLATFORM_PACKAGE
=Vlv2TbltDevicePkg
68 @REM
Set basic environment.
70 @
echo Run edksetup.bat batch file.
72 @
del Conf
\build_rule.txt
73 @REM @
del Conf
\tools_def.txt
78 @
echo Set the VS2008 environment.
80 @
if defined VS90COMNTOOLS
(
81 if not defined VSINSTALLDIR
call "%VS90COMNTOOLS%\vsvars32.bat"
82 if /I
"%VS90COMNTOOLS%" == "C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\" (
83 set TOOL_CHAIN_TAG=VS2008
85 set TOOL_CHAIN_TAG=VS2008x86
89 echo !!! ERROR !!! VS2008 not installed correctly. VS90COMNTOOLS not defined. !!!
96 @echo Set build environment.
98 @if not exist Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG% (
99 mkdir Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%
103 @REM Set clean build option
104 @set CLEAN_BUILD_OPTION=-e
106 @findstr /V "ACTIVE_PLATFORM TARGET TARGET_ARCH TOOL_CHAIN_TAG BUILD_RULE_CONF
" Conf\target.txt > Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\target.txt
108 @echo ACTIVE_PLATFORM = %PLATFORM_PACKAGE%/PlatformPkgX64.dsc >> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\target.txt
109 @echo TARGET = %TARGET% >> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\target.txt
110 @echo TARGET_ARCH = IA32 X64 >> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\target.txt
111 @echo TOOL_CHAIN_TAG = %TOOL_CHAIN_TAG% >> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\target.txt
112 @echo BUILD_RULE_CONF = Conf/build_rule.txt >> Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\target.txt
113 @move /Y Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\target.txt Conf
118 @echo Create BiosIdx64.
120 @if not exist Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\X64 (
121 mkdir Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\X64
124 @if "%TARGET%" == "DEBUG" (
125 set BIOS_ID_FILE=BiosIdx64D.env
128 set BIOS_ID_FILE=BiosIdx64R.env
133 GenBiosId.exe -i %PLATFORM_PACKAGE%\%BIOS_ID_FILE% -o Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\X64\BiosId.bin
134 @if %ERRORLEVEL% NEQ 0 goto BldFail
137 echo Copy reference code ASL files.
140 @if /i "/s
" == "%1" goto BldSilent
141 @if /i "/s
" == "%2" goto BldSilent
142 @if /i "/s
" == "%3" goto BldSilent
143 @if /i "/s
" == "%4" goto BldSilent
144 @if /i "/s
" == "%5" goto BldSilent
146 build -n %NUMBER_OF_PROCESSORS%
147 @if %ERRORLEVEL% NEQ 0 goto BldFail
149 @If %SCRIPT_ERROR% EQU 1 goto BldFail
154 build -n %NUMBER_OF_PROCESSORS% 1>>EDK2.log 2>&1
155 @if %ERRORLEVEL% NEQ 0 goto BldFail
158 @If %SCRIPT_ERROR% EQU 1 goto BldFail
162 del Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\VlvX64.beforeconfig.fd 1>>EDK2.log 2>&1
163 del Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\HiiDefaultData.txt 1>>EDK2.log 2>&1
164 copy /y Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\Vlv.fd Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\VlvX64.beforeconfig.fd 1>>EDK2.log 2>&1
167 @echo Extract setup default value from VFR (Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\HiiDefaultData.txt)
169 fce read -i Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\VlvX64.beforeconfig.fd > Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\HiiDefaultData.txt
172 @echo Update FD with default Hii value successfully! (both 'Setup' and 'SetupDefault')
174 fce mirror -i Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\VlvX64.beforeconfig.fd -o Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\VlvX64.fd Setup SetupDefault 1>>EDK2.log 2>&1
177 del Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\Vlv.fd
178 del Vlv2TbltDevicePkg\RomImage\bios.rom
179 if not exist Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\ROM goto Gen8MImage
180 del /q /f Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\ROM\*
181 rd /Q Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\ROM
184 copy /b Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV\VlvX64.fd Vlv2TbltDevicePkg\RomImage\bios.rom
186 pushd Vlv2TbltDevicePkg\RomImage\
187 @if "%TARGET%" == "DEBUG" (
188 call signbiosX64_debug.bat
190 call signbiosX64_release.bat
194 call ftoolbuild_sec_enable.bat
198 mkdir Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\ROM
199 move Vlv2TbltDevicePkg\RomImage\SPI_Image\* Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\ROM\ > NUL
205 @echo TARGET: %TARGET%
206 @echo TOOL_CHAIN_TAG: %TOOL_CHAIN_TAG%
207 @echo BIOS location: Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\FV
208 @echo SPI Images location: Build\%PLATFORM_PACKAGE%\%TARGET%_%TOOL_CHAIN_TAG%\ROM
210 @echo The EDKII BIOS build has successfully completed!
216 @echo The EDKII BIOS Build has failed!