#
#
#  A csh script to Compile the elements of the AMPS
#  package.
#
#  To Build under VAX/VMS (or ALPHA/VMS) see the file BUILD.COM
#
#  Written to simplify installation GJB 24/8/93.
#  
#  This assumes that all Makefiles are consistent with your
#  Computer and operating system.
#
#  Makefiles for Sun and Silicon Graphics are included in each 
#  Directory.   The Silicon Graphics Makefiles do not make the
#  highest level of optimisation, so more speed may be obtained by
#  customising the Makefile and f77/cc parameters.
#
#  To use this script type:
#
#  BUILD sgi    for Silicon Graphics
#
#  or 
#
#  BUILD sun    for Sun 
#
#  or 
#
#  BUILD osf    for DEC ALPHA/OSF1
#
#
#  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.
#  The most important difference is that ORDER should be compiled with 
#  -i4 and AMULT with -i2.  If you have plenty of memory, then compile
#  everything with -i4.  You will only need one copy of util.f and ran2.f
#  ran2.f must always be compiled with 4-byte integers (-i4).
#
#  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 Makefile.$1 Makefile
cp util_unix.f util.f
make
mv amult.$1 ../bin/multalign.$1
cd ..
echo ""
echo " Trying to compile program ORDER"
echo ""
cd order
rm  *.o
cp Makefile.$1 Makefile
cp util_unix.f util.f
make
mv sorts.$1 ../bin/order.$1
cd ..
echo ""
echo " Trying to compile program PATT"
echo ""
cd patt
rm  *.o
cp Makefile.$1 Makefile
make
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
cp Makefile.$1 Makefile
make
mv dayb.$1 ../bin/dayb.$1
cd ..
echo ""
echo " Trying to compile program SORTER"
echo ""
cd sort
rm  *.o
rm  *.u
cp Makefile.$1 Makefile
make
mv sorter.$1 ../bin/sorter.$1
cd ..
echo ""
echo " HAVE TRIED TO COMPILE ALL PROGRAMS"
echo " You should have a bin directory with 6 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 ""



