8559558df66b3d0eff3a25df680f7b54b2582354
[debian/splat] / build
1 #!/bin/bash
2 #
3 # Simple shell script for building SPLAT! and associated utilities.
4 # Written by John A. Magliacane, KD2BD May 2002 -- Last update: March 2006
5 #
6
7 cpu=`uname -m`
8
9 build_splat()
10 {
11         echo -n "Compiling SPLAT!... "
12         g++ -Wall -O3 -s -lm -lbz2 -fomit-frame-pointer -march=$cpu itm.cpp splat.cpp -o splat
13         echo "Done!"
14 }
15
16 build_utils()
17 {
18         cd utils
19         ./build all
20         cd ..
21 }
22
23 if [ $# == "0" ]; then
24         echo "Usage: build  { splat, utils, all }"
25 else
26
27         if [ $1 == "splat" ]; then
28                 build_splat
29         fi
30
31         if [ $1 == "utils" ]; then
32                 build_utils
33         fi
34
35         if [ $1 == "all" ]; then
36                 build_splat
37                 build_utils
38         fi
39
40         if [ $1 != "splat" ] && [ $1 != "utils" ] && [ $1 != "all" ]; then
41                 echo "Usage: build { splat, utils, all }"
42         fi
43 fi
44