# Top-level Makefile for cyrus software
# $Id: Makefile.in,v 1.1.1.1 2000/11/30 04:55:41 mhat Exp $
#
# @configure_input@
# Copyright 1998 Carnegie Mellon University
# 
# No warranties, either expressed or implied, are made regarding the
# operation, use, or results of the software.
#
# Permission to use, copy, modify and distribute this software and its
# documentation is hereby granted for non-commercial purposes only
# provided that this copyright notice appears in all copies and in
# supporting documentation.
#
# Permission is also granted to Internet Service Providers and others
# entities to use the software for internal purposes.
#
# The distribution, modification or sale of a product which uses or is
# based on the software, in whole or in part, for commercial purposes or
# benefits requires specific, additional permission from:
#
#  Office of Technology Transfer
#  Carnegie Mellon University
#  5000 Forbes Avenue
#  Pittsburgh, PA  15213-3890
#  (412) 268-4387, fax: (412) 268-7395
#  tech-transfer@andrew.cmu.edu
# 

SUBDIRS = man @PRE_SUBDIRS@ lib @SERVER_SUBDIRS@ imtest @TCL_SUBDIRS@ @EXTRA_SUBDIRS@

srcdir = @srcdir@
VPATH = @srcdir@

INSTALL = @INSTALL@

SHELL = /bin/sh
@SET_MAKE@

prefix = @prefix@
exec_prefix = @exec_prefix@
cyrus_prefix = @cyrus_prefix@

all:: checkdepend
	@for d in  $(SUBDIRS); \
	do \
		(cd $$d; echo "### Making" all "in" `pwd`;	\
			$(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) all) || exit 1; \
	done

install::
	$(srcdir)/install-sh -d ${DESTDIR}$(exec_prefix)/bin
	$(srcdir)/install-sh -d ${DESTDIR}$(exec_prefix)/lib
	$(srcdir)/install-sh -d ${DESTDIR}$(prefix)/include/cyrus
	$(srcdir)/install-sh -d ${DESTDIR}$(prefix)/man/man1
	$(srcdir)/install-sh -d ${DESTDIR}$(prefix)/man/man3
	$(srcdir)/install-sh -d ${DESTDIR}$(prefix)/man/man5
	$(srcdir)/install-sh -d ${DESTDIR}$(prefix)/man/man8
	@for d in  $(SUBDIRS); \
	do \
		(cd $$d; echo "### Making" install "in" `pwd`;	\
			$(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) install) || exit 1; \
	done

clean::
	@-for d in  $(SUBDIRS); \
	do \
		(cd $$d; echo "### Making" clean "in" `pwd`;	\
			$(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) clean ;	\
			echo "### Done with" `pwd`);		\
	done

distclean::
	@-for d in  $(SUBDIRS); \
	do \
		(cd $$d; echo "### Making" clean "in" `pwd`;	\
			$(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) distclean ; \
			echo "### Done with" `pwd`);		\
	done
	rm -f Makefile Makefile.bak config.status config.log config.cache

depend::
	@for d in  $(SUBDIRS); \
	do \
		(cd $$d; echo "### Making" depend "in" `pwd`;	\
			$(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) depend) || exit 1; \
	done

Makefile: Makefile.in config.status
	$(SHELL) config.status
config.status: configure
	$(SHELL) config.status --recheck
configure: configure.in
	cd $(srcdir); rm -f config.cache; autoconf

checkdepend::

depend::
	echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
	echo 'w' >>eddep
	cp Makefile Makefile.bak
	ed -s Makefile < eddep
	rm eddep
	echo '' >> Makefile
	echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
	echo '# see make depend above' >> Makefile

# DO NOT DELETE THIS LINE -- make depend uses it

# The following rule ensures that "make depend" gets run at least
# once before a "make all".  The "depend" rule above removes
# this rule from the Makefile the first time the "make depend"
# has been run after the Makefile is generated by Configure

checkdepend:: depend

# IF YOU PUT STUFF HERE IT WILL GO AWAY
# see make depend above
