.SUFFIXES:

# 
#  If you just want to switch off the default rule for Modula 2
#  you could use
# 
%.o : %.mod

# 
# Generate .o files from free format source files (assume  
# either a .f90 suffix).
#

%.o: %.f90
	$(F95) $(F95FLAGS) -o $@ -c $<

%: %.o
	$(F95) $(F95LINKFLAGS) -o $@ $^

F95 = nagfor
F95FLAGS = -g -gline -g90 -u -nan -C=all -C=undefined -C=dangling
F95LINKFLAGS = -g -gline -g90 -u -nan -C=all -C=undefined -C=dangling
F95FLAGS = -O3
F95LINKFLAGS = -O3

# Pick up files from Src and Drivers directory
vpath %.f90 Src/ Drivers/ Others/

executables = driver

all: $(executables)

OBJS = Faddeyeva_v2_mod_rk.o rk_erfcx_Cody.o humlicek0.o \
       set_rk.o wofz.o weideman.o

driver: $(OBJS) driver.o

driver.o: Faddeyeva_v2_mod_rk.o humlicek0.o wofz.o weideman.o

Faddeyeva_v2_mod_rk.o: rk_erfcx_Cody.o set_rk.o

rk_erfcx_Cody.o: set_rk.o

humlicek0.o: set_rk.o

weideman.o: set_rk.o 

wofz.o: set_rk.o

set_rk.o:

.PHONY: clean
clean: 
	# remove all files generated by the compiler
	# these are compiler dependent
	rm -f *.o *.d *.g90 *.mod 
	# remove all executables
	rm -f $(executables)
