-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·67 lines (61 loc) · 1.19 KB
/
build.sh
File metadata and controls
executable file
·67 lines (61 loc) · 1.19 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
#!/bin/bash
build_client () {
cd ./client
mkdir -p build
cd ./build
cmake ..
make
cp client ../../client_app
cd ../../
}
build_server () {
cd ./server
mkdir -p build
cd ./build
cmake ..
make
cp server ../../server_app
cd ../../
}
build_ssl () {
cd ./server/openssl
chmod +x generate.sh
./generate.sh
cd ../../
}
is_client_builded=0
is_server_builded=0
if [[ $# -eq 0 ]]; then
echo 'Provide build options please!'
exit 0
fi
while [[ $# -gt 0 ]]; do
case $1 in
-c|--client)
build_client
is_client_builded=1
shift
;;
-s|--server)
build_ssl
build_server
is_server_builded=1
shift
;;
-a|--all)
if [[ is_client_builded -eq 0 ]]; then
build_client
is_client_builded=1;
fi
if [[ is_server_builded -eq 0 ]]; then
build_ssl
build_server
is_server_builded=1
fi
shift
;;
-*|--*)
echo "Unknown option $1"
exit 1
esac
done