#
#  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#  SLEPc - Scalable Library for Eigenvalue Problem Computations
#  Copyright (c) 2002-2016, Universitat Politecnica de Valencia, Spain
#
#  This file is part of SLEPc.
#
#  SLEPc is free software: you can redistribute it and/or modify it under  the
#  terms of version 3 of the GNU Lesser General Public License as published by
#  the Free Software Foundation.
#
#  SLEPc  is  distributed in the hope that it will be useful, but WITHOUT  ANY
#  WARRANTY;  without even the implied warranty of MERCHANTABILITY or  FITNESS
#  FOR  A  PARTICULAR PURPOSE. See the GNU Lesser General Public  License  for
#  more details.
#
#  You  should have received a copy of the GNU Lesser General  Public  License
#  along with SLEPc. If not, see <http://www.gnu.org/licenses/>.
#  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#

include ${PETSC_DIR}/lib/petsc/conf/variables

# Variables specific to SLEPc that can be employed in user makefiles
SLEPC_LIB_DIR	    = ${SLEPC_DIR}/${PETSC_ARCH}/lib

SLEPC_INCLUDE       = -I${SLEPC_DIR}/include -I${SLEPC_DIR}/${PETSC_ARCH}/include
SLEPC_CEXT_INCLUDES = ${PRIMME_FLAGS}
SLEPC_CC_INCLUDES   = ${SLEPC_INCLUDE} ${SLEPC_CEXT_INCLUDES} ${PETSC_CC_INCLUDES}
SLEPC_FC_INCLUDES   = ${SLEPC_INCLUDE} ${PETSC_FC_INCLUDES}

SLEPC_CCPPFLAGS	    = ${SLEPC_INCLUDE} ${SLEPC_CEXT_INCLUDES} ${PETSC_CCPPFLAGS}
SLEPC_FCPPFLAGS	    = ${SLEPC_INCLUDE} ${PETSC_FCPPFLAGS}
SLEPC_C_SH_LIB_PATH = ${CC_LINKER_SLFLAG}${SLEPC_LIB_DIR}
SLEPC_F_SH_LIB_PATH = ${FC_LINKER_SLFLAG}${SLEPC_LIB_DIR}

# Redefine variables in PETSc makefiles
INSTALL_LIB_DIR	= ${SLEPC_LIB_DIR}
CCPPFLAGS	= ${SLEPC_CCPPFLAGS}
FCPPFLAGS	= ${SLEPC_FCPPFLAGS}

# Variables for the different SLEPc modules
SLEPC_SYS_LIB_BASIC = -lslepcsys
SLEPC_MFN_LIB_BASIC = -lslepcmfn ${SLEPC_SYS_LIB_BASIC}
SLEPC_EPS_LIB_BASIC = -lslepceps ${SLEPC_SYS_LIB_BASIC}
SLEPC_SVD_LIB_BASIC = -lslepcsvd ${SLEPC_EPS_LIB_BASIC}
SLEPC_PEP_LIB_BASIC = -lslepcpep ${SLEPC_EPS_LIB_BASIC}
SLEPC_NEP_LIB_BASIC = -lslepcnep ${SLEPC_PEP_LIB_BASIC}
SLEPC_LIB_BASIC     = -lslepcnep -lslepcpep -lslepcmfn ${SLEPC_SVD_LIB_BASIC}

SLEPC_SYS_LIB   = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_SYS_LIB_BASIC} ${SLEPC_EXTERNAL_LIB} ${PETSC_KSP_LIB}
SLEPC_MFN_LIB   = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_MFN_LIB_BASIC} ${SLEPC_EXTERNAL_LIB} ${PETSC_KSP_LIB}
SLEPC_EPS_LIB   = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_EPS_LIB_BASIC} ${SLEPC_EXTERNAL_LIB} ${PETSC_KSP_LIB}
SLEPC_SVD_LIB   = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_SVD_LIB_BASIC} ${SLEPC_EXTERNAL_LIB} ${PETSC_KSP_LIB}
SLEPC_PEP_LIB   = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_PEP_LIB_BASIC} ${SLEPC_EXTERNAL_LIB} ${PETSC_KSP_LIB}
SLEPC_NEP_LIB   = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_NEP_LIB_BASIC} ${SLEPC_EXTERNAL_LIB} ${PETSC_KSP_LIB}
SLEPC_LIB       = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_LIB_BASIC} ${SLEPC_EXTERNAL_LIB} ${PETSC_KSP_LIB}

SLEPC_EXTERNAL_LIB  = ${ARPACK_LIB} ${BLZPACK_LIB} ${TRLAN_LIB} ${PRIMME_LIB} ${BLOPEX_LIB} ${FEAST_LIB}

# Redefine variable used to build shared libraries
SHLIBS = libslepcsys libslepcmfn libslepceps libslepcsvd libslepcpep libslepcnep

# Include definitions customized by configuration
include ${SLEPC_DIR}/${PETSC_ARCH}/lib/slepc/conf/slepcvariables

