#!/bin/csh -f
#
# This script will generate all manual pages
# in the current directory. It is recommeded that
# you run it from the man/man1 subdirectory under
# your GROMACS source tree. The manual pages will
# be installed by the "make install" command.

echo "Generating unix manual for GROMACS programs"
echo "-------------------------------------------"

if ( $#argv < 1 ) then
  echo "Error: provide the binary directory as first argument."
  echo "Man pages will be written in the current dir."
  exit
endif

set GMXBINDIR = $1

set 	dir = $cwd


cd $GMXBINDIR
set PROGRAMS = [a-z]*
cd $dir

foreach program ( $PROGRAMS )
if ( ( -x $GMXBINDIR/$program ) && ( $program != "my_dssp" ) && ( $program != "GMXRC" ) && ( $program != "completion.csh" ) && ( $program != "completion.zsh" ) && ( $program != "average" ) && ( $program != "completion.bash" ) && ( $program != "luck" ) ) then
echo -n " $program"
$GMXBINDIR/$program -man nroff >& /dev/null
if ( -f $program.nroff ) mv $program.nroff $program.1
endif
end
