ARCH = LINUX

FORTRAN = gfortran

WARN = -Wunused -Wuninitialized -W
# -g  debug
# -O  optimize (dataflow analysis means uninitialized vars can be detected)
# -fdebug-kludge not needed anymore
DEBUG = -g -O

FORT_SWITCHES = $(WARN) $(DEBUG)

# RULE for recompiling FORTRAN routines: >>>>>>>>>>>>>>>>>>>>>>>>>>>

%.o : %.f ; $(FORTRAN) $(FORT_SWITCHES) $(DEBUG) -c $< -o $@

#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

LIBDIR = $(CURDIR)
MYLIB= $(LIBDIR)/libmy.a
LIBRARY = $(MYLIB)(linfit_sub.o)
LIB = -L$(LIBDIR) -lmy

all:	linfit

linfit:	linfit_main.o  $(LIBRARY)
	$(FORTRAN) $(FORT_SWITCHES) $(DEBUG) -o $@ $< $(OBJ) $(LIB)

tidy:	
	rm *.o
