Bruce Cran | d550b88 | 2015-02-26 06:49:31 +0000 | [diff] [blame] | 1 | #!/usr/bin/env bash |
David Wei | 3cbfba0 | 2015-01-12 09:37:20 +0000 | [diff] [blame] | 2 | ##********************************************************************** |
| 3 | ## Function define |
| 4 | ##********************************************************************** |
| 5 | function Usage ( ) { |
| 6 | echo |
| 7 | echo "Script to build BIOS firmware and stitch the entire IFWI." |
| 8 | echo |
| 9 | echo "Usage: Build_IFWI.bat PlatformType BuildTarget " |
| 10 | echo |
| 11 | echo |
| 12 | echo " Platform Types: MNW2" |
| 13 | echo " Build Targets: Release, Debug" |
| 14 | echo |
| 15 | echo " See Stitch/Stitch_Config.txt for additional stitching settings." |
| 16 | echo |
| 17 | echo |
David Wei | 3cbfba0 | 2015-01-12 09:37:20 +0000 | [diff] [blame] | 18 | exit 0 |
| 19 | } |
| 20 | |
| 21 | ## Assign initial values |
| 22 | exitCode=0 |
| 23 | Build_Flags= |
| 24 | Stitch_Flags= |
| 25 | Arch=X64 |
| 26 | PLATFORM_PACKAGE=Vlv2TbltDevicePkg |
| 27 | |
| 28 | ## Parse Optional arguments |
| 29 | if [ "$1" == "/?" ]; then |
| 30 | Usage |
| 31 | fi |
| 32 | |
| 33 | for (( i=1; i<=$#; )) |
| 34 | do |
| 35 | if [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/Q" ]; then |
| 36 | Build_Flags="$Build_Flags /q" |
| 37 | shift |
| 38 | elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/L" ]; then |
| 39 | Build_Flags="$Build_Flags /l" |
| 40 | shift |
| 41 | elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/C" ]; then |
| 42 | Build_Flags="$Build_Flags /c" |
| 43 | shift |
| 44 | elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/ECP" ]; then |
| 45 | Build_Flags="$Build_Flags /ecp" |
| 46 | shift |
| 47 | elif [ "$(echo $1 | tr 'a-z' 'A-Z')" == "/X64" ]; then |
| 48 | Arch=X64 |
| 49 | Build_Flags="$Build_Flags /x64" |
| 50 | shift |
| 51 | elif [ "$1" == "/nG" ]; then |
| 52 | Stitch_Flags="$Stitch_Flags /nG" |
| 53 | shift |
| 54 | elif [ "$1" == "/nM" ]; then |
| 55 | Stitch_Flags="$Stitch_Flags /nM" |
| 56 | shift |
| 57 | elif [ "$1" == "/nB" ]; then |
| 58 | Stitch_Flags="$Stitch_Flags /nB" |
| 59 | shift |
| 60 | elif [ "$1" == "/nV" ]; then |
| 61 | Stitch_Flags="$Stitch_Flags /nV" |
| 62 | shift |
| 63 | else |
| 64 | break |
| 65 | fi |
| 66 | done |
| 67 | |
| 68 | ## Require 2 input parameters |
| 69 | if [ "$2" == "" ]; then |
| 70 | Usage |
| 71 | fi |
| 72 | |
| 73 | ## Assign required arguments |
| 74 | Platform_Type=$1 |
| 75 | Build_Target=$2 |
| 76 | if [ "$3" == "" ]; then |
| 77 | IFWI_Suffix= |
| 78 | else |
| 79 | IFWI_Suffix="/S $3" |
| 80 | fi |
| 81 | |
| 82 | ## Go to root directory |
| 83 | cd .. |
| 84 | |
| 85 | ## Build BIOS |
| 86 | echo "======================================================================" |
| 87 | echo "Build_IFWI: Calling BIOS build Script..." |
| 88 | ./$PLATFORM_PACKAGE/bld_vlv.sh $Build_Flags $Platform_Type $Build_Target |
| 89 | |
| 90 | echo |
| 91 | echo Finished Building BIOS. |
| 92 | |
| 93 | ## Start Integration process |
| 94 | echo ====================================================================== |
| 95 | echo Skip "Build_IFWI: Calling IFWI Stitching Script..." |
| 96 | |
| 97 | echo |
| 98 | echo Build_IFWI is finished. |
| 99 | echo The final IFWI file is located in Stitch |
| 100 | echo ====================================================================== |