-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·79 lines (63 loc) · 1.05 KB
/
build
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
#!/usr/bin/bash
recognized=0
if [[ ($# -lt 1) || (($# -eq 1) && ($1 == "all")) ]]
then
recognized=1
./build client
if [ $? != 0 ]
then
echo "*** Failed to compile CLIENT, stop"
exit $?
fi
./build server
if [ $? != 0 ]
then
echo "*** Failed to compile SERVER, stop"
exit $?
fi
exit 0
fi
if [[ ($# -eq 1) && ($1 == "server") ]]
then
recognized=1
g++ -O3 -march=native\
-DTARGET_LINUX\
server_lin.cpp\
berasn1_lin.cpp\
-pedantic -Wall -Wextra\
-o server
if [ $? != 0 ]
then
echo "*** Compilation failed, stop"
exit $?
fi
# Post-compilation commands...
exit 0
fi
if [[ ($# -eq 1) && ($1 == "client") ]]
then
recognized=1
g++ -O3 -march=native\
-DTARGET_LINUX\
client_lin.cpp\
berasn1_lin.cpp\
-pedantic -Wall -Wextra\
-o client
if [ $? != 0 ]
then
echo "*** Compilation failed, stop"
exit $?
fi
# Post-compilation commands...
exit 0
fi
if [[ ($# -eq 1) && ($1 == "clean") ]]
then
recognized=1
rm client
rm server
fi
if [[ $recognized -ne 1 ]]
then
echo "Argument not recognized, try again"
fi