#!Makefile
include ../Mkinclude

SRC	= inter_face.f90 \
	  max_min.f90 analy.f90 algebra.f90 alge_solv.f90 file_operate.f90 \
	  statistics.f90 ffts.f90 matrix_calc.f90 \
	  phys_const.f90 math_const.f90 thermo_const.f90 thermo_function.f90 \
	  special_function.f90 poly_function.f90 geometry.f90 \
	  trajectory.f90 typhoon_analy.f90 thermo_routine.f90
OBJ	= inter_face.o \
	  max_min.o analy.o algebra.o alge_solv.o file_operate.o \
	  statistics.o ffts.o matrix_calc.o \
	  phys_const.o math_const.o thermo_const.o thermo_function.o \
	  special_function.o poly_function.o geometry.o \
	  trajectory.o typhoon_analy.o thermo_routine.o
MOD	= inter_face.mod \
	  max_min.mod analy.mod algebra.mod alge_solv.mod file_operate.mod \
	  statistics.mod ffts.mod matrix_calc.mod \
	  phys_const.mod math_const.mod thermo_const.mod thermo_function.mod \
	  special_function.mod poly_function.mod geometry.mod \
	  trajectory.mod typhoon_analy.mod thermo_routine.mod
TARGET	= libstpk_f90.a


all: $(TARGET)
$(TARGET): $(OBJ)
	$(AR) r $@ $(OBJ)
	cp $@ $(LIBDIR)/
	cp $(MOD) $(INCDIR)/

# pattern rule
$(OBJ): %.o: %.f90
	$(FC) ${FFLAGS} -c $< -L${LDFLAGS} -l${LFLAGS}

clean:
	rm -rf *.o *.a *.mod
