#!/bin/sh    
# file ddmake.rs6 ---------- Bourne shell --------- update: 27 Sep. 1999
# ----------------------------------------------------------------------
# Script for implementing DIRDIF-99.2  ===> unix, part 1  = ddmake.rs6 .
# 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 subdirectory 'ddroot/ddftp'
# All necessary files ( downloaded by ftp ) are in this directory.
# 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 directory ddroot
cat ddftp/nijx1.rs6  > nijx.f      
cat ddftp/nijx2.f   >> nijx.f
#        
# use -O for max optimisation
# use  -static  (save values of variables) =  IBM default
 xlf -c nijx.f
#
#   Compile and link the individual programs. Mind the capitals
 echo "DDSTART"; xlf -O -o DDSTART ddstart.f nijx.o
 echo "DDMAIN";  xlf -O -o DDMAIN  ddmain.f  nijx.o
 echo "ORIENT";  xlf -O -o ORIENT  orient.f  nijx.o
 echo "TRACOR";  xlf -O -o TRACOR  tracor.f  nijx.o
 echo "TRAVEC";  xlf -O -o TRAVEC  travec.f  nijx.o
 echo "PATTY";   xlf -O -o PATTY   patty.f   nijx.o
 echo "PHASEX";  xlf -O -o PHASEX  phasex.f  nijx.o
 echo "FOUR";    xlf -O -o FOUR    four.f    nijx.o
 echo "NUTS";    xlf -O -o NUTS    nuts.f    nijx.o
#                                    # so far the compilation.
ddmake3                              # final things to do
rm ddmake3
#  ---------------------------------------------------- end of ddmake
