#!/bin/sh

tarfile=$1
distrobase=$2
doc=$3

shift 3
tar=$*

echo "   --- Add cvodes module to $tarfile"

if [ $doc = "T" ]; then
#$tar $tarfile $distrobase/doc/cvodes/cvs_guide.ps
$tar $tarfile $distrobase/doc/cvodes/cvs_guide.pdf
#$tar $tarfile $distrobase/doc/cvodes/cvs_examples.ps
$tar $tarfile $distrobase/doc/cvodes/cvs_examples.pdf
fi

$tar $tarfile $distrobase/include/cvodes/cvodes.h
$tar $tarfile $distrobase/include/cvodes/cvodes_direct.h
$tar $tarfile $distrobase/include/cvodes/cvodes_dense.h
$tar $tarfile $distrobase/include/cvodes/cvodes_band.h
$tar $tarfile $distrobase/include/cvodes/cvodes_klu.h
$tar $tarfile $distrobase/include/cvodes/cvodes_lapack.h
$tar $tarfile $distrobase/include/cvodes/cvodes_diag.h
$tar $tarfile $distrobase/include/cvodes/cvodes_spgmr.h
$tar $tarfile $distrobase/include/cvodes/cvodes_spbcgs.h
$tar $tarfile $distrobase/include/cvodes/cvodes_sptfqmr.h
$tar $tarfile $distrobase/include/cvodes/cvodes_spils.h
$tar $tarfile $distrobase/include/cvodes/cvodes_sparse.h
$tar $tarfile $distrobase/include/cvodes/cvodes_superlumt.h
$tar $tarfile $distrobase/include/cvodes/cvodes_bandpre.h
$tar $tarfile $distrobase/include/cvodes/cvodes_bbdpre.h

$tar $tarfile $distrobase/src/cvodes/LICENSE
$tar $tarfile $distrobase/src/cvodes/README
$tar $tarfile $distrobase/src/cvodes/CMakeLists.txt

$tar $tarfile $distrobase/src/cvodes/cvodes.c
$tar $tarfile $distrobase/src/cvodes/cvodea.c
$tar $tarfile $distrobase/src/cvodes/cvodes_io.c
$tar $tarfile $distrobase/src/cvodes/cvodes_klu.c
$tar $tarfile $distrobase/src/cvodes/cvodea_io.c
$tar $tarfile $distrobase/src/cvodes/cvodes_direct.c
$tar $tarfile $distrobase/src/cvodes/cvodes_dense.c
$tar $tarfile $distrobase/src/cvodes/cvodes_band.c
$tar $tarfile $distrobase/src/cvodes/cvodes_lapack.c
$tar $tarfile $distrobase/src/cvodes/cvodes_diag.c
$tar $tarfile $distrobase/src/cvodes/cvodes_spils.c
$tar $tarfile $distrobase/src/cvodes/cvodes_sparse.c
$tar $tarfile $distrobase/src/cvodes/cvodes_spgmr.c
$tar $tarfile $distrobase/src/cvodes/cvodes_spbcgs.c
$tar $tarfile $distrobase/src/cvodes/cvodes_sptfqmr.c
$tar $tarfile $distrobase/src/cvodes/cvodes_superlumt.c
$tar $tarfile $distrobase/src/cvodes/cvodes_bandpre.c
$tar $tarfile $distrobase/src/cvodes/cvodes_bbdpre.c
$tar $tarfile $distrobase/src/cvodes/cvodes_impl.h
$tar $tarfile $distrobase/src/cvodes/cvodes_direct_impl.h
$tar $tarfile $distrobase/src/cvodes/cvodes_diag_impl.h
$tar $tarfile $distrobase/src/cvodes/cvodes_spils_impl.h
$tar $tarfile $distrobase/src/cvodes/cvodes_sparse_impl.h
$tar $tarfile $distrobase/src/cvodes/cvodes_bandpre_impl.h
$tar $tarfile $distrobase/src/cvodes/cvodes_bbdpre_impl.h

echo "   --- Add cvodes examples to $tarfile"

$tar $tarfile $distrobase/examples/cvodes/serial/README
$tar $tarfile $distrobase/examples/cvodes/serial/CMakeLists.txt
$tar $tarfile $distrobase/examples/cvodes/serial/cvsAdvDiff_ASAi_bnd.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsAdvDiff_ASAi_bnd.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsAdvDiff_bnd.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsAdvDiff_bndL.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsAdvDiff_bndL.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsAdvDiff_bnd.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsAdvDiff_FSA_non.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsAdvDiff_FSA_non.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsDirectDemo_ls.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsDirectDemo_ls.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsDiurnal_FSA_kry.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsDiurnal_FSA_kry.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsDiurnal_kry_bp.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsDiurnal_kry_bp.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsDiurnal_kry.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsDiurnal_kry.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsFoodWeb_ASAi_kry.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsFoodWeb_ASAp_kry.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsHessian_ASA_FSA.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsHessian_ASA_FSA.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsKrylovDemo_ls.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsKrylovDemo_ls.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsKrylovDemo_prec.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsKrylovDemo_prec.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsRoberts_ASAi_dns.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsRoberts_ASAi_dns.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsRoberts_dns.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsRoberts_dnsL.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsRoberts_dnsL.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsRoberts_dns.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsRoberts_ASAi_klu.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsRoberts_ASAi_klu.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsRoberts_ASAi_sps.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsRoberts_ASAi_sps.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsRoberts_dns_uw.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsRoberts_dns_uw.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsRoberts_FSA_dns.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsRoberts_FSA_dns.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsRoberts_FSA_klu.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsRoberts_FSA_klu.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsRoberts_FSA_sps.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsRoberts_FSA_sps.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsRoberts_klu.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsRoberts_klu.out
$tar $tarfile $distrobase/examples/cvodes/serial/cvsRoberts_sps.c
$tar $tarfile $distrobase/examples/cvodes/serial/cvsRoberts_sps.out

$tar $tarfile $distrobase/examples/cvodes/C_openmp/README
$tar $tarfile $distrobase/examples/cvodes/C_openmp/CMakeLists.txt
$tar $tarfile $distrobase/examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.c
$tar $tarfile $distrobase/examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.out

$tar $tarfile $distrobase/examples/cvodes/parallel/README
$tar $tarfile $distrobase/examples/cvodes/parallel/CMakeLists.txt
$tar $tarfile $distrobase/examples/cvodes/parallel/cvsAdvDiff_ASAp_non_p.c
$tar $tarfile $distrobase/examples/cvodes/parallel/cvsAdvDiff_ASAp_non_p.out
$tar $tarfile $distrobase/examples/cvodes/parallel/cvsAdvDiff_FSA_non_p.c
$tar $tarfile $distrobase/examples/cvodes/parallel/cvsAdvDiff_FSA_non_p.out
$tar $tarfile $distrobase/examples/cvodes/parallel/cvsAdvDiff_non_p.c
$tar $tarfile $distrobase/examples/cvodes/parallel/cvsAdvDiff_non_p.out
$tar $tarfile $distrobase/examples/cvodes/parallel/cvsAtmDisp_ASAi_kry_bbd_p.c
$tar $tarfile $distrobase/examples/cvodes/parallel/cvsAtmDisp_ASAi_kry_bbd_p.out
$tar $tarfile $distrobase/examples/cvodes/parallel/cvsDiurnal_FSA_kry_p.c
$tar $tarfile $distrobase/examples/cvodes/parallel/cvsDiurnal_FSA_kry_p.out
$tar $tarfile $distrobase/examples/cvodes/parallel/cvsDiurnal_kry_bbd_p.c
$tar $tarfile $distrobase/examples/cvodes/parallel/cvsDiurnal_kry_bbd_p.out
$tar $tarfile $distrobase/examples/cvodes/parallel/cvsDiurnal_kry_p.c
$tar $tarfile $distrobase/examples/cvodes/parallel/cvsDiurnal_kry_p.out

# 3/3/2015:LEBanks - Don't add to release yet. Many tests will fail, which can be confusing to users
#echo "   --- Add regression test files to $tarfile"
#$tar $tarfile $distrobase/test/answers/cvsAdvDiff_ASAi_bnd
#$tar $tarfile $distrobase/test/answers/cvsAdvDiff_ASAp_non_p
#$tar $tarfile $distrobase/test/answers/cvsAdvDiff_bnd
#$tar $tarfile $distrobase/test/answers/cvsAdvDiff_bndL
#$tar $tarfile $distrobase/test/answers/cvsAdvDiff_FSA_non_p_-sensi_sim_t
#$tar $tarfile $distrobase/test/answers/cvsAdvDiff_FSA_non_p_-sensi_stg_t
#$tar $tarfile $distrobase/test/answers/cvsAdvDiff_FSA_non_-sensi_sim_t
#$tar $tarfile $distrobase/test/answers/cvsAdvDiff_FSA_non_-sensi_stg_t
#$tar $tarfile $distrobase/test/answers/cvsAdvDiff_non_p
#$tar $tarfile $distrobase/test/answers/cvsAtmDisp_ASAi_kry_bbd_p
#$tar $tarfile $distrobase/test/answers/cvsDirectDemo_ls
#$tar $tarfile $distrobase/test/answers/cvsDiurnal_FSA_kry_p_-sensi_sim_t
#$tar $tarfile $distrobase/test/answers/cvsDiurnal_FSA_kry_p_-sensi_stg_t
#$tar $tarfile $distrobase/test/answers/cvsDiurnal_FSA_kry_-sensi_sim_t
#$tar $tarfile $distrobase/test/answers/cvsDiurnal_FSA_kry_-sensi_stg_t
#$tar $tarfile $distrobase/test/answers/cvsDiurnal_kry
#$tar $tarfile $distrobase/test/answers/cvsDiurnal_kry_bbd_p
#$tar $tarfile $distrobase/test/answers/cvsDiurnal_kry_bp
#$tar $tarfile $distrobase/test/answers/cvsDiurnal_kry_p
#$tar $tarfile $distrobase/test/answers/cvsFoodWeb_ASAi_kry
#$tar $tarfile $distrobase/test/answers/cvsFoodWeb_ASAp_kry
#$tar $tarfile $distrobase/test/answers/cvsHessian_ASA_FSA
#$tar $tarfile $distrobase/test/answers/cvsKrylovDemo_ls
#$tar $tarfile $distrobase/test/answers/cvsKrylovDemo_prec
#$tar $tarfile $distrobase/test/answers/cvsRoberts_ASAi_dns
#$tar $tarfile $distrobase/test/answers/cvsRoberts_dns
#$tar $tarfile $distrobase/test/answers/cvsRoberts_dnsL
#$tar $tarfile $distrobase/test/answers/cvsRoberts_dns_uw
#$tar $tarfile $distrobase/test/answers/cvsRoberts_FSA_dns_-sensi_stg1_t
#$tar $tarfile $distrobase/test/answers/cvsRoberts_klu
#$tar $tarfile $distrobase/test/answers/cvsRoberts_sps
