# Makefile for the Grenoble prediction software.
# This version is Version 2.0
#
# Files are distributed as ASCII files, but can be converted to binary
# files by the program ascii2bimg. Doing so reduces both the required disk
# space and system time for reading the files.
# Depending on your choice, modify the CPPFLAG. (Uncomment the right one)
#
# Before running the demo program (and any other program build on this
# library, please setenv the variable WAVE_PATH so that it points on the
# directory where the data files are.
# 
# This software have been tested on SUN  OS 4.1.3, HPUX 9.05 and IRIX 4.0.5
# It is provided without any guarantees.
# JM MOLINES 
# IMG/LEGI Grenoble (33) 76 82 50 62
# e-mail: Jean-Marc.Molines@img.fr
########################################################
CPPFLAG= -DBIMG_FILE
#CPPFLAG= 
FFLAGS=  +U77 -O $(CPPFLAG) 
FC=f77
CPP=/lib/cpp -P $(CPPFLAG)
EXECDIR=../bin
#
#
SRCS=\
main_otide_jmm.f
LIBSRC=\
tide.F

OBJS=\
main_otide_jmm.o lpeqmt.o
 
OBAOBJS=\
main_otide_oba.o lpeqmt.o
 
LIBOBJS=\
tide.o

########################################################
#
#.SUFFIXES: .o .f .F

.SUFFIXES: .o .f .F
.F.o:
	$(FC) -c $(FFLAGS) $<

###########################################

all:	libpred.a  main_otide_jmm tstpred ascii2bimg main_otide_oba

main_otide_jmm:	libpred.a $(OBJS)
	$(FC) $(FFLAGS) $(OBJS) libpred.a -o main_otide_jmm
	cp main_otide_jmm $(EXECDIR)/main_otide_jmm

main_otide_oba:	libpred.a $(OBAOBJS)
	$(FC) $(FFLAGS) $(OBAOBJS) libpred.a -o main_otide_oba
	cp main_otide_oba $(EXECDIR)/main_otide_oba

tstpred: libpred.a tstpred.o
	$(FC) $(FFLAGS) tstpred.o libpred.a -o tstpred

ascii2bimg:	ascii2bimg.o
	$(FC) $(FFLAGS) ascii2bimg.o -o ascii2bimg
	cp ascii2bimg $(EXECDIR)/ascii2bimg

libpred.a: $(LIBOBJS)
	/bin/rm -f libpred.a
	ar rcv libpred.a $(LIBOBJS)
	ranlib libpred.a

clean:
	@-/bin/rm -f $(OBJS) *.o core *.%
# dependencies
tide.o : common.h
