Index: /mpich2/branches/dev/kumudb/configure.in
===================================================================
--- /mpich2/branches/dev/kumudb/configure.in (revision 4870)
+++ /mpich2/branches/dev/kumudb/configure.in (revision 4898)
@@ -6382,4 +6382,22 @@
     LIB_SUBSYSTEM="$LIB_SUBSYSTEM lib_subsystem_libmpichcxx"
 fi
+libmpiexec_included=
+
+for pm_name in $pm_names ; do
+    if test "$pm_name" = "gforker"  ; then
+       if test -z "$libmpiexec_included" ; then
+           LIB_SUBSYSTEM="$LIB_SUBSYSTEM lib_subsystem_libmpiexec"
+           libmpiexec_included=yes
+       fi
+    fi
+    if test "$pm_name" = "remshell"  ; then
+       if test -z "$libmpiexec_included" ; then
+           LIB_SUBSYSTEM="$LIB_SUBSYSTEM lib_subsystem_libmpiexec"
+           libmpiexec_included=yes
+       fi
+    fi
+     
+done
+
 AC_SUBST(LIB_SUBSYSTEM)
 MPICH2_ENABLE_F77=$enable_f77
Index: /mpich2/branches/dev/kumudb/src/env/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/env/Makefile.sm (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/env/Makefile.sm (revision 4898)
@@ -6,9 +6,9 @@
 doc_LATEX_SOURCES = ${doc_sources}
 
-#mpich2version_SOURCES = mpich2version.c
-#mpich2version_LDADD = ../../lib/lib@MPILIBNAME@.a
+mpich2version_SOURCES = mpich2version.c
+mpich2version_LDADD = ../../lib/lib@MPILIBNAME@.a
 
 install_SCRIPT = mpicc parkill
-#install_BIN = mpich2version
+install_BIN = mpich2version
 install_ETC = mpixxx_opts.conf mpicc.conf
 optinstall_SCRIPT = mpicxx mpif77 mpif90
Index: /mpich2/branches/dev/kumudb/src/pm/gforker/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/gforker/Makefile.sm (revision 4811)
+++ /mpich2/branches/dev/kumudb/src/pm/gforker/Makefile.sm (revision 4898)
@@ -1,12 +1,12 @@
-#mpiexec_SOURCES = mpiexec.c 
+mpiexec_SOURCES = mpiexec.c 
 # Some C compilers won't take ../libfoo.a as a library, so we use
 # -Ldir -llib for each of the libraries instead.
 # Force the use of the static, not shared library for mpich and for mpiexec
-#mpiexec_LDADD = ../util/libmpiexec.a ../../../lib/libmpich.a
-#mpiexec_DEPADD = ../util/libmpiexec.a 
+mpiexec_LDADD = ../../../lib/libmpiexec.a ../../../lib/libmpich.a
+mpiexec_DEPADD = ../../../lib/libmpiexec.a 
 INCLUDES = -I../../include -I${master_top_srcdir}/src/include \
     -I../../pmi/simple -I${master_top_srcdir}/src/pmi/simple \
 	-I${master_top_srcdir}/src/pm/util 
-#install_BIN = mpiexec
+install_BIN = mpiexec
 
 clean-local:
@@ -37,5 +37,8 @@
 # We use a dummy dependency to ensure that we always go to the util
 # directory to see if anything needs to be done	
-../util/libmpiexec.a: dummy
-dummy:
+# ../util/libmpiexec.a: dummy
+# dummy:
+#	cd ../util && $(MAKE)
+#
+all-local:
 	cd ../util && $(MAKE)
Index: /mpich2/branches/dev/kumudb/src/pm/mpd/Makefile.in
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/mpd/Makefile.in (revision 4671)
+++ /mpich2/branches/dev/kumudb/src/pm/mpd/Makefile.in (revision 4898)
@@ -204,4 +204,6 @@
 	-rm -f $(DESTDIR)${bindir}/mpirun
 	-rm -f $(DESTDIR)${bindir}/mpirun.py
+all-executable: all-executable-local
+all-executable-local:
 
 mpich2-mpdroot: mpich2-mpdroot.o
Index: /mpich2/branches/dev/kumudb/src/pm/hydra/Makefile.am
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/hydra/Makefile.am (revision 4870)
+++ /mpich2/branches/dev/kumudb/src/pm/hydra/Makefile.am (revision 4898)
@@ -42,2 +42,6 @@
 # A special alternate installation target when using multiple process managers
 install-alt: install-alt-ui install-alt-pm
+
+all-executable: all-executable-local
+all-executable-local:
+
Index: /mpich2/branches/dev/kumudb/src/pm/util/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/src/pm/util/Makefile.sm (revision 100)
+++ /mpich2/branches/dev/kumudb/src/pm/util/Makefile.sm (revision 4898)
@@ -11,2 +11,3 @@
 	-rm -f libmpiexec.a
 
+
Index: /mpich2/branches/dev/kumudb/Makefile.sm
===================================================================
--- /mpich2/branches/dev/kumudb/Makefile.sm (revision 4827)
+++ /mpich2/branches/dev/kumudb/Makefile.sm (revision 4898)
@@ -74,4 +74,5 @@
 all-postamble: 
 	${MAKE} build-lib
+	${MAKE} all-executable
 	@if [ "@BUILD_TVDLL@" = "yes" ] ; then \
 	( cd src/mpi/debugger && $(MAKE) ./libtvmpich2.@SHLIB_EXT@ ) ; fi
@@ -90,4 +91,6 @@
 
 lib_subsystem_libfmpich: ./lib/libfmpich.a
+
+lib_subsystem_libmpiexec: ./lib/libmpiexec.a
 
 ./lib/libmpich.a: ./lib/.libmpich.a.timestamp
@@ -106,4 +109,8 @@
 	${AR} cr ./lib/libfmpich.a `find ${abs_buildir} -name libfmpich.a.manifest -exec cat {} \;` 
 	${RANLIB} ./lib/libfmpich.a
+
+./lib/libmpiexec.a: ./lib/.libmpiexec.a.timestamp
+	${AR} cr ./lib/libmpiexec.a `find ${abs_buildir} -name libmpiexec.a.manifest -exec cat {} \;` 
+	${RANLIB} ./lib/libmpiexec.a
 
 # The test on lib/.mpich2created lets us delete the local lib directory
Index: /mpich2/branches/dev/kumudb/maint/simplemake.in
===================================================================
--- /mpich2/branches/dev/kumudb/maint/simplemake.in (revision 4870)
+++ /mpich2/branches/dev/kumudb/maint/simplemake.in (revision 4898)
@@ -1031,6 +1031,7 @@
 	    $pgmsrc = $2;
 	    $programs{$pgm} = $pgmsrc;
+            #---------------------Kumud_parallel_fix------------------------------
 	    # Add to targets
-	    $alltargets[$#alltargets+1] = $pgm;
+	    # $alltargets[$#alltargets+1] = $pgm;
 	    # Keep track of source types
 	    &FindSrcTypes( $pgmsrc );
@@ -1182,4 +1183,11 @@
     # Coverage analysis
     &TargetGcov;
+    
+    #------------kumud_parallel_fix---------------------------------------
+    &TargetExecutables;
+
+    #------------------kumud_parallel_fix-------------------------------------------
+    #each executable to be built is listed as prerequisite for all-executable-local
+    &TargetProgramsLocal;
 
     # Next, the programs
@@ -1193,6 +1201,4 @@
     print FD $makeBlockSep;
     
-    #------------kumud_parallel_fix---------------------------------------
-    &TargetExecutables;
 
     # This is ugly, but we need to tell the install target when we're at
@@ -3390,4 +3396,19 @@
     }
 }
+
+
+# Generate the target all-executable-local
+sub TargetProgramsLocal {
+    print FD "all-executable-local:";
+    foreach $pgm (keys (%programs)) {
+        if (defined($extra_programs{$pgm})) { next; }
+        if (defined($extra_libs{$pgm})) { next; }
+        print FD " $pgm";
+    }
+    print FD "$newline";
+}
+
+
+
 #
 # ===========================================================================
