
EXE =  read_cres1Dz read_cres2Dan read_cres2Dmo read_cres2Dsurface read_cres2Dz read_cres3D read_cres3Dm read_evolu

all:$(EXE)

read_cres1Dz: libUN.f read_cres1Dz.f90
	$(COMPILFORTAN) $(FORTANFLAGS) $(INCS) -o $(<D)/$@ $^ $(LIBSFORTRAN)

read_cres2Dan: libUN.f read_cres2Dan.f
	$(COMPILFORTAN) $(FORTANFLAGS) $(INCS) -o $(<D)/$@ $^ $(LIBSFORTRAN)

read_cres2Dmo: libUN.f read_cres2Dmo.f
	$(COMPILFORTAN) $(FORTANFLAGS) $(INCS) -o $(<D)/$@ $^ $(LIBSFORTRAN)

read_cres2Dsurface: libUN.f read_cres2Dsurface.f
	$(COMPILFORTAN) $(FORTANFLAGS) $(INCS) -o $(<D)/$@ $^ $(LIBSFORTRAN)

read_cres2Dz: libUN.f read_cres2Dz.f90
	$(COMPILFORTAN) $(FORTANFLAGS) $(INCS) -o $(<D)/$@ $^ $(LIBSFORTRAN)

read_cres3D: libUN.f read_cres3D.f90
	$(COMPILFORTAN) $(FORTANFLAGS) $(INCS) -o $(<D)/$@ $^ $(LIBSFORTRAN)

read_cres3Dm: libUN.f read_cres3Dm.f90
	$(COMPILFORTAN) $(FORTANFLAGS) $(INCS) -o $(<D)/$@ $^ $(LIBSFORTRAN)

read_evolu: input.f read_evolu.f
	$(COMPILFORTAN) $(FORTANFLAGS) $(INCS) -o $(<D)/$@ $^ $(LIBSFORTRAN)

%.o: %.cpp
	$(COMPILCPP) -o $@ -c $<

%.o: %.f90
	$(COMPILFORTAN) $(FORTANFLAGS) $(INCS) -module $(<D) -o $@ -c $<

%.o: %.f
	$(COMPILFORTAN) $(FORTANFLAGS) $(INCS) -module $(<D) -o $@ -c $<

clean:
	@for i in ${EXE}; do \
	  resu=`find . -name "$${i}"`; \
	  if [ "$${resu}" != "" ]; then echo "rm -f $${resu}"; rm -f $${resu}; fi;\
        done; \
	resu=`find . -name "*.o"`; if [ "$${resu}" != "" ]; then echo "rm -f $${resu}"; rm -f $${resu}; fi;\
	resu=`find . -name "*.mod"`; if [ "$${resu}" != "" ]; then echo "rm -f $${resu}"; rm -f $${resu}; fi;\
	resu=`find . -name "*__genmod.f90" -exec rm -rf {} \;`;\
	
	
