#
#  Makefile for the Gatherer source directory
#
#  Makefile.in,v 1.32 1995/11/17 00:57:52 duane Exp
#
SUBDIRS		= essence db enumerate gatherd mgmt example

prefix = @prefix@
INSTALL_BINDIR	= $(prefix)/bin
INSTALL_LIBDIR	= $(prefix)/lib
INSTALL_MANDIR 	= $(prefix)/man

CC		= @CC@
INSTALL		= @INSTALL@
INSTALL_BIN 	= @INSTALL_PROGRAM@
INSTALL_FILE 	= @INSTALL_DATA@
RANLIB		= @RANLIB@
DEBUG_TOP	= @DEBUG_TOP@

# old variables for backward compatability
INSTALLDIR 	= $(INSTALL_BINDIR)
INSTALL_SCRIPT 	= $(INSTALL_BIN)

INSTALL_DIRS	= $(prefix) $(INSTALL_BINDIR) $(INSTALL_LIBDIR) \
		  $(INSTALL_MANDIR)

all:	
	@for dir in $(SUBDIRS); do \
		echo Making $@ in $$dir; \
		(cd $$dir; $(MAKE) $(MFLAGS) \
			prefix="$(prefix)" \
			INSTALL_BINDIR="$(INSTALL_BINDIR)" \
			INSTALL_LIBDIR="$(INSTALL_LIBDIR)" \
			INSTALL_MANDIR="$(INSTALL_MANDIR)" \
			RANLIB="$(RANLIB)" \
			DEBUG_TOP="$(DEBUG_TOP)" \
			INSTALL_BIN="$(INSTALL_BIN)" \
			INSTALL_FILE="$(INSTALL_FILE)" \
			INSTALLDIR="$(INSTALL_BINDIR)" \
			INSTALL_SCRIPT="$(INSTALL_SCRIPT)"  $@); \
	done

install:	all
	@for dir in $(SUBDIRS); do \
		echo Making $@ in $$dir; \
		(cd $$dir; $(MAKE) $(MFLAGS) \
			prefix="$(prefix)" \
			INSTALL_BINDIR="$(INSTALL_BINDIR)" \
			INSTALL_LIBDIR="$(INSTALL_LIBDIR)" \
			INSTALL_MANDIR="$(INSTALL_MANDIR)" \
			RANLIB="$(RANLIB)" \
			INSTALL_BIN="$(INSTALL_BIN)" \
			INSTALL_FILE="$(INSTALL_FILE)" \
			INSTALLDIR="$(INSTALL_BINDIR)" \
			INSTALL_SCRIPT="$(INSTALL_SCRIPT)" $@); \
	done

clean:
	-@for dir in lib $(SUBDIRS); do \
		echo Making $@ in $$dir; \
		(cd $$dir; $(MAKE) $(MFLAGS) \
			prefix="$(prefix)" \
			INSTALL_BINDIR="$(INSTALL_BINDIR)" \
			INSTALL_LIBDIR="$(INSTALL_LIBDIR)" \
			INSTALL_MANDIR="$(INSTALL_MANDIR)" \
			RANLIB="$(RANLIB)" \
			INSTALL_BIN="$(INSTALL_BIN)" \
			INSTALL_FILE="$(INSTALL_FILE)" \
			INSTALLDIR="$(INSTALL_BINDIR)" \
			INSTALL_SCRIPT="$(INSTALL_SCRIPT)" $@); \
	done

realclean:	clean
	-rm -f Makefile include/autoconf.h config.status *~ core
	-@for dir in lib $(SUBDIRS); do \
		echo Making $@ in $$dir; \
		(cd $$dir; $(MAKE) $(MFLAGS) \
			prefix="$(prefix)" \
			INSTALL_BINDIR="$(INSTALL_BINDIR)" \
			INSTALL_LIBDIR="$(INSTALL_LIBDIR)" \
			INSTALL_MANDIR="$(INSTALL_MANDIR)" \
			RANLIB="$(RANLIB)" \
			INSTALL_BIN="$(INSTALL_BIN)" \
			INSTALL_FILE="$(INSTALL_FILE)" \
			INSTALLDIR="$(INSTALL_BINDIR)" \
			INSTALL_SCRIPT="$(INSTALL_SCRIPT)"  $@); \
	done
