-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sh
executable file
·46 lines (37 loc) · 1.57 KB
/
build.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
#!/bin/bash
#The current directory full path
declare -r DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
#A variable to determine whether to silence output of internal commands
declare silence=$1
#####################################################################
# #
# Script to build the TCPcannon #
# #
# Running instructions: #
# chmod +x build.sh #
# ./build.sh #
# #
# Option: Avoid getting the full output of the internal commands: #
# ./build.sh quiet #
# #
# Once ran, you can run the executables by: #
# bin/cannon #
#####################################################################
#A simple function to silence output
quiet(){
if [ "$silence" == "quiet" ]; then
"$@" > /dev/null
else
"$@"
fi
}
echo "Building the files..."
quiet rm -R build 2> /dev/null
quiet mkdir build
quiet cd build
echo "Running CMake..."
quiet cmake .. -DCMAKE_INSTALL_PREFIX=.. -DCMAKE_BUILD_TYPE=Debug
echo "Running Make..."
quiet make
quiet make install
echo "Finished!"