summaryrefslogtreecommitdiff
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
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>
-rw-r--r--BuildBIOS.bat104
-rwxr-xr-xBuildBIOS.sh28
-rw-r--r--Platform/BroxtonPlatformPkg/BuildBxtBios.bat (renamed from Platform/BroxtonPlatformPkg/BuildBios.bat)7
-rw-r--r--Platform/BroxtonPlatformPkg/BuildBxtBios.sh (renamed from Platform/BroxtonPlatformPkg/BuildBios.sh)10
-rw-r--r--Platform/BroxtonPlatformPkg/BuildIFWI.bat12
-rwxr-xr-xPlatform/BroxtonPlatformPkg/BuildIFWI.sh16
6 files changed, 66 insertions, 111 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
diff --git a/BuildBIOS.sh b/BuildBIOS.sh
index aea8daa1ab..5ea0dd8515 100755
--- a/BuildBIOS.sh
+++ b/BuildBIOS.sh
@@ -16,7 +16,7 @@ function Usage () {
echo
echo "Script to build BIOS firmware and stitch the entire IFWI."
echo
- echo "Usage: BuildBIOS.sh Build_Flags [PlatformName] Target_Flag"
+ echo "Usage: BuildBios.sh Build_Flags [PlatformName] Target_Flag"
echo
echo " Build_Flags: /MN Minnow3 Board (default: MN)"
echo " Build_Flags: /BG Benson Glacier Board"
@@ -51,7 +51,11 @@ fi
## Build Flags
for (( i=1; i<=$#; ))
do
- if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/BG" ]; then
+ if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/MN" ]; then
+ BoardId=MN
+ Build_Flags="$Build_Flags /MN"
+ shift
+ elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/BG" ]; then
BoardId=BG
Build_Flags="$Build_Flags /BG"
shift
@@ -68,14 +72,22 @@ for (( i=1; i<=$#; ))
fi
done
-Target_Flag=Release
+if [ "$1" == "Broxton" ]; then
+ shift
+ else
+ echo "No parameter for board : assume Broxton"
+fi
+
+Target_Flag=Debug
+
if [ "$1" == "Debug" ]; then
Target_Flag=Debug
- shift
-fi
-if [ "$1" == "Release" ]; then
+elif [ "$1" == "Release" ]; then
Target_Flag=Release
- shift
+else
+ echo "Error - Invalid Target"
+ echo " Please review the Help screen"
+ Usage
fi
echo $Build_Flags
@@ -84,7 +96,7 @@ echo $Target_Flag
export WORKSPACE=`pwd`
export PACKAGES_PATH=$WORKSPACE:$WORKSPACE/Core:$WORKSPACE/Silicon/:$WORKSPACE/Platform:$WORKSPACE/Platform/BroxtonPlatformPkg:$WORKSPACE/Silicon/BroxtonSoC:$WORKSPACE/Platform/BroxtonPlatformPkg/Common
-. edksetup.sh
+. edksetup.sh BaseTools
make -C BaseTools
diff --git a/Platform/BroxtonPlatformPkg/BuildBios.bat b/Platform/BroxtonPlatformPkg/BuildBxtBios.bat
index 04fe6cc58d..7804dc58f7 100644
--- a/Platform/BroxtonPlatformPkg/BuildBios.bat
+++ b/Platform/BroxtonPlatformPkg/BuildBxtBios.bat
@@ -44,8 +44,7 @@ if exist conf\.cache rmdir /q/s conf\.cache
:: Override tools_def.txt
echo Creating Conf folder and build config files...
if not exist %WORKSPACE%\Conf md %WORKSPACE%\Conf
-copy /y %CORE_PATH%\BaseTools\Conf\*.template %WORKSPACE%\Conf\*.txt
-copy /y %WORKSPACE%\%PLATFORM_PATH%\DeviceCommonPkg\Override\BaseTools\Conf\tools_def.template %WORKSPACE%\Conf\tools_def.txt
+copy /y %WORKSPACE%\BaseTools\Conf\*.template %WORKSPACE%\Conf\*.txt
:: 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
@@ -576,9 +575,9 @@ goto :EOF
:Usage
echo.
echo ***************************************************************************
-echo Build BIOS Rom for BXT platforms.
+echo Build Edk II BIOS Rom for BXT platforms.
echo.
-echo Usage: BuildBios.bat [options] ^<PlatformType^> ^<BuildTarget^>
+echo Usage: %0 [options] ^<PlatformType^> ^<BuildTarget^>
echo.
echo. /? Display this help text
echo /l Log a copy of the build output to EDK2.log
diff --git a/Platform/BroxtonPlatformPkg/BuildBios.sh b/Platform/BroxtonPlatformPkg/BuildBxtBios.sh
index b6127e296b..d0b677fb77 100644
--- a/Platform/BroxtonPlatformPkg/BuildBios.sh
+++ b/Platform/BroxtonPlatformPkg/BuildBxtBios.sh
@@ -98,6 +98,9 @@ for (( i=1; i<=$#; ))
if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/X64" ]; then
Arch=X64
shift
+ elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/MN" ]; then
+ BoardId=MN
+ shift
elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/BG" ]; then
BoardId=BG
shift
@@ -232,11 +235,6 @@ fi
./Platform/BroxtonPlatformPkg/Common/Tools/GenBiosId/GenBiosId -i Conf/BiosId.env -o $BUILD_PATH/$Arch/BiosId.bin
-
-echo
-echo "**** Replace DebugLib.h to save space.... ****"
-cp PlatformTools/GCC/DebugLib.h Core/MdePkg/Include/Library/
-
echo
echo "**** Copy ResetVector to original folder ****"
echo "**** Due to nasm can't execute in Ubuntu ****"
@@ -246,6 +244,8 @@ echo "Invoking EDK2 build..."
build $Build_Flags
+echo "check if Build was successful"
+
##**********************************************************************
## Post Build processing and cleanup
##**********************************************************************
diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.bat b/Platform/BroxtonPlatformPkg/BuildIFWI.bat
index 504258040e..a27362ae0a 100644
--- a/Platform/BroxtonPlatformPkg/BuildIFWI.bat
+++ b/Platform/BroxtonPlatformPkg/BuildIFWI.bat
@@ -2,6 +2,7 @@
SetLocal EnableDelayedExpansion EnableExtensions
:: Assign initial values
+set thisscript=%0
set exitCode=0
set "Build_Flags= "
set Arch=X64
@@ -116,7 +117,7 @@ if /i "%~1"=="/m" (
:: Require 2 input parameters
if "%~2"=="" (
echo. & echo -- ERROR: Not Enough Arguments Provided
- echo -- Please review the Help screen "/?" -- & echo.
+ echo -- Please review the Help screen %thisscript% "/?" -- & echo.
goto exit
)
@@ -129,8 +130,8 @@ echo ===========================================================================
echo Build_IFWI: Calling BIOS build Script...
echo.
-echo - call BuildBios.bat %buildthread% %Build_Flags% %Platform_Type% %Build_Target%
-call %WORKSPACE%\%PLATFORM_PATH%\BuildBios.bat %buildthread% %Build_Flags% %Platform_Type% %Build_Target%
+echo - call BuildBxtBios.bat %buildthread% %Build_Flags% %Platform_Type% %Build_Target%
+call %WORKSPACE%\%PLATFORM_PATH%\BuildBxtBios.bat %buildthread% %Build_Flags% %Platform_Type% %Build_Target%
if ErrorLevel 1 (
echo echo -- Error Building BIOS & echo.
set exitCode=1
@@ -170,7 +171,7 @@ if ErrorLevel 1 (
)
echo.
echo Build_IFWI is finished.
-echo The final IFWI file is located in Stitch\
+echo The final IFWI file is located in %WORKSPACE%\%PLATFORM_PATH%\Common\Tools\Stitch\
echo ======================================================================
@@ -180,11 +181,12 @@ goto Exit
if /i "%SkipUsageFlag%" == "TRUE" goto Exit
echo Script to build BIOS firmware and stitch the entire IFWI.
echo.
-echo Usage: BuildIFWI.bat [options] ^<PlatformType^> ^<BuildTarget^>
+echo Usage: %thisscript% [options] ^<PlatformType^> ^<BuildTarget^>
echo.
echo. /? Display this help text
echo /l Log a copy of the build output to EDK2.log
echo /c CleanAll before building
+echo /m Set the build thread count to number of processors
echo /FspW Build FSP and FSP Wrapper
echo /x64 Set Arch to X64 (default)
echo /vs08 Set compiler to VisualStudio 2008
diff --git a/Platform/BroxtonPlatformPkg/BuildIFWI.sh b/Platform/BroxtonPlatformPkg/BuildIFWI.sh
index 73766ccb4d..f5fb4b4a97 100755
--- a/Platform/BroxtonPlatformPkg/BuildIFWI.sh
+++ b/Platform/BroxtonPlatformPkg/BuildIFWI.sh
@@ -19,10 +19,12 @@ function Usage () {
echo
echo "Usage: BuildIFWI.sh Build_Flags Platform_Type Build_Target"
echo
- echo " Build_Flags: /A Set FabId to A (default: FAB_B)"
- echo " Build_Flags: /B Set FabId to B (default: FAB_B)"
- echo " Platform_Type [optional]: Broxton "
- echo " Build_Target: Release, Debug "
+ echo " Build_Flags: /MN Minnow3 Board (default: MN) "
+ echo " Build_Flags: /BG Benson Glacier Board "
+ echo " Build_Flags: /A Set FabId to A (default: FAB_B) "
+ echo " Build_Flags: /B Set FabId to B (default: FAB_B) "
+ echo " Platform_Type [optional]: Broxton "
+ echo " Build_Target: Release, Debug "
echo
echo "Press any key......"
read
@@ -56,6 +58,10 @@ for (( i=1; i<=$#; ))
Arch=X64
Build_Flags="$Build_Flags /x64"
shift
+ elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/MN" ]; then
+ BoardId=MN
+ Build_Flags="$Build_Flags /MN"
+ shift
elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/BG" ]; then
BoardId=BG
Build_Flags="$Build_Flags /BG"
@@ -94,7 +100,7 @@ fi
## Build BIOS
echo "======================================================================"
echo "Build_IFWI: Calling BIOS build Script..."
-bash Platform/BroxtonPlatformPkg/BuildBios.sh $Build_Flags $Platform_Type $Build_Target
+bash Platform/BroxtonPlatformPkg/BuildBxtBios.sh $Build_Flags $Platform_Type $Build_Target
echo
echo Finished Building Process.