]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2TbltDevicePkg/Build_IFWI.bat
FatBinPkg: Update EBC/IA32/X64/IPF binaries
[mirror_edk2.git] / Vlv2TbltDevicePkg / Build_IFWI.bat
1 @REM @file
2 @REM Windows batch file to build BIOS ROM
3 @REM
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
9 @REM
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.
12 @REM
13
14 @echo off
15
16 SetLocal EnableDelayedExpansion EnableExtensions
17
18 @REM Go to root directory of the codebase.
19 cd ..
20
21 :: Assign initial values
22 set exitCode=0
23 set "Build_Flags= "
24 set "Stitch_Flags= "
25 set Arch=X64
26 set PLATFORM_PACKAGE=Vlv2TbltDevicePkg
27 set ROOT_DIR=%CD%
28
29 :: Parse Optional arguments
30 :OptLoop
31 if /i "%~1"=="/?" goto Usage
32
33 if /i "%~1"=="/q" (
34 set Build_Flags=%Build_Flags% /q
35 shift
36 goto OptLoop
37 )
38 if /i "%~1"=="/l" (
39 set Build_Flags=%Build_Flags% /l
40 shift
41 goto OptLoop
42 )
43 if /i "%~1" == "/c" (
44 set Build_Flags=%Build_Flags% /c
45 shift
46 goto OptLoop
47 )
48 if /i "%~1" == "/ECP" (
49 set Build_Flags=%Build_Flags% /ecp
50 shift
51 goto OptLoop
52 )
53
54 if /i "%~1"=="/s" (
55 set Build_Flags=%Build_Flags% /s
56 shift
57 goto OptLoop
58 )
59
60 if /i "%~1"=="/x64" (
61 set Arch=X64
62 set Build_Flags=%Build_Flags% /x64
63 shift
64 goto OptLoop
65 )
66
67 if /i "%~1"=="/IA32" (
68 set Arch=IA32
69 set Build_Flags=%Build_Flags% /IA32
70 shift
71 goto OptLoop
72 )
73
74 if /i "%~1"=="/nG" (
75 set Stitch_Flags=%Stitch_Flags% /nG
76 shift
77 goto OptLoop
78 )
79 if /i "%~1"=="/nM" (
80 set Stitch_Flags=%Stitch_Flags% /nM
81 shift
82 goto OptLoop
83 )
84 if /i "%~1"=="/nB" (
85 set Stitch_Flags=%Stitch_Flags% /nB
86 shift
87 goto OptLoop
88 )
89
90 :: Require 2 input parameters
91 if "%~2"=="" goto Usage
92
93 :: Assign required arguments
94 set Platform_Type=%~1
95 set Build_Target=%~2
96 if "%~3"=="" (
97 set "IFWI_Suffix= "
98 ) else set "IFWI_Suffix=/S %~3"
99
100 :: Build BIOS
101 echo ======================================================================
102 echo Build_IFWI: Calling BIOS build Script...
103 if "%Platform_Type%" == "BYTC" (
104 call %PLATFORM_PACKAGE%\bld_vlv_cr.bat %Build_Flags% %Platform_Type% %Build_Target%
105
106 ) else (
107 call %PLATFORM_PACKAGE%\bld_vlv.bat %Build_Flags% %Platform_Type% %Build_Target%
108 )
109 if %ERRORLEVEL% NEQ 0 (
110 echo echo -- Error Building BIOS & echo.
111 set exitCode=1
112 goto exit
113 )
114 echo.
115 echo Finished Building BIOS.
116 @REM Set BIOS_ID environment variable here.
117 call Conf\BiosId.bat
118 echo BIOS_ID=%BIOS_ID%
119
120 :: Set the Board_Id, Build_Type, Version_Major, and Version_Minor environment variables
121 find /v "#" Conf\BiosId.env > ver_strings
122 for /f "tokens=1,3" %%i in (ver_strings) do set %%i=%%j
123 del /f/q ver_strings >nul
124 set BIOS_Name=%BOARD_ID%_%Arch%_%BUILD_TYPE%_%VERSION_MAJOR%_%VERSION_MINOR%.ROM
125
126 :: Start Integration process
127 echo ======================================================================
128 echo Build_IFWI: Calling IFWI Stitching Script...
129 if "%Platform_Type%" == "BYTC" (
130 pushd %PLATFORM_PACKAGE%\Stitch_CR
131 ) else (
132 pushd %PLATFORM_PACKAGE%\Stitch
133 )
134 :: IFWIStitch.bat [/nG] [/nM] [/nB] [/B BIOS.rom] [/C StitchConfig] [/S IFWISuffix]
135 call IFWIStitch.bat %Stitch_Flags% /B ..\..\%BIOS_Name% %IFWI_Suffix%
136
137 @echo off
138 popd
139 if %ERRORLEVEL% NEQ 0 (
140 echo echo -- Error Stitching %BIOS_Nam% & echo.
141 set exitCode=1
142 )
143 echo.
144 echo Build_IFWI is finished.
145 echo The final IFWI file is located in %ROOT_DIR%\Vlv2TbltDevicePkg\Stitch\
146 echo ======================================================================
147 goto Exit
148
149 :Usage
150 echo Script to build BIOS firmware and stitch the entire IFWI.
151 echo.
152 echo Usage: Build_IFWI.bat [options] PlatformType BuildTarget [IFWI Suffix]
153 echo.
154 echo /q Quiet mode. Only display Fatal Errors (slightly faster)
155 echo /l Log a copy of the build output to EDK2.log
156 echo /c CleanAll before building
157 echo /ecp ECP build enable
158 echo /src Build silicon source code (default binary)
159 echo /x64 Set Arch to X64 (default: X64)
160 echo /IA32 Set Arch to IA32 (default: X64)
161 echo /nG Do NOT update the GOP driver when stitching (ie keep src version)
162 echo /nM Do NOT update the Microcode when stitching (ie keep src version)
163 echo /nB Do NOT create a backup of BIOS.ROM before modifying it for Stitch
164 echo.
165 echo Platform Types: MNW2
166 echo Build Targets: Release, Debug
167 echo IFWI Suffix: Suffix to append to end of IFWI filename (default: MM_DD_YYYY)
168 echo.
169 echo See Stitch/Stitch_Config.txt for additional stitching settings.
170 echo.
171 set exitCode=1
172
173 :Exit
174 @REM CD to platform package.
175 cd %ROOT_DIR%\Vlv2TbltDevicePkg
176 exit /b %exitCode%
177
178 EndLocal