-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·86 lines (71 loc) · 1.97 KB
/
build.sh
File metadata and controls
executable file
·86 lines (71 loc) · 1.97 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
ROOT_PWD=$(cd "$(dirname $0)" && cd -P "$(dirname "$SOURCE")" && pwd)
if [ "$1" = "clean" ]; then
if [ -d "${ROOT_PWD}/build" ]; then
rm -rf "${ROOT_PWD}/build"
echo " ${ROOT_PWD}/build has been deleted!"
fi
if [ -d "${ROOT_PWD}/install" ]; then
rm -rf "${ROOT_PWD}/install"
echo " ${ROOT_PWD}/install has been deleted!"
fi
exit
fi
libc_options=("uclibc"
"glibc")
PS3="Enter your choice [1-${#libc_options[@]}]: "
select opt in "${libc_options[@]}"; do
if [[ -n "$opt" ]]; then
echo "You selected: $opt"
echo "你选择了: $opt"
libc_type="$opt"
break
else
echo "Invalid selection, please try again."
echo "无效的选择,请重新选择。"
fi
done
options=("luckfox_pico_retinaface_facenet"
"luckfox_pico_retinaface_facenet_spidev"
"luckfox_pico_yolov5")
options_device=("LUCKFOX_PICO_PLUS"
"LUCKFOX_PICO_PRO_MAX")
PS3="Enter your choice [1-${#options[@]}]: "
select opt in "${options[@]}"; do
if [[ -n "$opt" ]]; then
echo "You selected: $opt"
echo "你选择了: $opt"
if [ "$opt" == "luckfox_pico_retinaface_facenet_spidev" ]; then
PS3="Enter your choice [1-${#options_device[@]}]: "
select dev_opt in "${options_device[@]}"; do
if [[ -n "$opt" ]]; then
echo "You selected: $dev_opt"
echo "你选择了: $dev_opt"
DEVICE=$dev_opt
break
fi
done
fi
src_dir="example/$opt"
if [[ -d "$src_dir" ]]; then
if [ -d ${ROOT_PWD}/build ]; then
rm -rf ${ROOT_PWD}/build
fi
mkdir ${ROOT_PWD}/build
cd ${ROOT_PWD}/build
if [ -z "$DEVICE" ]; then
cmake .. -DEXAMPLE_DIR="$src_dir" -DEXAMPLE_NAME="$opt" -DLIBC_TYPE="$libc_type"
else
cmake .. -DEXAMPLE_DIR="$src_dir" -DEXAMPLE_NAME="$opt" -DLIBC_TYPE="$libc_type" -D"$DEVICE"=ON
fi
make -j install
else
echo "错误:目录 $src_dir 不存在!"
echo "Error: Directory $src_dir does not exist!"
fi
break
else
echo "Invalid selection, please try again."
echo "无效的选择,请重新选择。"
fi
done