-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·42 lines (37 loc) · 1023 Bytes
/
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
#!/bin/bash
DL="https://github.com/openipc/firmware/releases/download/latest"
if [[ "$1" == *"star6b0" ]]; then
CC=cortex_a7_thumb2_hf-gcc13-musl-4_9
elif [[ "$1" == *"star6e" ]]; then
CC=cortex_a7_thumb2_hf-gcc13-glibc-4_9
elif [[ "$1" == *"goke" ]]; then
CC=cortex_a7_thumb2-gcc13-musl-4_9
elif [[ "$1" == *"hisi" ]]; then
CC=cortex_a7_thumb2-gcc13-musl-4_9
elif [[ "$1" == *"x86" ]]; then
echo "x86 build ..."
else
echo "Usage: $0 [goke|hisi|star6b0|star6e]"
exit 1
fi
GCC=$PWD/toolchain/$CC/bin/arm-linux-gcc
if [ ! -e toolchain/$CC ]; then
wget -c -q --show-progress $DL/$CC.tgz -P $PWD
mkdir -p toolchain/$CC
tar -xf $CC.tgz -C toolchain/$CC --strip-components=1 || exit 1
rm -f $CC.tgz
fi
if [ ! -e firmware ]; then
git clone https://github.com/openipc/firmware --depth=1
fi
if [ "$1" = "goke" ]; then
make -B CC=$GCC
elif [ "$1" = "hisi" ]; then
make -B CC=$GCC
elif [ "$1" = "star6b0" ]; then
make -B CC=$GCC
elif [ "$1" = "star6e" ]; then
make -B CC=$GCC
elif [ "$1" = "x86" ]; then
make
fi