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
|
#!/usr/bin/env bash
###
# http://stackoverflow.com/a/23342259
###
exe() { echo "\$ $@" ; "$@" ; }
show_usage () {
echo ""
echo "Set up the building of libssts and clean up too."
echo " ./build.sh clean - Clean up the project and build files."
echo ""
echo " ./build.sh build - Create the build directory, run CMake (if"
echo " needed) and build libssts."
echo ""
echo " ./build.sh help - Show this helpful help text."
}
do_build () {
if ( ! -d "./build" )
then
exe mkdir ./build
fi
cd ./build
if [ ! -f "Makefile" ]
then
exe cmake ..
fi
make
}
do_clean () {
if [ -d "./build" ]
then
exe rm -R ./build
fi
}
case $1 in
"help"|"-h") show_usage ;;
"clean") do_clean ;;
"build"|"") do_build ;;
*) show_usage ;;
esac
|