
TARGETS = MG.o
TARGETS2 = MG_full.o

# -fPIC  ... warning: variable is never used
#FFLAGS=  -fPIC -fdefault-real-8  -w

## optimize for computations
FFLAGS=  -fPIC -fdefault-real-8 -fopenmp -O2 -w -ffpe-trap=invalid,zero,overflow


# for debugging of the code
#FFLAGS= -fPIC -fdefault-real-8 -g -fbacktrace -fbounds-check -w -Wall -finit-real=nan -finit-integer=-999999 -fno-align-commons -ffpe-trap=invalid,zero,overflow,denormal

FXX=gfortran


all: MG MG_full


MG: $(TARGETS)	
	$(FXX) $(FFLAGS) -o MG $^ 

MG_full: $(TARGETS2)	
	$(FXX) $(FFLAGS) -o MG_full $^ 


clean:
	rm -f *.o

%.o:%.f90
	$(FXX) $(FFLAGS) -c $?

%.o:%.f
	$(FXX) $(FFLAGS) -c $?

