#
#  MAKEFILE -- The IDA Sendmail Enhancement Kit.
#  Copyright (c) 1987 Lennart Lovstrand
#  CIS Dept, Univ of Linkoping, Sweden
#
#  Use it, abuse it, but don't sell it.
#

#  Global definitions; will be exported to all Makefiles
SHELL=		/bin/sh
#CC=		gcc -ansi -Dvax -fpcc-struct-return -fstrength-reduce -finline-functions
CC=		cc
MAN8DIR=	/usr/local/share/man/man8 # Place for the section 8 manuals
MAN8EXT=	.8			# Extension for section 8 manuals
MAN1DIR=	/usr/local/share/man/man1 # Place for the section 1 manuals
MAN1EXT=	.1			# Extension for section 1 manuals
BINDIR=		/usr/local/bin		# Where the binary aux files should go
LIBDIR=		/var/apps/mail		# Where the data files should be
SRCDIR=		../../src		# The sendmail src subdirectory
INCLUDEDIR=	../../src		# The sendmail include subdirectory
DOCDIR=		../../doc		# The sendmail doc subdirectory
CFDIR=		/etc			# The sendmail.cf directory
LIBS=					# Other libraries needed
XDBM=		#-DHDBM			# One of -DGDBM,-DSDBM,-DMDBM,-DHDBM
DBMLIB=		-ldbm	# GDBM: -lndbm, SDBM: -lsdbm, HDBM: -lhash, else: -ldbm
TROFF=		psroff			# The [nt]roff program of your choice

configure:	config.ed
		@echo ">>> Propagating changes to subdirectories."
		for M in */Makefile; do \
			ed $$M <config.ed; \
		done

config.ed:	Makefile
		egrep '^[A-Z][A-Z]*=' Makefile | \
		sed -e 's/[ 	]*#.*$$//' -e 's/#.*$$//' \
			-e 's/^\([^=]*\).*$$/g\/^\1\/c\\;&\\;./' | \
		tr ';' '\012' >$@
		echo w >>$@
		echo q >>$@

clean:
		-rm -f \#* *~ config.ed

spotless:	clean
		for d in */.; do \
			(cd $$d; make clean); \
		done
