thisconfigdir=.
myfulldir=kdc
mydir=.
BUILDTOP=$(REL)..
# -DUSE_RCACHE - enable replay cache for KDC
# -DNOCACHE    - disable lookaside cache, which is used to resend previous
#                response to replay (i.e., *don't* define this if you
#                define USE_RCACHE)
# These are now set in configure.in.
DEFINES = # -DNOCACHE
RUN_SETUP = @KRB5_RUN_ENV@
PROG_LIBPATH=-L$(TOPLIBD) $(KRB4_LIBPATH)
PROG_RPATH=$(KRB5_LIBDIR)
FAKEKA=@FAKEKA@

all:: krb5kdc rtest $(FAKEKA)

# DEFINES = -DBACKWARD_COMPAT $(KRB4DEF)

LOCALINCLUDES = @KRB4_INCLUDES@ -I.
SRCS= \
	kdc5_err.c \
	$(srcdir)/dispatch.c \
	$(srcdir)/do_as_req.c \
	$(srcdir)/do_tgs_req.c \
	$(srcdir)/kdc_util.c \
	$(srcdir)/kdc_preauth.c \
	$(SRCTOP)/lib/kadm5/logger.c \
	$(srcdir)/main.c \
	$(srcdir)/network.c \
	$(srcdir)/policy.c \
	$(srcdir)/extern.c \
	$(srcdir)/replay.c \
	$(srcdir)/kerberos_v4.c

OBJS= \
	kdc5_err.o \
	dispatch.o \
	do_as_req.o \
	do_tgs_req.o \
	kdc_util.o \
	kdc_preauth.o \
	logger.o \
	main.o \
	network.o \
	policy.o \
	extern.o \
	replay.o \
	kerberos_v4.o

RT_OBJS= rtest.o \
	kdc_util.o \
	policy.o \
	extern.o

depend:: kdc5_err.c

logger.c: $(SRCTOP)/lib/kadm5/logger.c
	$(RM) $@
	$(CP) $(SRCTOP)/lib/kadm5/logger.c $@

logger.o: logger.c

kdc5_err.c: kdc5_err.et

kdc5_err.h: kdc5_err.et

kdc5_err.o: kdc5_err.h

krb5kdc: $(OBJS) $(KADMSRV_DEPLIBS) $(KRB4COMPAT_DEPLIBS)
	$(CC_LINK) -o krb5kdc $(OBJS) $(KADMSRV_LIBS) $(KRB4COMPAT_LIBS)

rtest: $(RT_OBJS) $(KDB5_DEPLIBS) $(KADM_COMM_DEPLIBS) $(KRB5_BASE_DEPLIBS)
	$(CC_LINK) -o rtest $(RT_OBJS) $(KDB5_LIBS) $(KADM_COMM_LIBS) $(KRB5_BASE_LIBS)

fakeka: fakeka.o $(KADMSRV_DEPLIBS) $(KRB4COMPAT_DEPLIBS)
	$(CC_LINK) -o fakeka fakeka.o $(KADMSRV_LIBS) $(KRB4COMPAT_LIBS)

check-unix:: rtest
	KRB5_CONFIG=$(SRCTOP)/config-files/krb5.conf ; export KRB5_CONFIG ;\
	$(RUN_SETUP) $(srcdir)/rtscript > test.out
	cmp test.out $(srcdir)/rtest.good
	$(RM) test.out

install::
	$(INSTALL_PROGRAM) krb5kdc ${DESTDIR}$(SERVER_BINDIR)/krb5kdc
	$(INSTALL_DATA) $(srcdir)/krb5kdc.M ${DESTDIR}$(SERVER_MANDIR)/krb5kdc.8
	f=$(FAKEKA); \
	if test -n "$$f" ; then \
		$(INSTALL_PROGRAM) $$f ${DESTDIR}$(SERVER_BINDIR)/$$f; \
	fi

clean::
	$(RM) kdc5_err.h kdc5_err.c krb5kdc logger.c rtest.o rtest

# +++ Dependency line eater +++
# 
# Makefile dependencies follow.  This must be the last section in
# the Makefile.in file
#
$(OUTPRE)kdc5_err.$(OBJEXT): kdc5_err.c $(COM_ERR_DEPS)
$(OUTPRE)dispatch.$(OBJEXT): dispatch.c $(SRCTOP)/include/k5-int.h \
  $(BUILDTOP)/include/krb5/osconf.h $(BUILDTOP)/include/krb5/autoconf.h \
  $(BUILDTOP)/include/krb5.h $(COM_ERR_DEPS) $(BUILDTOP)/include/profile.h \
  $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
  $(SRCTOP)/include/krb5/kdb.h $(SRCTOP)/include/syslog.h \
  kdc_util.h extern.h $(SRCTOP)/include/krb5/adm_proto.h
$(OUTPRE)do_as_req.$(OBJEXT): do_as_req.c $(SRCTOP)/include/k5-int.h \
  $(BUILDTOP)/include/krb5/osconf.h $(BUILDTOP)/include/krb5/autoconf.h \
  $(BUILDTOP)/include/krb5.h $(COM_ERR_DEPS) $(BUILDTOP)/include/profile.h \
  $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
  $(SRCTOP)/include/krb5/kdb.h $(SRCTOP)/include/syslog.h \
  kdc_util.h policy.h $(SRCTOP)/include/krb5/adm.h $(SRCTOP)/include/krb5/adm_proto.h \
  extern.h
$(OUTPRE)do_tgs_req.$(OBJEXT): do_tgs_req.c $(SRCTOP)/include/k5-int.h \
  $(BUILDTOP)/include/krb5/osconf.h $(BUILDTOP)/include/krb5/autoconf.h \
  $(BUILDTOP)/include/krb5.h $(COM_ERR_DEPS) $(BUILDTOP)/include/profile.h \
  $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
  $(SRCTOP)/include/krb5/kdb.h $(SRCTOP)/include/syslog.h \
  kdc_util.h policy.h extern.h $(SRCTOP)/include/krb5/adm_proto.h
$(OUTPRE)kdc_util.$(OBJEXT): kdc_util.c $(SRCTOP)/include/k5-int.h \
  $(BUILDTOP)/include/krb5/osconf.h $(BUILDTOP)/include/krb5/autoconf.h \
  $(BUILDTOP)/include/krb5.h $(COM_ERR_DEPS) $(BUILDTOP)/include/profile.h \
  $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
  $(SRCTOP)/include/krb5/kdb.h kdc_util.h extern.h $(SRCTOP)/include/syslog.h \
  $(SRCTOP)/include/krb5/adm.h $(SRCTOP)/include/krb5/adm_proto.h
$(OUTPRE)kdc_preauth.$(OBJEXT): kdc_preauth.c $(SRCTOP)/include/k5-int.h \
  $(BUILDTOP)/include/krb5/osconf.h $(BUILDTOP)/include/krb5/autoconf.h \
  $(BUILDTOP)/include/krb5.h $(COM_ERR_DEPS) $(BUILDTOP)/include/profile.h \
  $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
  $(SRCTOP)/include/krb5/kdb.h kdc_util.h extern.h $(SRCTOP)/include/krb5/adm_proto.h \
  $(SRCTOP)/include/syslog.h
$(OUTPRE)logger.$(OBJEXT): $(SRCTOP)/lib/kadm5/logger.c \
  $(SRCTOP)/include/k5-int.h $(BUILDTOP)/include/krb5/osconf.h \
  $(BUILDTOP)/include/krb5/autoconf.h $(BUILDTOP)/include/krb5.h \
  $(COM_ERR_DEPS) $(BUILDTOP)/include/profile.h $(SRCTOP)/include/port-sockets.h \
  $(SRCTOP)/include/socket-utils.h $(SRCTOP)/include/krb5/kdb.h \
  $(SRCTOP)/include/krb5/adm_proto.h $(SRCTOP)/include/syslog.h
$(OUTPRE)main.$(OBJEXT): main.c $(SRCTOP)/include/syslog.h \
  $(SRCTOP)/include/k5-int.h $(BUILDTOP)/include/krb5/osconf.h \
  $(BUILDTOP)/include/krb5/autoconf.h $(BUILDTOP)/include/krb5.h \
  $(COM_ERR_DEPS) $(BUILDTOP)/include/profile.h $(SRCTOP)/include/port-sockets.h \
  $(SRCTOP)/include/socket-utils.h $(SRCTOP)/include/krb5/kdb.h \
  $(SRCTOP)/include/krb5/adm.h $(SRCTOP)/include/krb5/adm_proto.h \
  kdc_util.h extern.h kdc5_err.h $(SRCTOP)/include/krb5/kdb_kt.h \
  $(SRCTOP)/include/kerberosIV/des.h
$(OUTPRE)network.$(OBJEXT): network.c $(SRCTOP)/include/k5-int.h \
  $(BUILDTOP)/include/krb5/osconf.h $(BUILDTOP)/include/krb5/autoconf.h \
  $(BUILDTOP)/include/krb5.h $(COM_ERR_DEPS) $(BUILDTOP)/include/profile.h \
  $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
  $(SRCTOP)/include/krb5/kdb.h kdc_util.h extern.h kdc5_err.h \
  $(SRCTOP)/include/krb5/adm_proto.h $(SRCTOP)/include/syslog.h \
  $(SRCTOP)/include/fake-addrinfo.h $(SRCTOP)/include/cm.h \
  $(SRCTOP)/include/foreachaddr.c
$(OUTPRE)policy.$(OBJEXT): policy.c $(SRCTOP)/include/k5-int.h \
  $(BUILDTOP)/include/krb5/osconf.h $(BUILDTOP)/include/krb5/autoconf.h \
  $(BUILDTOP)/include/krb5.h $(COM_ERR_DEPS) $(BUILDTOP)/include/profile.h \
  $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
  $(SRCTOP)/include/krb5/kdb.h kdc_util.h
$(OUTPRE)extern.$(OBJEXT): extern.c $(SRCTOP)/include/k5-int.h \
  $(BUILDTOP)/include/krb5/osconf.h $(BUILDTOP)/include/krb5/autoconf.h \
  $(BUILDTOP)/include/krb5.h $(COM_ERR_DEPS) $(BUILDTOP)/include/profile.h \
  $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
  $(SRCTOP)/include/krb5/kdb.h extern.h
$(OUTPRE)replay.$(OBJEXT): replay.c $(SRCTOP)/include/k5-int.h \
  $(BUILDTOP)/include/krb5/osconf.h $(BUILDTOP)/include/krb5/autoconf.h \
  $(BUILDTOP)/include/krb5.h $(COM_ERR_DEPS) $(BUILDTOP)/include/profile.h \
  $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
  $(SRCTOP)/include/krb5/kdb.h kdc_util.h extern.h
$(OUTPRE)kerberos_v4.$(OBJEXT): kerberos_v4.c $(SRCTOP)/include/k5-int.h \
  $(BUILDTOP)/include/krb5/osconf.h $(BUILDTOP)/include/krb5/autoconf.h \
  $(BUILDTOP)/include/krb5.h $(COM_ERR_DEPS) $(BUILDTOP)/include/profile.h \
  $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
  $(SRCTOP)/include/krb5/kdb.h kdc_util.h $(SRCTOP)/include/krb5/adm_proto.h \
  $(SRCTOP)/include/syslog.h $(SRCTOP)/include/kerberosIV/krb.h \
  $(SRCTOP)/include/kerberosIV/des.h $(KRB_ERR_H_DEP) \
  $(SRCTOP)/include/kerberosIV/klog.h $(SRCTOP)/include/kerberosIV/prot.h \
  $(SRCTOP)/include/kerberosIV/krb_db.h $(SRCTOP)/include/kerberosIV/kdc.h \
  extern.h

