#### include configury here
BUILDTOP=..
SRCS=kinit.c kdestroy.c klist.c ksu.c ksrvtgt.c
CODE=${SRCS}
DEFINES="-DORGANIZATION=\"${ORGANIZATION}\""
LIBS= ${KRB_LIB} ${DES_LIB}
DEPLIBS= ${KRB_LIBDEP} ${DES_LIBDEP}

all:: kinit kdestroy klist ksu ksrvtgt

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

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

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

# suidprogram(ksu,ksu.o,${DEPLIBS},${LIBS},${PROGDIR})
ksu: ksu.o ${DEPLIBS}
	$(CC) $(CFLAGS) -o $@ ksu.o ${LIBS}

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

install::
	$(INSTALLPROG) kinit ${DESTDIR}$(PROGDIR)/kinit
	$(INSTALLPROG) kdestroy ${DESTDIR}$(PROGDIR)/kdestroy
	$(INSTALLPROG) klist ${DESTDIR}$(PROGDIR)/klist
	$(INSTALLPROG) ksrvtgt ${DESTDIR}$(PROGDIR)/ksrvtgt
	-$(INSTALLPROG) -o root -m 4755 ksu ${DESTDIR}$(PROGDIR)/ksu

clean::
	$(RM) kinit kdestroy klist ksu ksrvtgt *.o
