init.sh
1.53 KB
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
53
54
#!/bin/bash
read -p "Build hi3519 or hi3516cv500 or s2(h/c/s)?(h)" PLAT
if [ -z $PLAT ]; then
PLAT="h"
fi
if [[ $PLAT =~ ^([hH][iI][3][5][1][9]|[hH])$ ]]; then
PLAT=hi3519
PLAT_MAKEFILE=appweb-linux-default-hi3519-32.mk
BUILD_DIR=linux-hi3519-32-default
COMPILER=/opt/hisi-linux/x86-arm/arm-hisiv500-linux/bin/arm-hisiv500-linux-uclibcgnueabi-gcc
elif [[ $PLAT =~ ^([sS][2]|[sS])$ ]]; then
PLAT=s2
PLAT_MAKEFILE=appweb-linux-default-s2-32.mk
BUILD_DIR=linux-s2-32-default
COMPILER=/usr/local/linaro-multilib-2014.06-gcc4.9/bin/arm-linux-gnueabihf-gcc
elif [[ $PLAT =~ ^([cC][vV]|[cC])$ ]]; then
PLAT=hi3516cv500
PLAT_MAKEFILE=appweb-linux-default-hi3516cv500-32.mk
BUILD_DIR=linux-hi3516cv500-32-default
COMPILER=/opt/hisi-linux/x86-arm/arm-himix200-linux/bin/arm-himix200-linux-gcc
else
echo -e "\033[0;31;40mInput error \033[0m"
exit -1
fi
if [[ ! -f ../projects/$PLAT_MAKEFILE ]]; then
echo -e "\033[0;31;40mBuild error \033[0m"
echo -e "\033[0;31;40mMake sure the file ../projects/$PLAT_MAKEFILE exists\033[0m"
echo -e "\033[0;31;40mPlease check the svn\033[0m"
exit -1
fi
#build appweb
cd ..
make -f projects/$PLAT_MAKEFILE
if [[ $? -ne 0 ]]; then
echo -e "\033[0;31;40mBuild $PLAT appweb error \033[0m"
exit -1
fi
cd -
#build business
export CC=$COMPILER
appesp --platform ../build/$BUILD_DIR clean
appesp --platform ../build/$BUILD_DIR compile
if [[ $? -ne 0 ]]; then
echo -e "\033[0;31;40mBuild $PLAT error \033[0m"
else
echo -e "\033[0;32;40mBuild $PLAT done! \033[0m"
fi
#-Wunused-local-typedefs