# Location of files

DIR =      ./
SRC = 	   ./src/

# Files

FILES = spectra.f90      mtspec.f90      adaptspec.f90    \
        dpss.f90         dpss_ev.f90     eigenft.f90      \
        fft.f90          ifft.f90        pythag.f90       \
        set_xint.f90     sft.f90         tinvit.f90       \
        tridib.f90       xint.f90        qtdis.f90        \
        qsnorm.f90       yule.f90        nnls.f90         \
	spline.f90       wv_spec.f90     jackspec.f90     \
	df_spec.f90      atanh2.f90      nearn.f90        \
        sine_psd.f90     sine_cohe.f90   dpss_spline.f90  \
	mt_cohe.f90      nsqi.f90        qrfac.f90        \
	tred1.f90        trbak1.f90      rsm_eig.f90	  \
	nsinv.f90        ftest.f90       fdis.f90         \
	psd_reshape.f90  qiinv.f90       zqrfac.f90       \
	mt_deconv.f90    mt_transfer.f90 oct_spec.f90     \
	sym_fft.f90 



# Objects

OBJS =  $(FILES:.f90=.o)

# Compiler
# Absoft, Sun/Solaris
#FC =      f95
# G95 Free compiler
#FC = g95
# Intel Compiler
FC = ifort

# Compiler flags
#   none
FFLAGS = -O  
#   debug
#FFLAGS = -g 
# Large memory needed (ifort)
FFLAGS = -O -heap-arrays 

# $@ means the target name
# $? means all dependencies (OBJS) that are new.
# $< similar to $? but just on dependency rules (%.o : %.f90)

mwlib.a : $(OBJS)
	ar cr $@ $(OBJS)
	ranlib $@
	rm *.o


%.o : $(SRC)%.f90
	$(FC) $(FFLAGS) -c $< -o $@



# Clean

clean:
	rm *.mod *.a


