summaryrefslogtreecommitdiffstats
path: root/buildallconfigs.sh
blob: c8eb02043e7960de17bd7e504855cf50a97ec63f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env bash
# This script is used to build all sets of config options

set -e

die()
{
    >&2 printf "$@"
    exit 1
}


if [ $# -eq 0 ]; then 
    die "%s [GCC4x] [Platform name]\n" "$0"
    exit 1
fi


# This is required when building with -DTPM_SUPPORT (or for EFI secure
# boot). Save users vain build time and a more cryptic (!)  error
# message
ossl_dir=CryptoPkg/Library/OpensslLib/openssl-0.9.8w

test -d "${ossl_dir}" ||
   die 'Missing OpenSSL dir %s
Please follow instructions in CryptoPkg/Library/OpensslLib/Patch-HOWTO.txt\n' "${ossl_dir}"


# Arrays require bash
FLAVOUR=([0]='PLAIN' [1]='SECURE')
ARG=(    [0]=''      [1]='-DSECURE_LD -DTPM_SUPPORT')


set -x
for num in 0 1; do
    ./quarkbuild.sh -d32 "$@" ${ARG[$num]}
    ./quarkbuild.sh -r32 "$@" ${ARG[$num]}
    (
        set -e
        cd Build/*Platform/
        mkdir  ${FLAVOUR[$num]}/
        ln -s RELEASE_GCC* RELEASE_GCC
        ln -s DEBUG_GCC* DEBUG_GCC
        mv RELEASE_GCC* DEBUG_GCC* ${FLAVOUR[$num]}/
    )
done