#
#  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#  SLEPc - Scalable Library for Eigenvalue Problem Computations
#  Copyright (c) 2002-, Universitat Politecnica de Valencia, Spain
#
#  This file is part of SLEPc.
#  SLEPc is distributed under a 2-clause BSD license (see LICENSE).
#  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#

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
SLEPCCONF_H         = ${SLEPC_DIR}/${PETSC_ARCH}/include/slepcconf.h

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

SLEPC_CCPPFLAGS     = ${SLEPC_INCLUDE} ${SLEPC_EXTERNAL_INCLUDES}
SLEPC_CXXCPPFLAGS   = ${SLEPC_INCLUDE} ${SLEPC_EXTERNAL_INCLUDES}
SLEPC_FCPPFLAGS     = ${SLEPC_INCLUDE}
SLEPC_CUDACPPFLAGS  = ${SLEPC_INCLUDE} ${SLEPC_EXTERNAL_INCLUDES}
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} ${PETSC_CCPPFLAGS}
CXXCPPFLAGS     = ${SLEPC_CXXCPPFLAGS} ${PETSC_CXXCPPFLAGS}
FCPPFLAGS       = ${SLEPC_FCPPFLAGS} ${PETSC_FCPPFLAGS}
CUDACPPFLAGS    = ${SLEPC_CUDACPPFLAGS} ${PETSC_CUDACPPFLAGS}

# Variables for the different SLEPc modules
SLEPC_SYS_LIB_BASIC = -lslepcsys
SLEPC_MFN_LIB_BASIC = -lslepcmfn ${SLEPC_SYS_LIB_BASIC}
SLEPC_LME_LIB_BASIC = -lslepclme ${SLEPC_SYS_LIB_BASIC}
SLEPC_EPS_LIB_BASIC = -lslepceps ${SLEPC_LME_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 -lslepcsvd -lslepceps -lslepcmfn -lslepclme -lslepcsys

SLEPC_SYS_LIB_NOPETSC = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_SYS_LIB_BASIC} ${SLEPC_EXTERNAL_LIB}
SLEPC_MFN_LIB_NOPETSC = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_MFN_LIB_BASIC} ${SLEPC_EXTERNAL_LIB}
SLEPC_LME_LIB_NOPETSC = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_LME_LIB_BASIC} ${SLEPC_EXTERNAL_LIB}
SLEPC_EPS_LIB_NOPETSC = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_EPS_LIB_BASIC} ${SLEPC_EXTERNAL_LIB}
SLEPC_SVD_LIB_NOPETSC = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_SVD_LIB_BASIC} ${SLEPC_EXTERNAL_LIB}
SLEPC_PEP_LIB_NOPETSC = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_PEP_LIB_BASIC} ${SLEPC_EXTERNAL_LIB}
SLEPC_NEP_LIB_NOPETSC = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_NEP_LIB_BASIC} ${SLEPC_EXTERNAL_LIB}
SLEPC_LIB_NOPETSC     = ${SLEPC_C_SH_LIB_PATH} -L${SLEPC_LIB_DIR} ${SLEPC_LIB_BASIC} ${SLEPC_EXTERNAL_LIB}

SLEPC_SYS_LIB   = ${SLEPC_SYS_LIB_NOPETSC} ${PETSC_SNES_LIB}
SLEPC_MFN_LIB   = ${SLEPC_MFN_LIB_NOPETSC} ${PETSC_SNES_LIB}
SLEPC_LME_LIB   = ${SLEPC_LME_LIB_NOPETSC} ${PETSC_SNES_LIB}
SLEPC_EPS_LIB   = ${SLEPC_EPS_LIB_NOPETSC} ${PETSC_SNES_LIB}
SLEPC_SVD_LIB   = ${SLEPC_SVD_LIB_NOPETSC} ${PETSC_SNES_LIB}
SLEPC_PEP_LIB   = ${SLEPC_PEP_LIB_NOPETSC} ${PETSC_SNES_LIB}
SLEPC_NEP_LIB   = ${SLEPC_NEP_LIB_NOPETSC} ${PETSC_SNES_LIB}
SLEPC_LIB       = ${SLEPC_LIB_NOPETSC} ${PETSC_SNES_LIB}

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

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

