flags = -Wall -O3 -fdefault-integer-8 -fdefault-double-8 -fdefault-real-8  -march=native 

ifdef CHECK
flags += -fcheck=all
endif

ifdef DEBUG
flags += -g
endif

compiler = gfortran

ex  : test.o ysolve.o m_compact.o
	${compiler} -o ex test.o ysolve.o m_compact.o 

test.o  : test.f90 ysolve.mod compact.mod
	${compiler} -c ${flags} test.f90

ysolve.o ysolve.mod : ysolve.f90 compact.mod
	${compiler} -c ${flags} ysolve.f90

m_compact.o compact.mod : m_compact.f90
	${compiler} -c ${flags} m_compact.f90

test: ex
	sh test.sh

clean:
	rm -f *.o *.mod ex
