PROG =	lnb_calc.exe

### Modules du programme 
SRCS =  lnb_param.f90 lovenb_sub.f90 love_numbers.f90 model.f90 util.f90

OBJS =  lnb_param.o model.o util.o lovenb_sub.o love_numbers.o

MOD = lnb_param.mod model.mod util.mod lovenb_sub.mod

SHTOOLSPATH = /home/caronlam/Codes/SHTOOLS-3.4

LIBS =  -m64 -fPIC -O2 -ffast-math -L/usr/lib64 -lfftw3 -lm -llapack -lblas  
#	LIBS =  -L$(SHTOOLSPATH)/lib -lSHTOOLS2.8 -llapack -lfftw3  -lm

INCLUDE = -mcmodel=medium -I/usr/include 

CC = cc
CFLAGS = -O

#F90 = gfortran -mcmodel=medium -O2
F90= gfortran -O2
#F90 = gfortran
#F90 = g95
#F90 = ifort

F90FLAGS = 
LDFLAGS =

all: 	$(PROG)

$(PROG): $(OBJS)
	$(F90) $(LDFLAGS)  -o $@ $(OBJS) $(LIBS)

clean:
	rm -f $(PROG) $(OBJS) *.M *.mod *.T *.lst 

.SUFFIXES: $(SUFFIXES) .f90

.f90.o:
	$(F90) $(F90FLAGS)  -c $< $(INCLUDE)

#------------------------
#Dependances
#------------------------

#invGIA.o: nblove.o, parameters.o
love_numbers.o: lnb_param.o model.o lovenb_sub.o 
model.o: lnb_param.o
util.o: lnb_param.o model.o
lovenb_sub.o: lnb_param.o model.o util.o
