F90=gfortran
F77=gfortran
#F90=gfortran-4.2
#F77=gfortran-4.2
CC=gcc

# standard fast flags
FFLAGS= -O3
#FFLAGS= -fbounds-check
#FFLAGS= -fbounds-check -O3
#FFLAGS= -g -pedantic -Wall -fbounds-check
#FFLAGS= -pedantic -Wall -fbounds-check

SUNPATH=date_routines.o t2string.o finddst.o sunpath_routines.o sundawn_routines.o sunpath.o
SUNPLOT=date_routines.o t2string.o finddst.o sunpath_routines.o sundawn_routines.o plot_sunpath.o
UVCALC=date_routines.o t2string.o finddst.o simpson_2D.o uvair1.o sunpath_routines.o fuvcie.o uvcalc.o

.SUFFIXES: .f90 .F90 .f .F .f77 .F77
.f90.o:
	$(F90) $(FFLAGS) -c $<
.F90.o:
	$(F90) $(FFLAGS) $(CFLAGS) -c $<
.f.o:
	$(F77) $(FFLAGS) -c $<
.F.o:
	$(F77) $(FFLAGS) -c $<
.f77.o:
	$(F77) $(FFLAGS) -c $<
.F77.o:
	$(F77) $(FFLAGS) -c $<

sunpath: $(SUNPATH)
	$(F90) $(FFLAGS) -o sunpath.x $(SUNPATH)

sunplot: $(SUNPLOT)
	$(F90) $(FFLAGS) -o sunplot.x $(SUNPLOT)

uvcalc: $(UVCALC)
	$(F90) $(FFLAGS) -o uvcalc.x $(UVCALC)

clean:
	\rm *.o *.mod
