#
#  makendbm -- make NDBM database file for later lookups
#
srcdir = @srcdir@
VPATH = @srcdir@
@SET_MAKE@

SHELL=		/bin/sh
CC=		@CC@
COPTS=		@CFLAGS@
CPPDEP=		@CPPDEP@
prefix=		@prefix@
exec_prefix=	@exec_prefix@
MAILBIN=	@MAILBIN@
DEFS=		@DEFS@
INSTALL=	@INSTALL@
CFLAGS=		$(COPTS) $(DEFS) $(INCL)
TOPDIR=		../..
INCL=		-I$(TOPDIR)/include -I$(TOPDIR)

PROGS=		makendbm ndbmlook
SOURCE=		makendbm.c ndbmlook.c
LIBS=		-L$(TOPDIR)/libs -lz -lzc @LIBDBMS@

all: $(PROGS)

makendbm: makendbm.o readpolicy.o
	$(CC) $(CFLAGS) -o makendbm makendbm.o readpolicy.o $(LIBS)

ndbmlook: ndbmlook.o
	$(CC) $(CFLAGS) -o ndbmlook ndbmlook.o $(LIBS)

readpolicy.o: $(TOPDIR)/smtpserver/readpolicy.c $(TOPDIR)/include/policy.h
	$(CC) -c $(CFLAGS) $(TOPDIR)/smtpserver/readpolicy.c -o readpolicy.o

clean:
	-rm -f *.o $(PROGS) *~

distclean: clean
	-rm -f Makefile

install:
	for x in $(PROGS) ; do \
	$(INSTALL) -m 0755 $$x $(MAILBIN)/$$x.x; \
	mv $(MAILBIN)/$$x.x $(MAILBIN)/$$x; done

depend:
	$(TOPDIR)/bin/mkdep $(CFLAGS) $(SOURCE)

# DO NOT DELETE THIS LINE -- mkdep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.

makendbm.o: makendbm.c
ndbmlook.o: ndbmlook.c

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
