#
# $Id: GNUmakefile,v 1.12 2002/10/28 18:18:34 almgren Exp $
#
PRECISION = DOUBLE
PROFILE = FALSE
COMP  = g++
DEBUG = TRUE
DIM   = 2
USE_MPI = FALSE
USE_GRAPHTOOL = TRUE
USE_ARRAYVIEW = FALSE
#
# Base name of the executable.
#
EBASE = run

PBOXLIB_HOME = ..

GRAPHTOOL_HOME = ./graphtool
#
# Where libraries and include files will be installed.
#
include ../mk/Make.defs ./Make.package

include ../BoxLib/Make.package

INCLUDE_LOCATIONS += . ../BoxLib

ifeq ($(USE_GRAPHTOOL),TRUE)
  include ./graphtool/Make.package
  DEFINES += -DHAS_WINDOWS
  INCLUDE_LOCATIONS += $(GRAPHTOOL_HOME)
  INCLUDE_LOCATIONS += /usr/X11R6/include
  LIBRARY_LOCATIONS += /usr/X11R6/lib
  LIBRARIES += -lX11
endif
#
# ArrayView
#
ifeq (USE_ARRAYVIEW, TRUE)
  DEFINES += -DBL_USE_ARRAYVIEW
  INCLUDE_LOCATIONS += .
  LIBRARIES += -lX11
endif

ifeq ($(MACHINE), OSF1)
#
# Some additional stuff for our preferred development/debugging environment.
#
ifeq ($(PRECISION), DOUBLE)
FFLAGS += -real_size 64
endif
FDEBF += -C
FDEBF += -warn argument_checking
FDEBF += -warn declarations
ifneq ($(FC), f90)
FDEBF += -warn truncated_source
FDEBF += -warn unused
endif
endif

ifeq ($(USE_GRAPHTOOL),TRUE)
  vpath %.cpp . ../BoxLib ./graphtool
else
  vpath %.cpp . ../BoxLib
endif

vpath %.F   . 
vpath %.f   . ../BoxLib

all: $(executable)

libs:
	cd $(PBOXLIB_HOME)/BoxLib; \
	make PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) \
	DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) install
	cd $(GRAPHTOOL_HOME); \
	make PRECISION=$(PRECISION) PROFILE=$(PROFILE) COMP=$(COMP) \
	DEBUG=$(DEBUG) DIM=$(DIM) USE_MPI=$(USE_MPI) install

include ../mk/Make.rules
