#  Makefile for iaspei-tau package.  jas/vt 2008
#  FCOMP is set before entering this version of Makefile
#  To run:  enter "make all" (or just enter "make")
#  If just want ttimes, enter "make ttimes"
#  To delete all files created by build_package and tests, enter "make clean"
#
FFLAG =
#  f77 and f95 have been tested for Sun Solaris
#  g77 and gfortran (4.3) for Mac OSX (PPC and i686)
#  g77, ifort (9.1) and gfortran (4.1.2) for Linux (also 64 bit)

.f.o:
	$(FCMP) $(FFLAG) -c $<

OBJECTS = libtau.o emdlv.o

all:	remodl setbrn rsetbrn ttimes

clean:
	\rm -R -f *.o libiasp.a ../bin/*  ../tables/*.hed ../tables/*.tbl \
	../tables/iasp91.term ../tables/ak135.term ../tables/stuff \
	../tests/ttimes.term ../tests/ttimes_ak135.lst ../tests/ttimes_iasp91.lst

libiasp.a:	${OBJECTS}
	ar rv libiasp.a ${OBJECTS}
	ranlib libiasp.a

remodl:	remodl.o libiasp.a
	$(FCMP) remodl.o -C -o ../bin/remodl libiasp.a

setbrn:	setbrn.o libiasp.a
	$(FCMP) setbrn.o -C -o ../bin/setbrn libiasp.a

#  rsetbrn is the same as setbrn except that in layout all phases
#    but the primary P and S are commented out.  More almost model other
#    than the iaspei91 model setbrn bombs because of too many branches.
#    The fix is to redimension some arrays, but for my applications all I
#    need are P and S anyway, so this was an easier fix.  (One problem is
#    that the .tbl and .hed size are not cut down as they should be when one
#    makes this change.  Could be a factor if one had many models.)
#    12 March 2003:  Small changes made to remodl.f and librau.f so they
#       would compile on Linux (g77) as well as Mac OS X andSun Solaris.
#     October 2007: appended libsun.f to libtau.f 
#       (nothing that is "sun" specific).

rsetbrn:	rsetbrn.o libiasp.a
	$(FCMP) rsetbrn.o -C -o ../bin/rsetbrn libiasp.a


#  This is a slight variant on the original program.  It allows for
#    distances to be given in kilometers or degrees, and it prints results to
#    a disk file which includes information such as requested depth, 
#    and it prints out the take-off angle for each phase.

ttimes:	ttimes.o libiasp.a
	$(FCMP) ttimes.o -C -o ../bin/ttimes libiasp.a
