-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild_all_demo.sh
executable file
·67 lines (55 loc) · 974 Bytes
/
build_all_demo.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#/bin/bash
set -e
SHELL_FOLDER=$(cd "$(dirname "$0")";pwd)
cd $SHELL_FOLDER
release_path="Release"
algorithm_list=`ls -d algorithm-*`
common_list=`ls -d common-*`
media_list=`ls -d media-*`
netProtocol_list=`ls -d netProtocol-*`
peripheral_list=`ls -d peripheral-*`
alldemo="$algorithm_list $common_list $media_list $netProtocol_list $peripheral_list"
usage()
{
echo "DESCRIPTION"
echo "LMO toolkit-c-demo compile tool."
echo " "
echo "SYNOPSIS"
echo " ./build_all_demo.sh [clear]"
}
clear_api()
{
for var in ${alldemo[@]}
do
if [ -e $var/build.sh ]; then
cd $var
./build.sh clear
cd - > /dev/null
fi
done
}
main() {
# for var in ${alldemo[@]}
# do
# echo $var
# done
if [ $# -eq 1 ]; then
if [ $1 == "clear" ]; then
clear_api
else
usage
fi
exit 0
fi
### 编译所有demo
for var in ${alldemo[@]}
do
if [ -e $var/build.sh ]; then
cd $var
./build.sh clear
./build.sh
cd - > /dev/null
fi
done
}
main "$@"