# Copyright 2000, International Business Machines Corporation and others.
# All Rights Reserved.
# 
# This software has been released under the terms of the IBM Public
# License.  For details, see the LICENSE file in the top-level source
# directory or online at http://www.openafs.org/dl/license10.html

srcdir=@srcdir@
include @TOP_OBJDIR@/src/config/Makefile.config
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@

INCLS=${TOP_INCDIR}/ubik.h \
	${TOP_INCDIR}/lwp.h \
	${TOP_INCDIR}/lock.h  \
	${TOP_INCDIR}/rx/rx.h \
	${TOP_INCDIR}/rx/xdr.h \
	${TOP_INCDIR}/rx/rxkad.h \
	${TOP_INCDIR}/afs/com_err.h \
	${TOP_INCDIR}/afs/auth.h \
	${TOP_INCDIR}/afs/cellconfig.h \
	${TOP_INCDIR}/afs/cmd.h \
	${TOP_INCDIR}/afs/pterror.h \
	${TOP_INCDIR}/afs/kautils.h \
	${TOP_INCDIR}/afs/bnode.h \
	${TOP_INCDIR}/afs/vlserver.h

LIBS=${TOP_LIBDIR}/libubik.a \
	${TOP_LIBDIR}/librx.a \
	${TOP_LIBDIR}/liblwp.a \
	${TOP_LIBDIR}/libauth.a \
	${TOP_LIBDIR}/libsys.a \
	${TOP_LIBDIR}/librxkad.a \
	${TOP_LIBDIR}/libcmd.a \
	${TOP_LIBDIR}/libvldb.a \
	${TOP_LIBDIR}/libbos.a \
	${TOP_LIBDIR}/libafscom_err.a \
	${TOP_LIBDIR}/libvolser.a \
	${TOP_LIBDIR}/util.a \
	${TOP_LIBDIR}/libkauth.a \
	${TOP_LIBDIR}/libprot.a \
	${TOP_LIBDIR}/libdes.a \
	${XLIBS}

all: translate_et

translate_et: translate_et.o ${INCLS}
	${CC} ${LDFLAGS} -o translate_et translate_et.o ${LIBS}

translate_et.o: AFS_component_version_number.c

test: translate_et
	echo -n > /tmp/translate_et.output
	-./translate_et >> /tmp/translate_et.output 2>&1
	./translate_et 55 >> /tmp/translate_et.output
	./translate_et 110 >> /tmp/translate_et.output
	./translate_et 255 >> /tmp/translate_et.output
	./translate_et 256 >> /tmp/translate_et.output
	./translate_et -1 -451 >> /tmp/translate_et.output
	./translate_et 1613147 >> /tmp/translate_et.output
	./translate_et 19270407 >> /tmp/translate_et.output
	./translate_et 180511 >> /tmp/translate_et.output
	diff test.output /tmp/translate_et.output
	$(RM) /tmp/translate_et.output

#
# Install targets
#
install:
	${INSTALL} -d ${DESTDIR}${bindir}
	${INSTALL_PROGRAM} translate_et ${DESTDIR}${bindir}/translate_et

dest:
	${INSTALL} -d ${DEST}/bin
	${INSTALL_PROGRAM} translate_et ${DEST}/bin/translate_et


#
# Misc. targets
#

clean:
	$(RM) -f *.o translate_et core AFS_component_version_number.c

include ../config/Makefile.version
