# The makefile to compile FDMNES
# Works with gaussian solver and without any call to libraries. Sequential.
# Works with the gfortran Linux Compiler (for other compiler change the FC command)
# The executable produced with this makefile is far less efficient than when using MUMPS library

FC = gfortran
OPTLVL = 3 

# For intel compiler, it seems that probems at execution are avoided when compiling
# sphere.f90 with O1 option and the other routines with O2 option.

EXEC = ../fdmnes_gauss

FFLAGS = -c  -O$(OPTLVL)  

OBJ_GAUSS = main.o clemf0.o coabs.o convolution.o diffraction.o dirac.o fdm.o fdmx.o fprime.o fprime_data.o general.o lecture.o mat.o metric.o \
      minim.o optic.o potential.o selec.o scf.o spgroup.o sphere.o tab_data.o tddft.o tensor.o tools.o \
      not_mpi.o mat_solve_gaussian.o sub_util.o


all: $(EXEC)

$(EXEC): $(OBJ_GAUSS) 
	$(FC) -o $@ $^ 

%.o: %.f90
	$(FC) -o $@ $(FFLAGS) $? 

clean:
	rm -f *.o $(EXEC)
	rm -f *.mod	

