# 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

DEST=@DEST@
TOP_INCDIR=@TOP_INCDIR@
TOP_LIBDIR=@TOP_LIBDIR@
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
sbindir=@sbindir@
libexecdir=@libexecdir@
libdir=@libdir@
includedir=@includedir@
mandir=@mandir@
afssrvbindir=@afssrvbindir@
afssrvsbindir=@afssrvsbindir@
afssrvlibexecdir=@afssrvlibexecdir@
COMPILE_ET=${TOP_SRCDIR}/comerr/compile_et
RXGEN=${TOP_SRCDIR}/rxgen/rxgen
TOP_SRCDIR=@TOP_SRCDIR@
SYS_NAME=@AFS_SYSNAME@
MKAFS_OSTYPE=@MKAFS_OSTYPE@

SHELL = /bin/sh

include ../config/Makefile.${SYS_NAME}

KERNELDIR = ../libafs/
UKERNELDIR = ../libuafs/

CFLAGS=${OPTMZ} -I${TOP_SRCDIR}/config -I${TOP_INCDIR} -I${TOP_INCDIR}/rx -DRXDEBUG ${XCFLAGS}

LIBS=${TOP_LIBDIR}/librx.a ${TOP_LIBDIR}/liblwp.a ${TOP_LIBDIR}/libcmd.a \
	       ${TOP_LIBDIR}/util.a ${TOP_LIBDIR}/libsys.a

all: rxdebug rxdumptrace

rxdebug.o: rxdebug.c

rxdumptrace.o: ../rx/rx_trace.c
	$(CC) $(CFLAGS) -DDUMPTRACE -c -o rxdumptrace.o ../rx/rx_trace.c

rxdumptrace: rxdumptrace.o ${LIBS}
	$(RM) -f rxdumptrace
	$(CC) $(CFLAGS) -o rxdumptrace rxdumptrace.o  ${LIBS} ${XLIBS}

rxdebug: rxdebug.o ${LIBS}
	${CC} ${CFLAGS} -o $@ $@.o ${LIBS} ${XLIBS}

#
# Install targets
#
install:  ${DESTDIR}${sbindir}/rxdebug

#
# Misc. targets
#
clean:
	$(RM) -f *.o *.a core *_component_version_number.c rxdumptrace rxdebug

include ../config/Makefile.version

dest: ${DEST}/etc/rxdebug

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

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