#!/bin/sh
#==========================================================================
#                    Creation d'un cas SYRTHES
#==========================================================================


echo 
echo "***************************************** "
echo "  $1 : creating SYRTHES case...         "


if [ $# -eq 0 ] ; then
    echo "  too few arguments for syrthes_case "
    echo "  --> usage : syrthes_case name"
echo "***************************************** "
    exit
fi

if [ -d "$1" -o -f "$1" ]; then
   echo "  --> file exists, choose another name"
echo "***************************************** "
   exit
fi

if [ -z "$SYRTHES4_HOME" ]; then
  echo "  --> SYRTHES_HOME not found"
echo "***************************************** "
  exit
fi


#==========================================================================
# creation du cas
#==========================================================================


mkdir $1
cd $1

mkdir usr_examples

# a transferer dans arch/&Arch_Name/linclude
echo ${SYRTHES4_HOME}
echo ${NOM_ARCH}
cp ${SYRTHES4_HOME}/share/syrthes/user.c  usr_examples/.
cp ${SYRTHES4_HOME}/share/syrthes/user_cond.c  usr_examples/.
cp ${SYRTHES4_HOME}/share/syrthes/user_hmt.c  usr_examples/.
cp ${SYRTHES4_HOME}/share/syrthes/user_ray.c  usr_examples/.

# à transferer dans arch/&Arch_Name/share
cp ${SYRTHES4_HOME}/share/syrthes/Makefile .
cp ${SYRTHES4_HOME}/share/syrthes/syrthes_data.syd_example .
cp ${SYRTHES4_HOME}/share/syrthes/syrthes.py .

cd ..

echo "  OK ! "
echo "***************************************** "
echo
