#
#  testexamples_X - Runs various PETSc test suites

#    6 - C examples that don't work with complex numbers, require PETSc matrices
#    8 - Fortran .F examples that don't work with complex numbers
#   13 - Examples that should only be compiled.
#   17 - requires PYTHON or wget and Unix (uses urlget) and popen()

testexamples_C: ${TESTEXAMPLES_C} clean
testexamples_C_X11: ${TESTEXAMPLES_C_X11} clean
testexamples_Fortran: ${TESTEXAMPLES_FORTRAN} clean
testexamples_C_X11_MPIUni: ${TESTEXAMPLES_C_X11_MPIUNI} clean
testexamples_C_Complex: ${TESTEXAMPLES_C_COMPLEX} clean
testexamples_C_NoComplex: ${TESTEXAMPLES_C_NOCOMPLEX} clean

testexamples_Fortran_NoComplex: ${TESTEXAMPLES_FORTRAN_NOCOMPLEX} clean
testexamples_Fortran_MPIUni: ${TESTEXAMPLES_FORTRAN_MPIUNI} clean
testexamples_Fortran_Complex: ${TESTEXAMPLES_FORTRAN_COMPLEX} clean
testexamples_C_Complex_MPIUni: ${TESTEXAMPLES_C_CCOMPLEX_MPIUNI} clean
testexamples_F90: ${TESTEXAMPLES_F90} clean
testexamples_13: ${TESTEXAMPLES_13} clean
testexamples_17: ${TESTEXAMPLES_17} clean
testexamples_18: ${TESTEXAMPLES_18} clean
testexamples_PARMETIS: ${TESTEXAMPLES_PARMETIS} clean
testexamples_SPAI: ${TESTEXAMPLES_SPAI} clean
testexamples_ADIFOR: ${TESTEXAMPLES_ADIFOR} clean
testexamples_ADIC: ${TESTEXAMPLES_ADIC} clean
testexamples_FFTW: ${TESTEXAMPLES_FFTW} clean
testexamples_MATLAB: ${TESTEXAMPLES_MATLAB} clean
testexamples_MUMPS: ${TESTEXAMPLES_MUMPS} clean
testexamples_SUPERLU: ${TESTEXAMPLES_SUPERLU} clean
testexamples_SUPERLU_DIST: ${TESTEXAMPLES_SUPERLU_DIST} clean
testexamples_BLOCKSOLVE95: ${TESTEXAMPLES_BLOCKSOLVE95} clean
testexamples_HYPRE: ${TESTEXAMPLES_HYPRE} clean
testexamples_X11:
testexamples_MPE:
testexamples_ESSL:
testexamples_MPI:
testexamples_BLASLAPACK:

buildexamples_MPI: 
	-@${OMAKE} testexamples_MPI TESTEXAMPLES_MPI=`echo ${TESTEXAMPLES_MPI} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_BLASLAPACK: 
	-@${OMAKE} testexamples_BLASLAPACK TESTEXAMPLES_BLASLAPACK=`echo ${TESTEXAMPLES_BLASLAPACK} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_C: 
	-@${OMAKE} testexamples_C TESTEXAMPLES_C=`echo ${TESTEXAMPLES_C} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_C_X11: 
	-@${OMAKE} testexamples_C_X11 TESTEXAMPLES_C_X11=`echo ${TESTEXAMPLES_C_X11} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_Fortran:
	-@${OMAKE} testexamples_Fortran TESTEXAMPLES_FORTRAN=`echo ${TESTEXAMPLES_FORTRAN} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_C_X11_MPIUni:
	-@${OMAKE} testexamples_C_X11_MPIUni TESTEXAMPLES_C_X11_MPIUNI=`echo ${TESTEXAMPLES_C_X11_MPIUNI} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_C_Complex:
	-@${OMAKE} testexamples_C_Complex TESTEXAMPLES_C_COMPLEX=`echo ${TESTEXAMPLES_C_COMPLEX} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_6:
	-@${OMAKE} testexamples_6 TESTEXAMPLES_6=`echo ${TESTEXAMPLES_6} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_BLOCKSOLVE:
	-@${OMAKE} testexamples_BLOCKSOLVE TESTEXAMPLES_BLOCKSOLVE95=`echo ${TESTEXAMPLES_BLOCKSOLVE95} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_Fortran_NoComplex:
	-@${OMAKE} testexamples_Fortran_NoComplex TESTEXAMPLES_FORTRAN_NOCOMPLEX=`echo ${TESTEXAMPLES_FORTRAN_NOCOMPLEX} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_Fortran_MPIUni:
	-@${OMAKE} testexamples_Fortran_MPIUni TESTEXAMPLES_FORTRAN_MPIUNI=`echo ${TESTEXAMPLES_FORTRAN_MPIUNI} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_Fortran_Complex:
	-@${OMAKE} testexamples_Fortran_Complex TESTEXAMPLES_FORTRAN_COMPLEX=`echo ${TESTEXAMPLES_FORTRAN_COMPLEX} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_C_Complex_MPIUni:
	-@${OMAKE} testexamples_C_Complex_MPIUni TESTEXAMPLES_C_COMPLEX_MPIUNI=`echo ${TESTEXAMPLES_C_COMPLEX_MPIUNI} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_F90:
	-@${OMAKE} testexamples_F90 TESTEXAMPLES_F90=`echo ${TESTEXAMPLES_F90} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_13:
	-@${OMAKE} testexamples_13 TESTEXAMPLES_13=`echo ${TESTEXAMPLES_13} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_18:
	-@${OMAKE} testexamples_18 TESTEXAMPLES_18=`echo ${TESTEXAMPLES_18} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_17:
	-@${OMAKE} testexamples_17 TESTEXAMPLES_17=`echo ${TESTEXAMPLES_17} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_AMS:
	-@${OMAKE} testexamples_AMS TESTEXAMPLES_AMS=`echo ${TESTEXAMPLES_AMS} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_PARMETIS:
	-@${OMAKE} testexamples_PARMETIS TESTEXAMPLES_PARMETIS=`echo ${TESTEXAMPLES_PARMETIS} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_SPAI:
	-@${OMAKE} testexamples_SPAI TESTEXAMPLES_SPAI=`echo ${TESTEXAMPLES_SPAI} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_ADIFOR:
	-@${OMAKE} testexamples_ADIFOR TESTEXAMPLES_ADIFOR=`echo ${TESTEXAMPLES_ADIFOR} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_ADIC:
	-@${OMAKE} testexamples_ADIC TESTEXAMPLES_ADIC=`echo ${TESTEXAMPLES_ADIC} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_X11:
	-@${OMAKE} testexamples_X11 TESTEXAMPLES_X11=`echo ${TESTEXAMPLES_X11} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_MPE:
	-@${OMAKE} testexamples_MPE TESTEXAMPLES_MPE=`echo ${TESTEXAMPLES_MPE} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`
buildexamples_ESSL:
	-@${OMAKE} testexamples_ESSL TESTEXAMPLES_ESSL=`echo ${TESTEXAMPLES_ESSL} | sed s/runex[0-9]*[a-z]*[f]*[9]*[0]*[_]*[0-9]*//g`

TESTMODE = testexamples
alltests:
	-@for i in ${TEST_RUNS} ; do \
	  make ACTION=${TESTMODE}_$$i tree ; \
	done


