Imported Upstream version 1.2.1
[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: October 2007
5 #
6
7 cpu=`uname -m`
8
9 if [ $cpu == "x86_64" ]; then
10         cpu="x86-64"
11 fi
12
13 build_splat()
14 {
15         echo -n "Compiling SPLAT!... "
16         ## g++ -Wall -O3 -s -lm -lbz2 -fomit-frame-pointer -march=$cpu itm.cpp splat.cpp -o splat
17         g++ -Wall -O3 -fomit-frame-pointer -ffast-math -march=$cpu itm.cpp splat.cpp -lm -lbz2 -o splat
18         echo "Done!"
19 }
20
21 build_utils()
22 {
23         cd utils
24         ./build all
25         cd ..
26 }
27
28 if [ $# == "0" ]; then
29         echo "Usage: build  { splat, utils, all }"
30 else
31
32         if [ $1 == "splat" ]; then
33                 build_splat
34         fi
35
36         if [ $1 == "utils" ]; then
37                 build_utils
38         fi
39
40         if [ $1 == "all" ]; then
41                 build_splat
42                 build_utils
43         fi
44
45         if [ $1 != "splat" ] && [ $1 != "utils" ] && [ $1 != "all" ]; then
46                 echo "Usage: build { splat, utils, all }"
47         fi
48 fi