/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk

« back to all changes in this revision

Viewing changes to build.sh

* Merged in new Main Loop branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env bash
 
2
 
 
3
###
 
4
# http://stackoverflow.com/a/23342259
 
5
###
 
6
exe() { echo "\$ $@" ; "$@" ; }
 
7
 
 
8
show_usage () {
 
9
  echo ""
 
10
  echo "Set up the building of libssts and clean up too."
 
11
  echo "  ./build.sh clean  -  Clean up the project and build files."
 
12
  echo ""
 
13
  echo "  ./build.sh build  -  Create the build directory, run CMake (if"
 
14
  echo "                       needed) and build libssts."
 
15
  echo ""
 
16
  echo "  ./build.sh help   -  Show this helpful help text."
 
17
}
 
18
 
 
19
do_build () {
 
20
  if ( ! -d "./build" )
 
21
  then
 
22
    exe mkdir ./build
 
23
  fi
 
24
  
 
25
  cd ./build
 
26
  
 
27
  if [ ! -f "Makefile" ]
 
28
  then
 
29
    exe cmake ..
 
30
  fi
 
31
  
 
32
  make
 
33
}
 
34
 
 
35
do_clean () {
 
36
  if [ -d "./build" ]
 
37
  then
 
38
    exe rm -R ./build
 
39
  fi
 
40
}
 
41
 
 
42
case $1 in
 
43
     "help"|"-h") show_usage ;;
 
44
     "clean") do_clean ;;
 
45
     "build"|"") do_build ;;
 
46
     *) show_usage ;;
 
47
esac
 
48
 
 
49
 
 
50