#!/bin/sh       
# file ddmake.sol ---------- Bourne shell --------- update: 27 Sep. 1999
# ----------------------------------------------------------------------
# Script for implementing DIRDIF-99  ===  on the  SUN POLARIS 2.4 (unix)
# ======================================> Note: use nijx1.sun (not .sol)
# ----------------------------------------------------------------------
# Script for implementing DIRDIF-99.2  ===> unix, part 1  = ddmake.XXX .
# This part is computer dependent. This may be Bourne or Korn shell    . 
# Part 1 will call parts 2 and 3 which are computer independent (unix) .
# NOTE:
# We are assumed to be in the dirdif root directory 'ddroot'
# All necessary files ( downloaded by ftp )  are in subdirectory 'ddftp'
# All file-names obtained by ftp for unix are defined in lower case !
# ----------------------------------------------------------------------
rm -f ddmake2
echo "#!/bin/sh" > ddmake2
chmod u+x ddmake2
cp ddmake2 ddmake3
cat ddmake2.unix >> ddmake2
cat ddmake3.unix >> ddmake3
#
ddmake2                             # make all ready for compilations
cd ..                               # back to ddroot 
cat ddftp/nijx1.sun  > nijx.f       # note: nijx1.sun is OK for SOL
cat ddftp/nijx2.f   >> nijx.f
#        
# use -O4 for max optimisation (if problems: use -O3 ! )
# use -Bstatic   to save values of variables at subroutine exit
# use -native for optimum local floating point hardware
# use -lV77   to use the library of VMS routines (date and time)
f77 -c -native -Bstatic -O4 nijx.f -lV77
ar cr nijx.a nijx.o
ranlib nijx.a
# ?? rm *.o
#   Compile and link the individual programs. Mind the capitals
echo "DDSTART"
f77 -O4 -native -Bstatic -o DDSTART ddstart.f nijx.a -lV77
echo "DDMAIN"
f77 -O4 -native -Bstatic -o DDMAIN  ddmain.f  nijx.a -lV77
echo "ORIENT"
f77 -O4 -native -Bstatic -o ORIENT  orient.f  nijx.a -lV77
echo "TRACOR"
f77 -O4 -native -Bstatic -o TRACOR  tracor.f  nijx.a -lV77
echo "TRAVEC"
f77 -O4 -native -Bstatic -o TRAVEC  travec.f  nijx.a -lV77
echo "PATTY"
f77 -O4 -native -Bstatic -o PATTY   patty.f   nijx.a -lV77
echo "PHASEX"
f77 -O4 -native -Bstatic -o PHASEX  phasex.f  nijx.a -lV77
echo "FOUR"
f77 -O4 -native -Bstatic -o FOUR    four.f    nijx.a -lV77
echo "NUTS"
f77 -O4 -native -Bstatic -o NUTS    nuts.f    nijx.a -lV77
#                                    # so far the compilation.
ddmake3                              # final things to do
rm ddmake3
#  ---------------------------------------------------- end of ddmake
