forked from OpenIPC/msposd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·52 lines (45 loc) · 1.51 KB
/
build.sh
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
48
49
50
51
52
#!/bin/bash
DL="https://github.com/OpenIPC/firmware/releases/download/toolchain/toolchain"
if [ "$#" -ne 1 ]; then
echo "Usage: $0 [goke|hisi|star6b0|star6e|native]"
exit 1
fi
if [[ "$1" == *"star6b0" ]]; then
CC=sigmastar-infinity6b0
elif [[ "$1" == *"star6e" ]]; then
CC=sigmastar-infinity6e
elif [[ "$1" == *"goke" ]]; then
CC=goke-gk7205v200
elif [[ "$1" == *"hisi" ]]; then
CC=hisilicon-hi3516ev200
fi
GCC=$PWD/toolchain/$CC/bin/arm-linux-gcc
OUT=msposd
if [[ "$1" != *"native"* ]]; then
if [ ! -e toolchain/$CC ]; then
wget -c -q --show-progress $DL.$CC.tgz -P $PWD
mkdir -p toolchain/$CC
tar -xf toolchain.$CC.tgz -C toolchain/$CC --strip-components=1 || exit 1
rm -f $CC.tgz
fi
OUT=msposd_$1
fi
if [ ! -e firmware ]; then
git clone https://github.com/openipc/firmware --depth=1
fi
if [ "$1" = "goke" ]; then
DRV=$PWD/firmware/general/package/goke-osdrv-gk7205v200/files/lib
make -B CC=$GCC DRV=$DRV TOOLCHAIN=$PWD/toolchain/$CC OUTPUT=$OUT $1
elif [ "$1" = "hisi" ]; then
DRV=$PWD/firmware/general/package/hisilicon-osdrv-hi3516ev200/files/lib
make -B CC=$GCC DRV=$DRV TOOLCHAIN=$PWD/toolchain/$CC OUTPUT=$OUT $1
elif [ "$1" = "star6b0" ]; then
DRV=$PWD/firmware/general/package/sigmastar-osdrv-infinity6b0/files/lib
make -B CC=$GCC DRV=$DRV TOOLCHAIN=$PWD/toolchain/$CC OUTPUT=$OUT $1
elif [ "$1" = "star6e" ]; then
DRV=$PWD/firmware/general/package/sigmastar-osdrv-infinity6e/files/lib
make -B CC=$GCC DRV=$DRV TOOLCHAIN=$PWD/toolchain/$CC OUTPUT=$OUT $1
else
DRV=$PWD
make DRV=$DRV OUTPUT=$OUT $1
fi