#
#  Makefile for selected utilities (Lapack version 3) on the Lahey cluster.
#  We use ONLY a modified version of XERBLA, which calls ABORT instead
#  of STOP.  The reason is that we rely on a nonzero return code upon
#  failure; Lahey STOP returns zero to the shell.  In addition, the
#  modified routine ensures that the error message goes to the standard error.
#
SOURCES = xerbla.f
OBJECTS = xerbla.o

LIB = $$HOME/lekf/support/libev.a

#
# SGI
#
#LIB = ../eiglib.a -L$$HOME/lorenz/nws/support -lsupport -lscs
#DEBUG = -g -c -DEBUG:trap_uninitialized -DEBUG:conform_check=YES \
 #-DEBUG:verbose_runtime=YES -DEBUG:subscript_check=YES \
 #-ansi -fullwarn -woff 878,1438,1584 -Dsgi
#OPT = -O -c -OPT:swp=ON -g3 -Dsgi -ansi -fullwarn -woff 878,1438,1584
#F95 = f90

#
# Sun - specify "save" to save stack space
#
#DEBUG = -I../support -M../support -M. -g -c -ansi -ftrap=invalid -u -w4 \
   #-xcheck=stkovf
#OPT =  -I../support -M../support -M. -O4 -c -ftrap=invalid -u -xcheck=stkovf
#F95 = f95

#
# Lahey - add --trap for f.p. trapping (but not with these routines)
#
DEBUG = --mod .:$(SUPPORTDIR) -g -c --trace --chk a,e,s --f95 --maxfatals 3
OPT = --mod .:$(SUPPORTDIR) -O -c --trace --f95 --maxfatals 3
F95 = lf95
#
#DOUBLE=--dbl

#
#  G95 - Cygwin/ATLAS
#
#INCLUDEDIR = -I../support -I.
#DEBUG = $(INCLUDEDIR) -g -c -std=f2003 -Wall
#OPT = $(INCLUDEDIR) -O3 -c -std=f2003 -Wall
#DBLFLAGS = -r8
#F95 = g95

#
#  G95 - OSX
#
#F95 = g95
#DEBUG = -I../support -I. -g -c -Wall -std=f2003 
#OPT = -I../support -I. -O -c -Wall -std=f2003 
#DOUBLE = -r8

FFLAGS = $(OPT) 
#FFLAGS = $(DEBUG) 

.SUFFIXES: .o .mod .f .f90 .f95 .F90 .F95
#.f.mod:
#$(F95) $(FFLAGS) $<
.F90.o:
	$(F95) $(FFLAGS) $<
.f90.mod:
	$(F95) $(FFLAGS) $<
.f95.mod:
	$(F95) $(FFLAGS) $<
.f.o:
	$(F95) $(FFLAGS) $<
.f90.o:
	$(F95) $(FFLAGS) $<
.f95.o:
	$(F95) $(FFLAGS) $<
xerbla: $(OBJECTS)
	ar r $(LIB) $(OBJECTS)
xerbla.o:
