#! /bin/sh
#
# This script is invoked from the topdir (not top_srcdir in a VPATH build)
# by mpich/Makefile to create the mpirun program.  The install script
# specific to the device must know how to install the resulting mpirun.
#
#
if [ -z "${binbuild_dir}" ] ; then
    echo "The variable binbuild_dir must contain the directory "
    echo "in which to install the mpirun programs for ch_p4mpd."
    exit 1
fi
/bin/rm -f ${binbuild_dir}/startdaemons
MAKE=${MAKE-make}
if [ -d mpid/mpd ] ; then 
    if [ ! -f mpid/mpd/mpdcon ] ; then 
        ( cd mpid/mpd ; ${MAKE} mpdcon )
    fi
    cp mpid/mpd/mpdcon ${binbuild_dir}/mpirun
    cp mpid/mpd/startdaemons ${binbuild_dir}/startdaemons
fi
