# SUBDIRS_pm_name are the names that @ pm_name @ can take in SUBDIRS
# (except for util, which is included so that simplemake will process
# the Makefile.sm in that directory)
SUBDIRS_pm_name = mpd smpd gforker remshell
SUBDIRS = @pm_name@ @other_pm_names@ .
# Remove PMPILIBNAME from the common make variables for the mpid
# directories
smvarSubdir_commonmake=MPILIBNAME      = @MPILIBNAME@
OTHER_DIRS = util
NOTSIMPLEMAKE_SUBDIRS = mpd

# We need to handle the case where the process manager is external to 
# MPICH2
all-postamble:
	if [ -n "@pm_name@" -a -d "@pm_name@" ] ; then \
	build_prefix=`cd ../.. && pwd` && cd @pm_name@ && \
	${MAKE} prefix=$$build_prefix exec_prefix=$$build_prefix bindir=$$build_prefix/bin mpich2-build-install ; \
	fi

# Add util to distclean if possible
distclean-local:
	if [ -n "@pm_name@" -a -d "@pm_name@" ] ; then \
	build_prefix=`cd ../.. && pwd` && cd @pm_name@ && \
	${MAKE} prefix=$$build_prefix exec_prefix=$$build_prefix bindir=$$build_prefix/bin mpich2-build-uninstall ; \
	fi
	if [ -s util/Makefile ] ; then 	(cd util && ${MAKE} distclean) ; fi

