blob: f5e499c2d211c892a158ce88776e145d6483ab90 [file] [log] [blame]
Bruce Crand550b882015-02-26 06:49:31 +00001#!/usr/bin/env bash
David Wei3cbfba02015-01-12 09:37:20 +00002##**********************************************************************
3## Function define
4##**********************************************************************
5function 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 Wei3cbfba02015-01-12 09:37:20 +000018 exit 0
19}
20
21## Assign initial values
22exitCode=0
23Build_Flags=
24Stitch_Flags=
25Arch=X64
26PLATFORM_PACKAGE=Vlv2TbltDevicePkg
27
28## Parse Optional arguments
29if [ "$1" == "/?" ]; then
30 Usage
31fi
32
33for (( 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
69if [ "$2" == "" ]; then
70 Usage
71fi
72
73## Assign required arguments
74Platform_Type=$1
75Build_Target=$2
76if [ "$3" == "" ]; then
77 IFWI_Suffix=
78else
79 IFWI_Suffix="/S $3"
80fi
81
82## Go to root directory
83cd ..
84
85## Build BIOS
86echo "======================================================================"
87echo "Build_IFWI: Calling BIOS build Script..."
88./$PLATFORM_PACKAGE/bld_vlv.sh $Build_Flags $Platform_Type $Build_Target
89
90echo
91echo Finished Building BIOS.
92
93## Start Integration process
94echo ======================================================================
95echo Skip "Build_IFWI: Calling IFWI Stitching Script..."
96
97echo
98echo Build_IFWI is finished.
99echo The final IFWI file is located in Stitch
100echo ======================================================================