#
#	@(#)Makefile	3.9 (motonori/WIDE) 3/22/94
#
#	Makefile for generation of sample sendmail.cf files
#

OBJS=		compat28W.cf compat28W-v1.cf \
		primary.cf null.cf nospool.cf indirect.cf nomx.cf \
		almost-local.cf almost-remote.cf uucp.cf \
		is-uucp.cf is-primary.cf is-secondary.cf \
		cs-spool.cf imel-primary.cf hemp.cf

TOPDIR=		..
MASTERDIR=	${TOPDIR}/Master
TOOLDIR=	${TOPDIR}/Tools
CONFIG=		${TOOLDIR}/Configure

###

all:	${OBJS}

clean:
	rm -f ${OBJS}

depend:
	mv -f Makefile Makefile.bak
	sed -n '1,/^# DO NOT DELETE THIS LINE/p' Makefile.bak > Makefile
	echo >> Makefile
	-(for i in ${OBJS} ; do\
		sed -n -e '/^$$/d' -e '/^#/d' -e 's/^.*FILE=//p' \
		`basename $$i .cf`.def | sed 's/#.*$$//' \
		| sort -u | xargs echo $$i: >> Makefile ; \
	done)

${CONFIG}:	${MASTERDIR}/*
	(cd ${TOPDIR}; make tools)

.SUFFIXES: .cf .def

.def.cf:
	MASTERDIR=${MASTERDIR} TOOLDIR=${TOOLDIR} \
	${CONFIG} $< > $@.tmp
	mv -f $@.tmp $@

${OBJS}:	${CONFIG}

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

compat28W.cf: compat28W.empty
compat28W-v1.cf: compat28W.empty
spool.cf: kuis.alias
nospool.cf: kuis.alias
indirect.cf:
nomx.cf:
primary.cf:
null.cf:
is-uucp.cf: kuis.alias kuis.deliver kuis.hack
is-primary.cf: isfs.deliver isfs.hack kuis.alias
is-secondary.cf: kuis.alias
