#
# This Makefile is for the library part of sdbm.  For the
# Full package, see makefile.sdbm.
# 
# Makefile for public domain ndbm-clone: sdbm
# DUFF: use duff's device (loop unroll) in parts of the code
#
#
CC = cc
RANLIB = :
TOP = ../../..
ABSTOP = /export/home1/local/src/lang/perl5.000
LDFLAGS = 
CLDFLAGS = 
SMALL = 
LARGE =  

# To use an alternate make, set $altmake in config.sh.
MAKE = make

# The following are used to build and install shared libraries for
# dynamic loading.
LDDLFLAGS = -G
CCDLFLAGS = 
CCCDLFLAGS = -K pic

SHELL = /bin/sh
CCCMD = `sh $(shellflags) $(TOP)/cflags $@`

.c.o:
	$(CCCMD) $(CCCDLFLAGS) -I$(TOP) -DSDBM -DDUFF $*.c

LIBOBJS = sdbm.o pair.o hash.o
LIBSRCS = sdbm.c pair.c hash.c
HDRS = tune.h sdbm.h pair.h $(TOP)/config.h

all:	libsdbm.a

libsdbm.a: $(LIBOBJS)
	ar cr libsdbm.a $(LIBOBJS)
	$(RANLIB) libsdbm.a

$(LIBOBJS): $(HDRS)

lint:
	lint -abchx $(LIBSRCS)

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

realclean: 	clean
	rm -f dbu libsdbm.a dbd dba dbe x-dbu *.dir *.pag
	rm -f makefile Makefile

purge:	realclean

sdbm.o : sdbm.c $(TOP)/config.h sdbm.h tune.h pair.h 
hash.o : hash.c $(TOP)/config.h sdbm.h 
pair.o : pair.c $(TOP)/config.h sdbm.h tune.h pair.h 

