DBFLAGS=@DBFLAGS@
CFLAGS = $(CCOPTS) $(DEFS) $(DBFLAGS)

all:: $(OBJS) all-$(WHAT)


SRCS= \
	$(srcdir)/encrypt_key.c \
	$(srcdir)/decrypt_key.c \
	$(srcdir)/kdb_cpw.c \
	$(srcdir)/kdb_dbm.c \
	$(srcdir)/kdb_xdr.c \
	$(srcdir)/verify_mky.c \
	$(srcdir)/fetch_mkey.c \
	$(srcdir)/setup_mkey.c \
	$(srcdir)/store_mkey.c

OBJS= \
	encrypt_key.o \
	decrypt_key.o \
	kdb_cpw.o \
	kdb_dbm.o \
	kdb_xdr.o \
	verify_mky.o \
	fetch_mkey.o \
	setup_mkey.o \
	store_mkey.o

libkdb5.a: $(OBJS)
	$(RM) $@
	$(ARADD) $@ $(OBJS)
	$(RANLIB) $@

install:: libkdb5.a
	$(INSTALL_DATA) libkdb5.a $(DESTDIR)$(KRB5_LIBDIR)/libkdb5.a
	$(RANLIB) $(DESTDIR)$(KRB5_LIBDIR)/libkdb5.a

clean::
	$(RM) libkdb5.a

KDB5LIB =	libkdb5.a
COMERRLIB =	$(TOPLIBD)/libcom_err.a
KRB5LIB =	$(TOPLIBD)/libkrb5.a
CRYPTOLIB =	$(TOPLIBD)/libcrypto.a
KLIBS =		$(KDB5LIB) $(KRB5LIB) $(CRYPTOLIB) $(COMERRLIB)

t_kdb:	t_kdb.o $(KLIBS)
	$(LD) -o t_kdb t_kdb.o $(KLIBS) $(LIBS)

check::	t_kdb
	./t_kdb

clean::
	$(RM) t_kdb t_kdb.o
