#
#
#  A csh script to Compile the elements of the AMPS
#  package.
#
#  To Build under VAX/VMS (or ALPHA/VMS) see the file BUILD.COM
#
#  NOTE:  Compilation under vax/vms is no longer supported.  However,
#  if you really want to, it should compile OK under that o/s.
#
#  Written to simplify installation GJB 24/8/93.
#  
#  This assumes that all Makefiles are consistent with your
#  Computer and operating system.
#
#  You may need to modify the makefiles to work on your particular
#  computer system.  The makefiles for SGI are the only ones I have
#  tested extensively.
#
#  To use this script type:
#
#  BUILD sgi    for Silicon Graphics
#  BUILD sgi64  for silicon graphics 64 bit mips4
#
#  If you want to compile for a different type of computer,
#  then copy each makefile to something with an appropriate
#  extension.  e.g. Makefile.linux. Edit the makefile to suit
#  the operating system, then execute this BUILD script.
#
#
#  The sources are in the subdirectories:
#
#  align : program MULTALIGN and FSCAN  (AMULT)
#  order : program ORDER
#  patt  : program patt
#  select: program select4  (can be renamed to select)
#  dayb  : program dayb
#  sort  : program sorter
#  
#
#  Note:  If you want to use the flexible pattern scanning features
#  then you need to compile a separate copy of AMULT with revised dimensions
#
#  See align/params.blk for details
#
#  The utility routines in util.f are duplicated in some of the
#  subdirectories to simplify compilation with different compiler flags.
#
#  From July 1994 - all makefiles default to -i4.  Most computers these 
#  days can cope fine with this.  There were problems with -i2 on SG and
#  Dec ALPHA.
#
#  The binaries that are created will have the extension .sun or .sgi
#  depending on the computer type chosen.  This means that you can have
#  binaries for both sun and sgi coexisting in the same directory.
#
echo "Creating subdirectory for executables"
echo ""
mkdir bin
echo ""
echo "Trying to compile program AMULT"
echo ""
cd align
rm *.o
rm  *.u
cp util_unix.f util.f
make -f Makefile.$1
mv amult.$1 ../bin/multalign.$1
cd ..
echo ""
echo " Trying to compile program ORDER"
echo ""
cd order
rm  *.o
cp util_unix.f util.f
make -f Makefile.$1
mv sorts.$1 ../bin/order.$1
cd ..
echo ""
echo " Trying to compile program PATT"
echo ""
cd patt
rm  *.o
make -f Makefile.$1
mv patt.$1 ../bin/patt.$1
cd ..
#echo ""
#echo " Trying to compile program SELECT"
#echo ""
#cd select
#rm  *.o
#cp Makefile.$1 Makefile
#make
#mv select4.$1 ../bin/select.$1
#cd ..
echo ""
echo " Trying to compile program DAYB"
echo ""
cd dayb
rm  *.o
make -f Makefile.$1
mv dayb.$1 ../bin/dayb.$1
cd ..
echo ""
echo " Trying to compile program SORTER"
echo ""
cd sort
rm  *.o
rm  *.u
make -f Makefile.$1
mv sorter.$1 ../bin/sorter.$1
cd ..
echo ""
echo " HAVE TRIED TO COMPILE ALL PROGRAMS"
echo " You should have a bin directory with 5 programs in it"
echo ""
echo " Either copy these programs to /usr/local/bin or add links"
echo " Or add the bin directory to your path"
echo ""



