#
# This Makefile in in the public domain
#

srcdir=@srcdir@
include @TOP_OBJDIR@/src/config/Makefile.config

OPTMZ = @KRB5CFLAGS@ -DALLOW_REGISTER
AKLIBS = ${LIBS} @KRB5LIBS@
AFSLIBS = ${TOP_LIBDIR}/libprot.a ${TOP_LIBDIR}/libubik.a \
	  ${TOP_LIBDIR}/libauth.a ${TOP_LIBDIR}/librxkad.a \
	  ${TOP_LIBDIR}/librx.a ${TOP_LIBDIR}/liblwp.a \
	  ${TOP_LIBDIR}/libsys.a ${TOP_LIBDIR}/libdes.a \
	  ${TOP_LIBDIR}/libafsutil.a

SRCS=	aklog.c aklog_main.c  krb_util.c linked_list.c
OBJS=   aklog.o aklog_main.o krb_util.o linked_list.o

all: aklog @ASETKEY@

aklog:	${OBJS} ${AFSLIBS}
	${CC} -o $@ ${CFLAGS} ${OBJS} ${AKLIBS} ${AFSLIBS} ${XLIBS}

asetkey: asetkey.o ${AFSLIBS}
	${CC} -o $@ ${CFLAGS} asetkey.o ${AKLIBS} ${AFSLIBS} ${XLIBS}

#
# Installation targets
#
install: \
	${DESTDIR}${bindir}/aklog ${DESTDIR}${afssrvbindir}/asetkey

${DESTDIR}${bindir}/aklog: aklog
	${INSTALL} $? $@

${DESTDIR}${afssrvbindir}/asetkey: @ASETKEY@
	if test "x@ASETKEY@" != "x"; then ${INSTALL} $? $@; fi

dest: \
	${DEST}/bin/aklog ${DEST}/root.server/usr/afs/bin/asetkey

${DEST}/bin/aklog: aklog
	${INSTALL} $? $@

${DEST}/root.server/usr/afs/bin/asetkey: @ASETKEY@
	if test "x@ASETKEY@" != "x"; then ${INSTALL} $? $@; fi

#
# Misc. targets
#
clean:
	$(RM) -f *.o ${OBJS} aklog asetkey

include ../config/Makefile.version

