#!/bin/csh -f

#set echo

 if ( ! -e configure.3dvar  ) then

    echo "WARNING:"
    echo " "
    echo "You need to build file <configure.3dvar>."
    echo " "
    echo "If you do not stop compile now,"
    echo "it will continue after 10 seconds and assume:"
    echo " "
    echo "1. Run on a DEC-alpha (OSF1) machine."
    echo "2. Compile with DM only."

    set count_down = 10

    while ( $count_down )
      @ count_down --
      sleep 1
    end

    echo 2 | ./configure
 endif

 set arglist=""
 foreach a ( $argv )
   if ( "$a" == "-h" ) then
     goto hlp
   else
     set arglist = ( $arglist $a )
   endif
 end

 if ( $arglist == "" ) then
    echo "WARNING:"
    echo " "
    echo "You need to which core to compile such as <compile 3dvar>."
    echo " "
    echo "If you do not stop compile now,"
    echo "it will continue after 10 seconds and assume: "
    echo " "
    echo "   You want to <compile 3dvar>."
    echo " "

    set count_down = 10

    while ( $count_down )
      @ count_down --
      sleep 1
    end

   set arglist = 3dvar
 endif

 make $arglist

 exit 0

hlp:

 echo 'Usage:'
 echo '  compile 3dvar '
 echo ' '

 echo '  compile -h                 help message'

