
# Makefile.in
#
# rcsid = "$Header: /nfs/globus1/src/master/globus_top/Makefile.in,v 1.39 1997/09/16 02:59:00 tuecke Exp $"
#

# This is inserted by configure
@makefile_header@

SUBDIRS= @SUBDIRS@
DOCDIRS= @DOCDIRS@

#
# This is the default rule.  It makes the entire program in all the
# sub-directories.  It does not, however make any documentation.
#
all:	force
	for subdir in $(SUBDIRS); do \
	    if [ -d $$subdir -a -f $$subdir/Makefile ] ; then \
	        echo "making in $$subdir" ; \
	        (cd $$subdir && $(MAKE)) ; \
	    fi \
        done

#
# This makes all documentation (in the form of dvi files)
#
dvi:	force
	for subdir in $(DOCDIRS); do \
	    if [ -d $$subdir -a -f $$subdir/Makefile ] ; then \
	        echo "making dvi in $$subdir" ; \
	        (cd $$subdir && $(MAKE) dvi) ; \
	    fi \
	done

test: 	force
	(cd test && $(MAKE) test)

#
# This cleans most files, but fails to remove those that people want to
# keep most of the time
#
mostlyclean:	force
	for subdir in $(SUBDIRS); do \
	    if [ -d $$subdir -a -f $$subdir/Makefile ] ; then \
	        echo "making mostlyclean in $$subdir" ; \
	        (cd $$subdir && $(MAKE) mostlyclean) ; \
	    fi \
	done

#
# This cleans all files created by a build, but not by a configure
#
CLEAN_FILES= \
	lib \
	include \
	etc

clean:	force
	for subdir in $(SUBDIRS); do \
	    if [ -d $$subdir -a -f $$subdir/Makefile ] ; then \
	        echo "making clean in $$subdir" ; \
	        (cd $$subdir && $(MAKE) clean) ; \
	    fi \
	done
	rm -rf $(CLEAN_FILES)

#
# This cleans all files created by both build and configure.  When this
# rule is done a simple tar and gzip should suffice.  NO EXTRA files
# from the distribution should be left.  If some files in the
# distriubtion can be made by the Makefile, but normally are kept in
# already made, these should still remain.  To get rid of them, use the
# maintainer-clean rule.
#
DISTCLEAN_FILES=config.cache \
	config.log \
	config.status \
	Makefile \
	makefile_header \
	stamp-h

distclean: clean force
	for subdir in $(SUBDIRS); do \
	    if [ -d $$subdir -a -f $$subdir/Makefile ] ; then \
	        echo "making distclean in $$subdir" ; \
	        (cd $$subdir && $(MAKE) distclean) ; \
	    fi \
	done
	rm -f $(DISTCLEAN_FILES)

# install: compile program, copy the executables, libraries,  and test for
# valid install if test exists

install: force
	make installdirs
	$(INSTALL_PROGRAM) $(topsrcdir)/configuration/config.guess \
	     @libexecdir@/config.guess
	for subdir in $(SUBDIRS) ; do \
	    if [ -d $$subdir -a -f $$subdir/Makefile ] ; then \
	        echo "making install in $$subdir" ; \
	        (cd $$subdir && $(MAKE) install) ; \
	    fi \
	done
    
force:

# I got these rules from the GNU standard.  We don't need to implement
# all of them, but some are a really good idea.  I just want to get all
# of my changes into the repository

# uninstall: delete installed files
# maintainer-clean: almost everything that can be reconstructed with Make except configure
#dist: create a distribution tar file
# check: perform self-tests
# installcheck: perform installation tests


# create directories where files are installed
installdirs:
	if [ ! -d $(prefix) ] ; then \
	    mkdir $(prefix) ; \
	fi 
	if [ ! -d $(bindir) ] ; then \
	    mkdir $(bindir) ; \
	fi 
	if [ ! -d $(sbindir) ] ; then \
	    mkdir $(sbindir) ; \
	fi 
	if [ ! -d $(libdir) ] ; then \
	    mkdir $(libdir) ; \
	fi 
	if [ ! -d $(libexecdir) ] ; then \
	    mkdir $(libexecdir) ; \
	fi 
	if [ ! -d $(includedir) ] ; then \
	    mkdir $(includedir) ; \
	fi 
	if [ ! -d $(sysconfdir) ] ; then \
	    mkdir $(sysconfdir) ; \
	fi
	if [ ! -d $(localstatedir) ] ; then \
	    mkdir $(localstatedir) ; \
	fi
	if [ ! -d $(datadir) ] ; then \
	    mkdir $(datadir) ; \
	fi
	if [ ! -d $(sharedstatedir) ] ; then \
	    mkdir $(sharedstatedir) ; \
	fi
	if [ -n $(tmpdir) ] ; then \
	   if [ ! -d $(tmpdir) ] ;  then \
	     mkdir $(tmpdir) ; \
	  fi ; \
	fi
	if [ -n "$(examplesdir)" ] ; then \
	   if [ ! -d $(examplesdir) ] ; then \
	      mkdir $(examplesdir) ; \
	   fi \
	fi

