# -----------------------------------------------------------------
# $Revision: 4958 $
# $Date: 2016-09-23 14:02:13 -0700 (Fri, 23 Sep 2016) $
# -----------------------------------------------------------------
# Programmer: Radu Serban @ LLNL
# -----------------------------------------------------------------
# Copyright (c) 2002, The Regents of the University of California.
# Produced at the Lawrence Livermore National Laboratory.
# All rights reserved.
# For details, see the LICENSE file.
# -----------------------------------------------------------------
# Makefile for CVODES serial examples.
#
# This file is generated from a template using various variables
# set at configuration time. It can be used as a template for
# other user Makefiles.
#
# Note: if the solver was successfully configured with Blas/Lapack
# support, the Blas/Lapack libraries are specified through the 
# variable LIBRARIES_BL. Otherwise, this variable should contain
# an empty string. We include LIBRARIES_BL in the link line for
# all examples, whether they use the Lapack module or not, to
# address the case in which the SUNDIALS libraries are shared 
# objects. In that case, the solver library references Lapack 
# symbols which must be always resolved by linking against the
# Blas/Lapack libraries. If only static SUNDIALS libraries have 
# been built, it is not required to link the Blas/Lapack libraries
# for examples that do not use that module...
# -----------------------------------------------------------------

SHELL = sh

prefix       = /usr
exec_prefix  = /usr
includedir   = /usr/include
libdir       = /usr/lib

CPP      = /usr/bin/gcc.exe
CPPFLAGS = -O3 -DNDEBUG
CC       = /usr/bin/gcc.exe
CFLAGS   = -O3 -DNDEBUG
LDFLAGS  = 
LIBS     =  -lm /usr/lib/librt.a

LINKFLAGS = -Wl,-rpath,/usr/lib

INCLUDES = -I${includedir}
LIBRARIES = -lsundials_cvodes -lsundials_nvecserial ${LIBS}
LIBRARIES_BL =  /usr/lib/liblapack.dll.a /usr/lib/libblas.dll.a
LIBRARIES_SLUMT = 
LIBRARIES_KLU =   /usr/lib/libklu.dll.a /usr/lib/libamd.dll.a /usr/lib/libcolamd.dll.a /usr/lib/libbtf.dll.a /usr/lib/libsuitesparseconfig.dll.a
LIBRARIES_PETSC = 

EXAMPLES =  cvsAdvDiff_ASAi_bnd cvsAdvDiff_bnd cvsAdvDiff_FSA_non cvsAdvDiff_FSA_non cvsDirectDemo_ls cvsDiurnal_FSA_kry cvsDiurnal_FSA_kry cvsDiurnal_kry_bp cvsDiurnal_kry cvsFoodWeb_ASAi_kry cvsFoodWeb_ASAp_kry cvsHessian_ASA_FSA cvsKrylovDemo_ls cvsKrylovDemo_prec cvsRoberts_ASAi_dns cvsRoberts_dns cvsRoberts_dns_uw cvsRoberts_FSA_dns cvsRoberts_klu cvsRoberts_ASAi_klu cvsRoberts_FSA_klu  cvsAdvDiff_bndL cvsRoberts_dnsL
EXAMPLES_DEPENDENCIES = 

OBJECTS = ${EXAMPLES:=.o}
OBJECTS_DEPENDENCIES = ${EXAMPLES_DEPENDENCIES:=.o}

# -----------------------------------------------------------------------------------------

.SUFFIXES : .o .c

.c.o :
	${CC} ${CPPFLAGS} ${CFLAGS} ${INCLUDES} -c $<

# -----------------------------------------------------------------------------------------

all: ${OBJECTS}
	@for i in ${EXAMPLES} ; do \
	  echo "${CC} -o $${i} $${i}.o ${OBJECTS_DEPENDENCIES} ${CFLAGS} ${LDFLAGS} ${INCLUDES} -L${libdir} ${LIBRARIES} ${LIBRARIES_BL} ${LIBRARIES_SLUMT} ${LIBRARIES_KLU} ${LIBRARIES_PETSC} ${LINKFLAGS}" ; \
	  ${CC} -o $${i} $${i}.o ${OBJECTS_DEPENDENCIES} ${CFLAGS} ${LDFLAGS} ${INCLUDES} -L${libdir} ${LIBRARIES} ${LIBRARIES_BL} ${LIBRARIES_SLUMT} ${LIBRARIES_KLU} ${LIBRARIES_PETSC} ${LINKFLAGS} ; \
	done

${OBJECTS}: ${OBJECTS_DEPENDENCIES}

clean:
	rm -f ${OBJECTS_DEPENDENCIES}
	rm -f ${OBJECTS}
	rm -f ${EXAMPLES}

# -----------------------------------------------------------------------------------------

