#!/bin/sh
# file ddmake.sg  ---------- Bourne shell --------- update: 27 Sep. 1999
# ----------------------------------------------------------------------
# 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 sub-directory '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
#                                   # here we started in ddroot/ddftp
ddmake2                             # make all ready for compilations
cd ..                               # now back to ddroot
rm -f nijx.f                        
cp ddftp/nijx1.sg nijx.f
cat ddftp/nijx2.f   >> nijx.f
#
# use O2 !!!
# use  -static   to save values of variables at subroutine exit
 f77 -O2 -static -c nijx.f
#   Compile and link the individual programs. Mind the capitals
echo "DDSTART"; f77 -O2 -static -o DDSTART ddstart.f nijx.o
echo "DDMAIN" ; f77 -O2 -static -o DDMAIN  ddmain.f  nijx.o
echo "ORIENT" ; f77 -O2 -static -o ORIENT  orient.f  nijx.o
echo "TRACOR" ; f77 -O2 -static -o TRACOR  tracor.f  nijx.o
echo "TRAVEC" ; f77 -O2 -static -o TRAVEC  travec.f  nijx.o
echo "PATTY"  ; f77 -O2 -static -o PATTY   patty.f   nijx.o
echo "PHASEX" ; f77 -O2 -static -o PHASEX  phasex.f  nijx.o
echo "FOUR"   ; f77 -O2 -static -o FOUR    four.f    nijx.o
echo "NUTS"   ; f77 -O2 -static -o NUTS    nuts.f    nijx.o
#   so far the compilation.
ddmake3                              # final things to do
rm ddmake3
#  ---------------------------------------------------- end of ddmake
