#
# $Id: Make.OSF1,v 1.27 2002/05/23 18:21:10 vince Exp $
#

#
# Version 5.1 will NOT compile BoxLib.
#

SHELL := /bin/ksh

UNAMER := $(shell uname -r)
UNAMEN := $(shell uname -n)
ifeq ($(MACHINE), OSF1)
  ifeq ($(findstring opal, $(UNAMEN)), opal)
    WHICHOSFMACH := opal
  endif
endif

#
# We'd also like to distinguish between OSF1 versions 3 and 4
#
ifeq ($(MACHINE), OSF1)
  ifeq ($(findstring V3, $(UNAMER)), V3)
    WHICHOSF1 := V3
  endif
  ifeq ($(findstring V4, $(UNAMER)), V4)
    WHICHOSF1 := V4
  endif
endif

ifeq ($(COMP),cxx)
  CXX      := cxx
  FULLWARN := +pp -fullwarn
  CXXOPTF  += -O3 -arch host -Olimit 2400 -no_exceptions
  CPPFLAGS += -D__USE_STD_IOSTREAM
  CXXDEBF  += -g
  CXXPRFF  := -p
  ifeq ($(WHICHOSF1),V3)
    override XTRALIBS += -lfor -lUfor -lFutil -lots -lm -lm_4sqrt
  else
    override XTRALIBS += -lfor -lUfor -lFutil -lots -lm
  endif
  #
  # Add -DBL_USE_SETBUF if don't have pubsetbuf() in I/O Streams Library.
  #
  override XTRADEFS +=
endif

ifeq ($(COMP),KCC)
  CXX         := KCC
  ifneq ($(CLOSELIB), TRUE)
    CXXLIBFLAGS := -tused -tlocal
  endif
  CXXPRFF     := -p
  FULLWARN    := --strict_warnings
  CXXOPTF     += -O3 +K3 -g3 -arch host -Olimit 2400 --no_exceptions
  CXXDEBF     += +K0
  ifeq ($(WHICHOSF1),V3)
    override XTRALIBS += -lfor -lUfor -lFutil -lots -lm -lm_4sqrt
  else
    override XTRALIBS += -lfor -lUfor -lFutil -lots -lm
  endif
  ifeq ($(WHICHOSFMACH),opal)
    CXXFLAGS += -ieee
  endif
  #
  # Add -DBL_USE_SETBUF if don't have pubsetbuf() in I/O Streams Library.
  #
  override XTRADEFS +=
endif

ifeq ($(COMP),g++)
  ifeq ($(WHICHOSF1),V3)
    override XTRALIBS += -lfor -lUfor -lFutil -lots -lm -lm_4sqrt
  else
    override XTRALIBS += -lfor -lUfor -lFutil -lots -lm
  endif
  #
  # Add -DBL_USE_SETBUF if don't have pubsetbuf() in I/O Streams Library.
  #
  override XTRADEFS +=
endif

FC = f90
fC = $(FC)

ifeq ($(PRECISION),FLOAT)
  FOPTF += -fast -O
  FDEBF += -g -u
  fOPTF += -fast -O
  fDEBF += -g
else
  FOPTF += -fast -O -fpconstant
  FDEBF += -g -u -fpconstant
  fOPTF += -fast -O -fpconstant
  fDEBF += -g -fpconstant
endif

ifeq ($(USE_THREADS),TRUE)
  FOPTF += -automatic -reentrancy threaded
  FDEBF += -automatic -reentrancy threaded
  fOPTF += -automatic -reentrancy threaded
  fDEBF += -automatic -reentrancy threaded
endif

FFLAGS += -fpe3
fFLAGS += -fpe3

FPRFF +=

FORT_CPP    = /usr/bin/cpp
PURIFY =
