move gbp.conf to debian/
[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 2009
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         if [ -r std-parms.h ]; then
16                 cp std-parms.h splat.h
17         else
18                 echo "/* Parameters for 3 arc-second standard resolution mode of operation */" > std-parms.h
19
20                 echo "#define MAXPAGES 9" >> std-parms.h
21                 echo "#define HD_MODE 0" >> std-parms.h
22                 cp std-parms.h splat.h
23         fi
24
25         echo -n "Compiling SPLAT!... "
26         g++ -Wall -O3 -fomit-frame-pointer -ffast-math -march=$cpu itm.cpp splat.cpp -lm -lbz2 -o splat
27
28         if [ -x splat ]; then
29                 echo "Done!"
30         else
31                 echo "Compilation failed!"
32         fi
33
34         if [ -r hd-parms.h ]; then
35                 cp hd-parms.h splat.h
36                 echo -n "Compiling SPLAT! HD... "
37                 g++ -Wall -O3 -fomit-frame-pointer -ffast-math -march=$cpu itm.cpp splat.cpp -lm -lbz2 -o splat-hd
38
39                 if [ -x splat-hd ]; then
40                         echo "Done!"
41                 else
42                         echo "Compilation failed!"
43                 fi
44         fi
45 }
46
47 build_utils()
48 {
49         cd utils
50         ./build all
51         cd ..
52 }
53
54 if [ "$#" = "0" ]; then
55         echo "Usage: build  { splat, utils, all }"
56 else
57
58         if [ "$1" = "splat" ]; then
59                 build_splat
60         fi
61
62         if [ "$1" = "utils" ]; then
63                 build_utils
64         fi
65
66         if [ "$1" = "all" ]; then
67                 build_splat
68                 build_utils
69         fi
70
71         if [ "$1" != "splat" ] && [ "$1" != "utils" ] && [ "$1" != "all" ]; then
72                 echo "Usage: build { splat, utils, all }"
73         fi
74 fi