# This Makefile.in created by simplemake.  Do not edit

# Makefile.  Generated from Makefile.in by configure.

# --------------------------------------------------------------------------
all: all-redirect

SHELL           = /bin/sh
LIBTOOL         = 
CREATESHLIB     = /proj/tpfimos/larour/Libraries/linux/mpich2-1.0.2p1/src/util/createshlib
C_LINK_SHL      = ${CC} -shared
INSTALL         = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA    = ${INSTALL} -m 644
MKDIR_P         = mkdir -p
master_top_srcdir  = /proj/tpfimos/larour/Libraries/linux/mpich2-1.0.2p1
srcdir          = .
exec_prefix     = ${prefix}
prefix          = /proj/tpfimos/larour/Libraries/linux/mpich2-gnu/
abs_srcdir      = /proj/tpfimos/larour/Libraries/linux/mpich2-1.0.2p1
libdir          = ${exec_prefix}/lib
prefix          = /proj/tpfimos/larour/Libraries/linux/mpich2-gnu/
includedir      = ${prefix}/include
libdir          = ${exec_prefix}/lib
docdir          = ${prefix}/doc
htmldir         = ${prefix}/www
mandir          = ${prefix}/man
MAKE            = make
MPILIBNAME      = mpich
PMPILIBNAME     = pmpich


VPATH = .
PACKAGE = mpich2
VERSION = 1.0.2
MPICVSHOME = 
MODULE_DIRS = confdb src/util/thread src/mpi/romio src/mpe2 src/pm/smpd src/pm/mpd doc/notes 
MPICXXLIBNAME = mpichcxx
MPIFLIBNAME   = mpich

.SUFFIXES:
# Some make programs complain if no suffixes are set
.SUFFIXES: .c .o
clean:
	-@rm -f *.o ${srcdir}/*.o 
	-@rm -f .libstamp0 .libstamp1 
	-@rm -f *.lo ${srcdir}/*.lo
	for dir in src  examples - ; do \
		if [ "$$dir" = "-" ] ; then break ; fi ; \
		(cd $$dir && ${MAKE} clean ; ) ; done
distclean: clean distclean-local distclean-xxx remove-makefile
distclean-xxx:
	for dir in src  examples - ; do \
		if [ "$$dir" = "-" ] ; then break ; fi ; \
		(cd $$dir && ${MAKE} distclean ; ) ; done
	-@rm -f Makefile examples/f77/Makefile examples/f90/Makefile examples/cxx/Makefile doc/refman/Makefile doc/installguide/Makefile doc/userguide/Makefile doc/logging/Makefile doc/smpd/Makefile config.status config.log config.cache *conf.cache config.system
	-@rm -rf autom4te*.cache
	-@rm -f src/include/mpichconf.h
	-@rm -f test/Makefile test/util/Makefile test/mpid/Makefile test/mpid/ch3/Makefile doc/Makefile doc/mansrc/Makefile doc/mansrc/createhtmlindex
	-@rm -rf $(DEPS_DIR)
	-@rm -f TAGS
remove-makefile:
	rm -f Makefile
remove-genmakefiles:
	rm -f  Makefile
all-redirect: all-preamble
	${MAKE} all-local
	@(cd src && ${MAKE} all )
	@for dir in  - ; do \
		if [ "$$dir" = "-" ] ; then break ; fi ; \
		if ( cd $$dir && ${MAKE} all ) ; then : ; else exit 1; fi \
	done
	@(cd examples && ${MAKE} all )
	@if [ "gcc" != "none" ] ; then \
	    if [ -s lib/lib${MPILIBNAME}.la ] ; then \
	        echo "make lib/lib${MPILIBNAME}.so" ;\
	        ${MAKE} lib/lib${MPILIBNAME}.so ; \
	    fi ; \
	    if [ -s lib/libf${MPILIBNAME}.la ] ; then \
	        echo "make lib/libf${MPILIBNAME}.so" ;\
	        ${MAKE} lib/libf${MPILIBNAME}.so ; \
	    fi ; \
	fi
	${MAKE} all-postamble

CC              = gcc
CFLAGS          = 
C_COMPILE       = $(CC) $(DEFS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS)
# Build the shared library from the shared object files
lib/lib${MPILIBNAME}.so: lib/lib${MPILIBNAME}.la
	(cd lib && $(CREATESHLIB) --mode=link -o lib${MPILIBNAME}.la  -rpath $(libdir) )
	if [ -n "" -a \
		"${MPILIBNAME}" != "${PMPILIBNAME}" ] ; then \
	(cd lib && $(CREATESHLIB) --mode=link -o lib${PMPILIBNAME}.la  -rpath $(libdir) );\
	fi
# Build the shared library from the shared object files
lib/libf${MPILIBNAME}.so: lib/libf${MPILIBNAME}.la
	(cd lib && $(CREATESHLIB) --mode=link -o libf${MPILIBNAME}.la  -rpath $(libdir) )

# --------------------------------------------------------------------------
.libstamp0: 
.libstamp1: 
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------
# Install target
install: FORCE_TARGET 
	if [ ! -d ${prefix} ] ; then $(MKDIR_P) ${prefix} ; fi
	if [ ! -d ${htmldir} ] ; then $(MKDIR_P) ${htmldir} ; fi
	if [ ! -d ${mandir} ] ; then $(MKDIR_P) ${mandir} ; fi
	if [ ! -d ${includedir} ] ; then $(MKDIR_P) ${includedir} ; fi
	${MAKE} install-local
	$(INSTALL_DATA) src/include/mpi.h ${includedir}/mpi.h
	if [ ! -d ${exec_prefix} ] ; then $(MKDIR_P) ${exec_prefix} ; fi
	if [ ! -d ${libdir} ] ; then $(MKDIR_P) ${libdir} ; fi
	$(INSTALL_DATA) lib/lib${MPILIBNAME}.a ${libdir}/lib${MPILIBNAME}.a
	if [ ! -d ${docdir} ] ; then $(MKDIR_P) ${docdir} ; fi
	@-test -d $(srcdir)/www && cd $(srcdir)/www && for name in * ; do \
	 if [ -f $$name ] ; then \
	    echo "$(INSTALL_DATA) $$name ${htmldir}/$$name" ; \
	    $(INSTALL_DATA) $$name ${htmldir}/$$name ; \
	 elif [ -d $$name ] ; then \
	    if [ ! -d ${htmldir}/$$name ] ; then $(MKDIR_P) ${htmldir}/$$name ; fi ;\
	    ( cd $$name && for name2 in * ; do \
	        if [ -f $$name2 ] ; then \
	            echo "$(INSTALL_DATA) $$name2 ${htmldir}/$$name/$$name2" ; \
	            $(INSTALL_DATA) $$name2 ${htmldir}/$$name/$$name2 ; \
	        else \
	            echo "cp -rp $$name ${htmldir}/$$name" ; \
	            cp -rp $$name ${htmldir}/$$name ; \
	        fi \
	    done ) ; \
	 else \
	    echo "Unknown file type for $$name" ; \
	 fi ; \
	done
	@-test -d $(srcdir)/man && cd $(srcdir)/man && for name in * ; do \
	 if [ -f $$name ] ; then \
	    echo "$(INSTALL_DATA) $$name ${mandir}/$$name" ; \
	    $(INSTALL_DATA) $$name ${mandir}/$$name ; \
	 elif [ -d $$name ] ; then \
	    if [ ! -d ${mandir}/$$name ] ; then $(MKDIR_P) ${mandir}/$$name ; fi ;\
	    ( cd $$name && for name2 in * ; do \
	        if [ -f $$name2 ] ; then \
	            echo "$(INSTALL_DATA) $$name2 ${mandir}/$$name/$$name2" ; \
	            $(INSTALL_DATA) $$name2 ${mandir}/$$name/$$name2 ; \
	        else \
	            echo "cp -rp $$name ${mandir}/$$name" ; \
	            cp -rp $$name ${mandir}/$$name ; \
	        fi \
	    done ) ; \
	 else \
	    echo "Unknown file type for $$name" ; \
	 fi ; \
	done
	if [ -s src/mpi/romio/include/mpiof.h ] ; then $(INSTALL_DATA) src/mpi/romio/include/mpiof.h ${includedir}/mpiof.h ; fi
	if [ -s src/mpi/romio/include/mpio.h ] ; then $(INSTALL_DATA) src/mpi/romio/include/mpio.h ${includedir}/mpio.h ; fi
	if [ -s lib/lib${MPIFLIBNAME}.a ] ; then $(INSTALL_DATA) lib/lib${MPIFLIBNAME}.a ${libdir}/lib${MPIFLIBNAME}.a ; fi
	if [ -s lib/lib${MPICXXLIBNAME}.a ] ; then $(INSTALL_DATA) lib/lib${MPICXXLIBNAME}.a ${libdir}/lib${MPICXXLIBNAME}.a ; fi
	if [ -s lib/lib${PMPILIBNAME}.a ] ; then $(INSTALL_DATA) lib/lib${PMPILIBNAME}.a ${libdir}/lib${PMPILIBNAME}.a ; fi
	if [ -s lib/libf${MPILIBNAME}.a ] ; then $(INSTALL_DATA) lib/libf${MPILIBNAME}.a ${libdir}/libf${MPILIBNAME}.a ; fi
	if [ -s lib/lib${MPILIBNAME}.so ] ; then $(CREATESHLIB) --mode=install lib/lib${MPILIBNAME}.so ${libdir}/lib${MPILIBNAME}.so ; fi
	if [ -s lib/lib${PMPILIBNAME}.so ] ; then $(CREATESHLIB) --mode=install lib/lib${PMPILIBNAME}.so ${libdir}/lib${PMPILIBNAME}.so ; fi
	if [ -s lib/libf${MPILIBNAME}.so ] ; then $(CREATESHLIB) --mode=install lib/libf${MPILIBNAME}.so ${libdir}/libf${MPILIBNAME}.so ; fi
	if [ -s $(srcdir)/doc/userguide/user.pdf ] ; then $(INSTALL_DATA) $(srcdir)/doc/userguide/user.pdf ${docdir}/user.pdf ; fi
	if [ -s $(srcdir)/doc/installguide/install.pdf ] ; then $(INSTALL_DATA) $(srcdir)/doc/installguide/install.pdf ${docdir}/install.pdf ; fi
	if [ -s $(srcdir)/doc/smpd/smpd_pmi.pdf ] ; then $(INSTALL_DATA) $(srcdir)/doc/smpd/smpd_pmi.pdf ${docdir}/smpd_pmi.pdf ; fi
	if [ -s $(srcdir)/doc/logging/logging.pdf ] ; then $(INSTALL_DATA) $(srcdir)/doc/logging/logging.pdf ${docdir}/logging.pdf ; fi
	(cd src/util/thread && $(MAKE) INSTALL_STRIP_FLAG=$(INSTALL_STRIP_FLAG) install)
	(cd src/env && $(MAKE) INSTALL_STRIP_FLAG=$(INSTALL_STRIP_FLAG) install)
	for dir in  src/binding/f77 src/binding/f90 src/binding/cxx - ; do \
		if [ "$$dir" = "-" ] ; then break ; fi ;\
		(cd $$dir && $(MAKE) INSTALL_STRIP_FLAG=$(INSTALL_STRIP_FLAG) install) ;\
	done
	for dir in  src/pm/mpd src/mpe2 - ; do \
		if [ "$$dir" = "-" ] ; then break ; fi ;\
		(cd $$dir && $(MAKE) INSTALL_STRIP_FLAG=$(INSTALL_STRIP_FLAG) install) ;\
	done

install-strip:
	$(MAKE) INSTALL_STRIP_FLAG=-s install
uninstall:
	-rm -f ${includedir}/mpi.h
	-rm -f ${libdir}/lib${MPILIBNAME}.a
	-rm -f ${includedir}/mpiof.h
	-rm -f ${includedir}/mpio.h
	-rm -f ${libdir}/lib${MPIFLIBNAME}.a
	-rm -f ${libdir}/lib${MPICXXLIBNAME}.a
	-rm -f ${libdir}/lib${PMPILIBNAME}.a
	-rm -f ${libdir}/libf${MPILIBNAME}.a
	-rm -f ${libdir}/lib${MPILIBNAME}.so
	-rm -f ${libdir}/lib${PMPILIBNAME}.so
	-rm -f ${libdir}/libf${MPILIBNAME}.so
	-rm -f ${docdir}/user.pdf
	-rm -f ${docdir}/install.pdf
	-rm -f ${docdir}/smpd_pmi.pdf
	-rm -f ${docdir}/logging.pdf
	for dir in src/util/thread src/env  src/binding/f77 src/binding/f90 src/binding/cxx  src/pm/mpd src/mpe2 - ; do \
		if [ "$$dir" = "-" ] ; then break ; fi ; \
		(cd $$dir && ${MAKE} uninstall ; ) ; done
installcheck:
	for dir in src/util/thread src/env  src/binding/f77 src/binding/f90 src/binding/cxx  src/pm/mpd src/mpe2 - ; do \
		if [ "$$dir" = "-" ] ; then break ; fi ; \
		(cd $$dir && ${MAKE} installcheck ; ) ; done
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------
tags: TAGS
TAGS:
	for dir in src  examples - ; do \
		if [ "$$dir" = "-" ] ; then break ; fi ; \
		(cd $$dir && ${MAKE} TAGS ; ) ; done
# --------------------------------------------------------------------------
# Do not include test in the basic build.  
# The all-local target makes sure that when different subsystems are selected
# for the configure step, the libraries are removed and the object files 
# cleaned out.  Without this step, it is possible to run make and encounter
# errors caused by out-of-date objects in the directories and in the 
# library.  We do not replace the pkglist file until the make completes,
# using the all-postamble target.
#
# Here is the logic:
#   A new configure creates lib/newconfig
#   A cleanobjsandlibs step removes that file, as well as removing the
#     libraries and object files
#   The test for whether the clean step is performed is this:
#      Create a file lib/pkglist.new
#      Compare lib/pkglist.new to lib/pkglist
#      If the same, rm lib/pkglist.new and done.
#      If different, then cleanout the libraries and object files,
#          then mv lib/pkglist.new lib/pkglist
#          
all-local:
	if [ ! -d lib ] ; then mkdir lib ; \
	else \
	    echo " src/mpid/ch3 src/mpid/common/sock  src/mpi/romio src/pmi/simple src/pm/mpd src/mpe2  src/binding/f90" > lib/pkglist.new ; \
	    echo "gcc" >>lib/pkglist.new ;\
	    echo "--prefix=/proj/tpfimos/larour/Libraries/linux/mpich2-gnu/ --enable-sharedlibs=gcc" >>lib/pkglist.new ; \
	    if diff lib/pkglist lib/pkglist.new >/dev/null 2>&1 ; then \
	        rm -f lib/pkglist.new ; \
            else \
		${MAKE} cleanobjsandlibs ; \
		rm -f lib/pkglist ; \
		mv -f lib/pkglist.new lib/pkglist ; \
	    fi ; \
	fi
cleanobjsandlibs:
	rm -f lib/lib${MPILIBNAME}.a lib/lib${PMPILIBNAME}.a
	rm -f lib/lib${MPILIBNAME}cxx.a 
	rm -f lib/lib${MPILIBNAME}.so* lib/lib${PMPILIBNAME}.so*
	rm -f lib/lib${MPILIBNAME}cxx.so* 
	rm -f lib/lib${MPILIBNAME}.la* lib/lib${PMPILIBNAME}.la*
	rm -f lib/lib${MPILIBNAME}cxx.la* 
	${MAKE} clean ; cd test && ${MAKE} clean
	rm -f lib/newconfig

all-preamble:
	@echo "Beginning make"

# Add any final extras:
#    1) Build the debugger interface if requested
# Move the "pkglist.new" file to "pkglist" on successful completion
all-postamble:
	@if [ "no" = "yes" ] ; then \
	( cd src/mpi/debugger && $(MAKE) ./libtvmpich.so ) ; fi
	@if [ -s lib/pkglist.new ] ; then mv -f lib/pkglist.new lib/pkglist ; fi
	@echo "Make completed"

distclean-local:
	-@rm -f lib/lib${MPILIBNAME}.a lib/pkglist lib/pkglist.new
	-@rm -f lib/lib${MPILIBNAME}.so* lib/lib${MPILIBNAME}.la
	-@rm -f src/include/${MPILIBNAME}conf.h
	-@rm -f src/include/mpio.h
	-@rm -f bin/mpicc
	-@rm -f bin/mpich2version
	-@cd test && $(MAKE) distclean

# Version < 1 is pre MPI-1 release.
# Version >= 2 contains MPI-2
# Version between 1 and 2 contains all of MPI1 and parts of MPI-2
# Version is now set in the Configure file so that we can easily include the
# version on the configure output and to match the common practice of
# current autoconfs
#
# Build a distribution tarfile
#  Extract into a temporary directory
#     cvs update output into cvsexp.log to reduce the volume of noise
#     in the output
#  Rename the directory
#  Run updatefiles with distribution options
#  Tar it up
dist: dist-check
	@version=${VERSION} ; \
	prever=`echo ${VERSION} | sed -e 's/^[^-]*//'` ; \
	if test "$$prever" = "-CVS" ; then version=$${version}-`date "+%Y%m%d%H%M"` ; fi ; \
	if test -z "${TAG}" ; then tag=HEAD ; else tag=${TAG}; fi ; \
	$(MAKE) version=$${version} tag=$${tag} doc=yes dist-with-version

# snap creates a simple snapshot of the currently checked in MPICH2 sources.
# No documentation is included.
snap:
	@version=snap-`date "+%Y%m%d%H%M"` ; \
	$(MAKE) version=$${version} tag=HEAD doc=no dist-with-version

dist-with-version:
	@if [ -z "$(version)" ] ; then \
	    echo "Must invoke with make version=value tag=value dist-with-version" ;\
	    exit 1 ; fi 
	@if [ -z "$(tag)" ] ; then \
	    echo "Must invoke with make version=value tag=value dist-with-version" ;\
	    exit 1 ; fi 
	@echo ""; echo "Cutting version ${version} of the MPICH2 distribution from tag ${tag}" ; echo ""
	if [ ! -d tmpdir ] ; then mkdir tmpdir ; fi 
	rm -f cvsexp.log 
	( cd tmpdir && cvs -d $(MPICVSHOME) export -r "${tag}" mpich2allWithMPE >cvsexp.log 2>&1 ) || (echo "cvs export failed; see tmpdir/cvsexp.log" && exit 1 )
	( cd tmpdir/mpich2 && sed -e "s/^VERSION = .*/VERSION = ${version}/" Makefile.sm >.tmp && mv .tmp Makefile.sm )
	echo "${version}" >tmpdir/mpich2/maint/Version
	mv tmpdir/mpich2 tmpdir/${PACKAGE}-${version}
	( cd tmpdir/${PACKAGE}-${version}/src/mpid && /bin/rm -rf mm rdma globus)
	( cd tmpdir/${PACKAGE}-${version}/doc && /bin/rm -rf notes develop )
	( cd tmpdir/${PACKAGE}-${version}/src/pm && /bin/rm -rf forker rmpd ompd remshell )
	( cd tmpdir/${PACKAGE}-${version} && rm -f ToDo* )
	( cd tmpdir/${PACKAGE}-${version} && maint/updatefiles )
	( cd tmpdir/${PACKAGE}-${version} && find . -name 'autom4te.cache' \
	  -print | xargs -r rm -rf)
	( cd tmpdir//${PACKAGE}-${version} && rm -rf src/mpe2/src/slog2sdk/doc/jumpshot-4/tex  )
	if test "$(doc)" = "yes" ; then \
	    cp -r tmpdir/${PACKAGE}-${version} tmpdir2 ; \
	    rm -f manlog.txt ; \
	    ( cd tmpdir2 && ./configure --without-mpe --disable-f90 \
              --disable-f7 && \
              ${MAKE} mandoc && ${MAKE} htmldoc && \
              ${MAKE} latexdoc ) >manlog.txt 2>&1 ; \
	    if [ ! -d tmpdir2/man ] ; then echo "WARNING: unable to build manpages" ; \
		(cd tmpdir2 && ls ) ; \
	    fi ; \
	    cp -r tmpdir2/man tmpdir/${PACKAGE}-${version}/man ; \
	    cp -r tmpdir2/www tmpdir/${PACKAGE}-${version}/www ; \
	    cp tmpdir2/doc/userguide/user.pdf tmpdir/${PACKAGE}-${version}/doc/userguide/user.pdf ; \
	    cp tmpdir2/doc/installguide/install.pdf tmpdir/${PACKAGE}-${version}/doc/installguide/install.pdf ; \
	    cp tmpdir2/doc/smpd/smpd_pmi.pdf tmpdir/${PACKAGE}-${version}/doc/smpd/smpd_pmi.pdf ; \
	    cp tmpdir2/doc/logging/logging.pdf tmpdir/${PACKAGE}-${version}/doc/logging/logging.pdf ; \
	    rm -rf tmpdir2 ; \
	fi
	( cd tmpdir/${PACKAGE}-${version} && maint/updatefiles -distrib )
	( cd tmpdir && tar cf ${PACKAGE}-${version}.tar ${PACKAGE}-${version} )
	mv -f tmpdir/${PACKAGE}-${version}.tar . 
	rm -rf tmpdir

# Check that all modules are present in the development version
dist-check:
	@for dir in $(MODULE_DIRS) ; do \
	    if [ ! -d $(master_top_srcdir)/$$dir ] ; then \
		echo "Missing $$dir in $(master_top_srcdir) !" ; \
		exit 1 ; \
	    fi ; \
	done

# 
# We skip the mpid/mm directories because mm is no longer active
# mpe2 is an outside project and is tested against the default
# checks
coding-check: 
	@if [ -z $(CODINGCHECK) ] ;then \
	    echo "You must define CODINGCHECK for this target" ; \
	else \
	   echo "Checking the MPICH2 sources" ;\
	   $(CODINGCHECK) -addchecks=mpich2,funcstates,funcnests \
		-skipfiles=src/mpe2,src/mpid/mm src examples test ;\
	   if [ -d src/mpe2 ] ; then \
	        echo "Checking mpe2 sources" ;\
		$(CODINGCHECK) src/mpe2 ; \
	   fi ; \
	fi

# Set the document sources and types (empty lists still cause recursion)
# These should be empty; any source files should be described in the
# directory that contains those source files.  The presence of these
# items simply indicates that there are such documents

# Add the www index pages
htmldoc-local:
	doc/mansrc/createhtmlindex

# Testing requires installation first
testing:
	(cd test && $(MAKE) testing)

#optinstall_SHLIB = lib/lib${MPIFLIBNAME}.so
#optinstall_SHLIB = lib/lib${MPICXXLIBNAME}.so

# Extra information on creating shared libraries, needed on some platforms
# On the platforms that require these options, we require that 
# PMPILIBNAME and MPILIBNAME be the same.
# UNUSED, example for experimentation only
#lib${MPILIBNAME}_so_EXPORTS = maint/mpi.def
#libf${MPILIBNAME}_so_EXPORTS = maint/fmpi.def
#libf${MPILIBNAME}_so_LIBS = -L. -l$(MPILIBNAME)



# Some of the subsidiary packages may need to be installed.  This target will
# invoke their install targets as part of the installation process

install-local:
	-if [ "no" = "yes" ] ; then \
	    $(INSTALL_DATA) src/mpi/debugger/libtvmpich.so \
			${libdir}/libtvmpich.so ; fi
	if test ! -d ${exec_prefix}/examples ; then \
	    $(MKDIR_P) ${exec_prefix}/examples ; \
	fi
	$(INSTALL_PROGRAM) examples/cpi ${exec_prefix}/examples/cpi

install-devdocs:
	(cd doc && $(MAKE) install-devdocs)

#
# The documents are shipped as part of the release, and so should be 
# installed from the source directory, not a VPATH build directory
#install_BIN = 
#install_SBIN = 	

FORCE_TARGET:

