summaryrefslogtreecommitdiff
path: root/BuildBIOS.bat
diff options
context:
space:
mode:
authorLu, ShifeiX A <shifeix.a.lu@intel.com>2017-10-30 09:58:51 +0800
committerzwei4 <david.wei@intel.com>2017-10-30 13:29:20 +0800
commit0c5f7928cb8c527529a1bba8551b6eb0d879546e (patch)
tree162bb739b99e5d857a54dff0644f46ba54fb3b31 /BuildBIOS.bat
parent65aa0a6fb3ef02c70e08f96d0209a5879da877de (diff)
downloadedk2-platforms-0c5f7928cb8c527529a1bba8551b6eb0d879546e.tar.xz
Build script.
Enhance build script. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jarlstrom, Laurie <laurie.jarlstrom@intel.com> Signed-off-by: lushifex <shifeix.a.lu@intel.com>
Diffstat (limited to 'BuildBIOS.bat')
-rw-r--r--BuildBIOS.bat104
1 files changed, 20 insertions, 84 deletions
diff --git a/BuildBIOS.bat b/BuildBIOS.bat
index baf7cdda14..7b2394f3bd 100644
--- a/BuildBIOS.bat
+++ b/BuildBIOS.bat
@@ -1,18 +1,12 @@
@echo off
echo %date% %time%
echo.
+setlocal EnableDelayedExpansion EnableExtensions
set exitCode=0
-set WORKSPACE=%CD%
-set CORE_PATH=%CD%
set BuildFlags=
-set PlatformName=
-set BuildTarget=Debug
-set Compiler=/vs13
-set Arch=/x64
-set FabId=/B
-set BoardId=/MN
-set buildthread=
+
+set thisscript=%0
:: Optional arguments
:OptLoop
@@ -20,82 +14,15 @@ set buildthread=
if /i "%~1"=="" goto Usage
if /i "%~1"=="/?" goto Usage
-if /i "%~1"=="/IA32" (
- set Arch=/IA32
- shift
- goto OptLoop
-)
-
-if /i "%~1"=="/x64" (
- set Arch=/x64
- shift
- goto OptLoop
-)
-
-if /i "%~1"=="/vs08" (
- set Compiler=/vs08
- echo.
- shift
- goto OptLoop
-)
-if /i "%~1"=="/vs10" (
- set Compiler=/vs10
- echo.
- shift
- goto OptLoop
-)
-if /i "%~1"=="/vs12" (
- set Compiler=/vs12
- echo.
- shift
- goto OptLoop
-)
-if /i "%~1"=="/vs13" (
- set Compiler=/vs13
- echo.
- shift
- goto OptLoop
-)
-if /i "%~1"=="/vs15" (
- set Compiler=/vs15
- echo.
- shift
- goto OptLoop
-)
-if /i "%~1"=="/A" (
- set FabId=/A
- echo.
- shift
- goto OptLoop
-)
-if /i "%~1"=="/B" (
- set FabId=/B
- echo.
- shift
- goto OptLoop
-)
-if /i "%~1"=="/MN" (
- set BoardId=/MN
- echo.
- shift
- goto OptLoop
-)
-if /i "%~1"=="/BG" (
- set BoardId=/BG
- echo.
- shift
- goto OptLoop
-)
-
-if /i "%~1"=="/m" (
- set buildthread=/m
- echo.
+set BuildOption=%~1
+if "!BuildOption:~0,1!"=="/" (
+ set BuildFlags=%BuildFlags% %BuildOption%
shift
goto OptLoop
)
:: Required argument(s)
-:: Require 2 input parameters
+:: Require 2 input parameters , first parameter without a "/" is Platform Name
if "%~2"=="" goto Usage
:: Assign required arguments
@@ -104,17 +31,26 @@ set BuildTarget=%~2
:OptLoopEnd
echo ---- Call Build Script of Broxton ----
-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%
+
+if not exist Platform\%PlatformName%PlatformPkg\BuildIFWI.bat (
+ echo Platform %PlatformName%PlatformPkg does not exist
+ echo. & echo Error - Unsupported Platform name: %1
+ echo.
+ goto Usage
+)
+
+echo calling : Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %BuildFlags% /fspw MINN %BuildTarget%
+call Platform\%PlatformName%PlatformPkg\BuildIFWI.bat %BuildFlags% /fspw MINN %BuildTarget%
goto Exit
:Usage
-echo Usage: BuildBIOS.bat [options] ^<PlatformName^> ^<BuildTarget^>
+echo Usage: %thisscript% [options] ^<PlatformName^> ^<BuildTarget^>
echo.
echo Options:
echo. /? Display this help text
echo.
+echo /m Set the build thread count to number of processors
echo /vs13 Set Compiler to vs2013 build (default: vs2013)
echo /x64 Set Arch to X64 (default: X64)
echo /IA32 Set Arch to IA32 (default: X64)
@@ -126,7 +62,7 @@ echo PlatformName: Broxton
echo BuildTargets: Release, Debug
echo Examples:
-echo BuildBIOS.bat /vs13 /B /x64 Broxton Debug
+echo %thisscript% /vs13 /B /x64 Broxton Debug
set exitCode=1