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

AFSLIBS =  ${TOP_LIBDIR}/libkauth.a ${TOP_LIBDIR}/libubik.a\
		   ${TOP_LIBDIR}/libauth.a ${TOP_LIBDIR}/libsys.a \
		   ${TOP_LIBDIR}/librx.a \
		   ${TOP_LIBDIR}/libsys.a \
		   ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/librxkad.a\
		   ${TOP_LIBDIR}/libdes.a ${TOP_LIBDIR}/libcmd.a \
		   ${TOP_LIBDIR}/libcom_err.a ${TOP_LIBDIR}/util.a 
LIBS = ${AFSLIBS} ${LIBRES} ${XLIBS}
OBJS = inetd.o setenv.o getenv.o

include ../config/Makefile.version

noversion: install

# ta-rauth.o is used by rlogin, rsh, rcp, rlogind
all : inetd ta-rauth.o

inetd: ${OBJS}
	set -x; \
	case "${SYS_NAME}" in \
	alpha_osf1 | alpha_osf20 |  alpha_osf30 | alpha_dux?? ) \
		${CC} ${CFLAGS} -o $@ ${OBJS} ${LIBS} -lutil ;; \
	*) \
		${CC} ${CFLAGS} -o $@ ${OBJS} ${LIBS} ;; \
	esac

inetd.o: inetd.c AFS_component_version_number.c
ta-rauth.o: ta-rauth.c

clean:
	$(RM) -f inetd *.o *.BAK *~ core AFS_component_version_number.c

install: ${DESTDIR}${sbindir}/inetd

dest: ${DEST}/etc/inetd
	set -x; \
	case "${SYS_NAME}" in \
	sun4* ) \
		${INSTALL} -m 644 -f inetd.conf.solaris ${DEST}/etc/inetd.conf ;; \
	sgi_* ) \
		${INSTALL} -m 644 -f inetd.conf.sgi ${DEST}/etc/inetd.conf ;; \
	alpha_dux?? ) \
		${INSTALL} -m 644 -f inetd.conf.dux40 ${DEST}/etc/inetd.conf ;; \
	* ) \
		${INSTALL} -m 644 inetd.conf ${DEST}/etc/inetd.conf ;; \
	esac

${DESTDIR}${sbindir}/inetd: inetd
	${INSTALL} $? $@

${DEST}/etc/inetd: inetd
	${INSTALL} $? $@
