#
# makefile for public domain ndbm-clone: sdbm
# DUFF: use duff's device (loop unroll) in parts of the code
#
CFLAGS = -O -DSDBM -DDUFF -DBSD42 -DNULLKEY

LFLAGS = -p

OBJS = sdbm.o hash.o dbm.o
SRCS = sdbm.c hash.c dbu.c util.c dbm.c
HDRS = tune.h sdbm.h 

sdbm: $(OBJS)
	ar cr libsdbm.a $(OBJS)
	ranlib libsdbm.a
###	cp libsdbm.a /usr/lib/libsdbm.a
	touch sdbm

all: dbu

dbu: dbu.o sdbm util.o
	cc $(LFLAGS) -o dbu dbu.o util.o libsdbm.a

dba.o: sdbm.h
dbu.o: sdbm.h
util.o:sdbm.h

$(OBJS): $(HDRS)

lint:
	lint -abchx $(SRCS)

clean:
	rm -f *.o mon.out core

purge: 	clean
	rm -f dbu libsdbm.a  *.dir *.pag
