#### include configury here
BUILDTOP=../..
SRCS=rcp.c rlogin.c rlogind.c rsh.c rshd.c kcmd.c login.c logutil.c
CODE=${SRCS} 

all:: rsh rcp rlogin crlogin kshd klogind login.krb

clean::
	$(RM) rsh rcp rlogin kshd klogind login.krb
	$(RM) *.o

RSH=	-DKRB_RLOGIN=\"$(PROGDIR)/rlogin\"

DEFINES= $(RSH) $(RPROGS) $(SITE_LOGIN_CDEFS) \
	-DLOGIN_PROGRAM=\"$(DAEMDIR)/login.krb\" -DKPROGDIR=\"$(PROGDIR)\"


#program(rsh,rsh.o kcmd.o,${KSTREAM_LIBDEP} ${KRB_LIBDEP} ${DES_LIBDEP},${KSTREAM_LIB} ${KRB_LIB} ${DES_LIB},${PROGDIR})
rsh: rsh.o kcmd.o  ${KSTREAM_LIBDEP} ${KRB_LIBDEP} ${DES_LIBDEP}
	$(CC) $(CFLAGS) -o $@ rsh.o kcmd.o ${KSTREAM_LIB} ${KRB_LIB} ${DES_LIB}

#program(rcp,rcp.o kcmd.o,${KSTREAM_LIBDEP} ${KRB_LIBDEP} ${DES_LIBDEP},${KSTREAM_LIB} ${KRB_LIB} ${DES_LIB},${PROGDIR})
rcp: rcp.o kcmd.o  ${KSTREAM_LIBDEP} ${KRB_LIBDEP} ${DES_LIBDEP}
	$(CC) $(CFLAGS) -o $@ rcp.o kcmd.o ${KSTREAM_LIB} ${KRB_LIB} ${DES_LIB}

#program(rlogin,rlogin.o kcmd.o,${KSTREAM_LIBDEP} ${KRB_LIBDEP} ${DES_LIBDEP},${KSTREAM_LIB} ${KRB_LIB} ${DES_LIB},${PROGDIR})
rlogin: rlogin.o kcmd.o  ${KSTREAM_LIBDEP} ${KRB_LIBDEP} ${DES_LIBDEP}
	$(CC) $(CFLAGS) -o $@ rlogin.o kcmd.o ${KSTREAM_LIB} ${KRB_LIB} ${DES_LIB}

#program(kshd,rshd.o,${KSTREAM_LIBDEP} ${KRB_LIBDEP} ${DES_LIBDEP},${KSTREAM_LIB} ${KRB_LIB} ${DES_LIB},${DAEMDIR})
kshd: rshd.o  ${KSTREAM_LIBDEP} ${KRB_LIBDEP} ${DES_LIBDEP}
	$(CC) $(CFLAGS) -o $@ rshd.o ${KSTREAM_LIB} ${KRB_LIB} ${DES_LIB}

#program(klogind,rlogind.o logutil.o,${KSTREAM_LIBDEP} ${KRB_LIBDEP} ${DES_LIBDEP},${KSTREAM_LIB} ${KRB_LIB} ${DES_LIB},${DAEMDIR})
klogind: rlogind.o logutil.o ${KSTREAM_LIBDEP} ${KRB_LIBDEP} ${DES_LIBDEP}
	$(CC) $(CFLAGS) -o $@ rlogind.o logutil.o ${KSTREAM_LIB} ${KRB_LIB} ${DES_LIB}

#program(login.krb,login.o logutil.o,${KRB_LIBDEP} ${DES_LIBDEP},${KRB_LIB} ${DES_LIB},${DAEMDIR})
login.krb: login.o logutil.o ${KRB_LIBDEP} ${DES_LIBDEP}
	$(CC) $(CFLAGS) -o $@ login.o logutil.o ${KRB_LIB} ${DES_LIB} ${HESIOD_LIB} ${LOGINLIBS}

crlogin: rlogin
	 -rm crlogin
	 ln rlogin crlogin

install::
	$(INSTALLPROG) rsh ${DESTDIR}$(PROGDIR)/rsh
	-$(INSTALLPROG) -o root -m 4755 rcp ${DESTDIR}$(PROGDIR)/rcp
	$(INSTALLPROG) rlogin ${DESTDIR}$(PROGDIR)/rlogin
	$(INSTALLPROG) kshd ${DESTDIR}$(DAEMDIR)/kshd
	$(INSTALLPROG) klogind ${DESTDIR}$(DAEMDIR)/klogind
	$(INSTALLPROG) login.krb ${DESTDIR}$(DAEMDIR)/login.krb
