srcdir = @srcdir@
 VPATH = @srcdir@

# makefile for public domain ndbm-clone: sdbm
# DUFF: use duff's device (loop unroll) in parts of the code
     CC = @CC@
 CFLAGS = -DSDBM -DDUFF @DEFS@ @CFLAGS@
LDFLAGS = @LDFLAGS@
 RANLIB = @RANLIB@

   OBJS = sdbm.o pair.o hash.o
   SRCS = sdbm.c pair.c hash.c dbu.c dba.c dbd.c util.c
   HDRS = tune.h sdbm.h pair.h
   MISC = README CHANGES COMPARE sdbm.3 dbe.c dbe.1 \
	dbm.c dbm.h biblio readme.ms readme.ps
    LIB = libsdbm.a

all:	dbu dba dbd dbe

dbu:	dbu.o $(LIB) util.o
	$(CC) $(LDFLAGS) -o dbu dbu.o util.o $(LIB)

dba:	dba.o util.o
	$(CC) $(LDFLAGS) -o dba dba.o util.o

dbd:	dbd.o util.o
	$(CC) $(LDFLAGS) -o dbd dbd.o util.o

dbe:	dbe.o $(LIB)
	$(CC) $(LDFLAGS) -o dbe dbe.o $(LIB)

$(LIB):	$(OBJS)
	$(AR) cr $@ $(OBJS)
	$(RANLIB) $@

$(OBJS): sdbm.h tune.h pair.h

#
# dbu using berkelezoid ndbm routines [if you have them] for testing
#
#x-dbu: dbu.o util.o
#	$(CC) $(CFLAGS) -o x-dbu dbu.o util.o
lint:
	lint -abchx $(SRCS)

clean:
	rm -f *.o mon.out core $(LIB) dbu dbd dbe dba *~ *.bak

readme:
	nroff -ms readme.ms | col -b >README

distclean: clean
	rm -f *.dir *.pag Makefile

depend:
	makedepend $(CFLAGS) $(SRCS)

TAGS tags test check:

# DO NOT DELETE THIS LINE -- make depend depends on it.
