#### insert configury here
BUILDTOP=$(C)$(S)$(U)

SRCS	= \
	ext_srvtab.c \
	kdb_destroy.c \
	kdb_edit.c \
	kdb_init.c \
	kdb_util.c \
	kstash.c \
	maketime.c

CODE	= ${SRCS} Makefile.in
DEFINES	= -I.
LIBS= ${KDB_LIB} ${KRB_LIB} ${DES_LIB}
DEPLIBS= ${KDB_LIBDEP} ${KRB_LIBDEP} ${DES_LIBDEP}

all:: ext_srvtab kdb_destroy kdb_edit kdb_init kdb_util kstash 

# program(ext_srvtab,ext_srvtab.o,${DEPLIBS},${LIBS},${DAEMDIR})
ext_srvtab: ext_srvtab.o ${DEPLIBS}
	$(CC) $(CFLAGS) -o $@ ext_srvtab.o ${LIBS}

# program(kdb_destroy,kdb_destroy.o,,,${DAEMDIR})
kdb_destroy: kdb_destroy.o
	$(CC) $(CFLAGS) -o $@ kdb_destroy.o
	
# program(kdb_edit,kdb_edit.o maketime.o,${DEPLIBS},${LIBS},${DAEMDIR})
kdb_edit: kdb_edit.o maketime.o ${DEPLIBS}
	$(CC) $(CFLAGS) -o $@ kdb_edit.o maketime.o ${LIBS}

# program(kdb_init,kdb_init.o,${DEPLIBS},${LIBS},${DAEMDIR})
kdb_init: kdb_init.o ${DEPLIBS}
	$(CC) $(CFLAGS) -o $@ kdb_init.o ${LIBS}

# program(kdb_util,kdb_util.o maketime.o,${DEPLIBS},${LIBS},${DAEMDIR})
kdb_util: kdb_util.o maketime.o ${DEPLIBS}
	$(CC) $(CFLAGS) -o $@ kdb_util.o maketime.o ${LIBS}

# program(kstash,kstash.o,${DEPLIBS},${LIBS},${DAEMDIR})
kstash: kstash.o ${DEPLIBS}
	$(CC) $(CFLAGS) -o $@ kstash.o ${LIBS}

install::
	$(INSTALLPROG) ext_srvtab ${DESTDIR}${DAEMDIR}/ext_srvtab
	$(INSTALLPROG) kdb_destroy ${DESTDIR}${DAEMDIR}/kdb_destroy
	$(INSTALLPROG) kdb_edit ${DESTDIR}${DAEMDIR}/kdb_edit
	$(INSTALLPROG) kdb_init ${DESTDIR}${DAEMDIR}/kdb_init
	$(INSTALLPROG) kdb_util ${DESTDIR}${DAEMDIR}/kdb_util
	$(INSTALLPROG) kstash ${DESTDIR}${DAEMDIR}/kstash

clean::
	$(RM) ext_srvtab kdb_destroy kdb_edit kdb_init kdb_util kstash 
	$(RM) ext_srvtab.o kdb_destroy.o kdb_edit.o kdb_init.o kdb_util.o
	$(RM) kstash.o maketime.o

depend:: ${CODE}

distclean:: clean
	-rm -f *~ core
	-rm -f Makefile config.status 
