# This is a BSD Makefile
# Run pmake, not make, if you are not on a BSD system

# The suffix of DBM files.  If using BSD DBM, say ".db".
# If using NDBM or GDBM, say ".dir" and define .pag in CLEANFILES.
# If your DBM library adds no suffix, find the obvious solution.
DB		= .dir

.SUFFIXES:	${DB} .raw

MAKEDBM		= /usr/local/lib/exim/exim_dbmbuild
SRCS		= list.raw \
		  rwdb.raw \
		  hairy.aliases.raw	hairy.rewrite.raw \
		  vygo.aliases.raw	vygo.rewrite.raw \
		  ninio.aliases.raw	ninio.rewrite.raw \
		  zak.aliases.raw	zak.rewrite.raw \
		  ribinik.aliases.raw	ribinik.rewrite.raw \
		  to-beav.aliases.raw	to-beav.rewrite.raw
DBMS		= ${SRCS:S/.raw$/${DB}/g}
CLEANFILES	= ${SRCS:S/.raw$/.pag/g} *.core core

all: ${DBMS}

clean:
	-rm -rf ${DBMS} ${CLEANFILES}

.raw${DB}:
	@TARG=$@ && \
		echo ${MAKEDBM} $< $${TARG%${DB}} && \
		${MAKEDBM} $< $${TARG%${DB}}
