Imported Upstream version 1.3.0
[debian/splat] / build
diff --git a/build b/build
index 53f3d05924cb43075bbe96a63856878c772b7fb8..5c02fe99a683874bf6c2c61e133de20fa81b020f 100755 (executable)
--- a/build
+++ b/build
@@ -1,21 +1,47 @@
 #!/bin/bash
 #
 # Simple shell script for building SPLAT! and associated utilities.
-# Written by John A. Magliacane, KD2BD May 2002 -- Last update: October 2007
+# Written by John A. Magliacane, KD2BD May 2002 -- Last update: March 2009
 #
 
 cpu=`uname -m`
 
-if [ $cpu == "x86_64" ]; then
+if [ "$cpu" = "x86_64" ]; then
         cpu="x86-64"
 fi
 
 build_splat()
 {
+       if [ -r std-parms.h ]; then
+               cp std-parms.h splat.h
+       else
+               echo "/* Parameters for 3 arc-second standard resolution mode of operation */" > std-parms.h
+
+               echo "#define MAXPAGES 9" >> std-parms.h
+               echo "#define HD_MODE 0" >> std-parms.h
+               cp std-parms.h splat.h
+       fi
+
        echo -n "Compiling SPLAT!... "
-       ## g++ -Wall -O3 -s -lm -lbz2 -fomit-frame-pointer -march=$cpu itm.cpp splat.cpp -o splat
        g++ -Wall -O3 -fomit-frame-pointer -ffast-math -march=$cpu itm.cpp splat.cpp -lm -lbz2 -o splat
-       echo "Done!"
+
+       if [ -x splat ]; then
+               echo "Done!"
+       else
+               echo "Compilation failed!"
+       fi
+
+       if [ -r hd-parms.h ]; then
+               cp hd-parms.h splat.h
+               echo -n "Compiling SPLAT! HD... "
+               g++ -Wall -O3 -fomit-frame-pointer -ffast-math -march=$cpu itm.cpp splat.cpp -lm -lbz2 -o splat-hd
+
+               if [ -x splat-hd ]; then
+                       echo "Done!"
+               else
+                       echo "Compilation failed!"
+               fi
+       fi
 }
 
 build_utils()
@@ -25,24 +51,25 @@ build_utils()
        cd ..
 }
 
-if [ $# == "0" ]; then
+if [ "$#" = "0" ]; then
        echo "Usage: build  { splat, utils, all }"
 else
 
-       if [ $1 == "splat" ]; then
+       if [ "$1" = "splat" ]; then
                build_splat
        fi
 
-       if [ $1 == "utils" ]; then
+       if [ "$1" = "utils" ]; then
                build_utils
        fi
 
-       if [ $1 == "all" ]; then
+       if [ "$1" = "all" ]; then
                build_splat
                build_utils
        fi
 
-       if [ $1 != "splat" ] && [ $1 != "utils" ] && [ $1 != "all" ]; then
+       if [ "$1" != "splat" ] && [ "$1" != "utils" ] && [ "$1" != "all" ]; then
                echo "Usage: build { splat, utils, all }"
        fi
 fi
+