# 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@

CFLAGS=${COMMON_CFLAGS} ${XCFLAGS} ${ARCHFLAGS}

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

all: rxdebug rxdumptrace

rxdebug.o: rxdebug.c

rxdumptrace.o: ../rx/rx_trace.c
	$(CC) $(CFLAGS) -DDUMPTRACE -c -o rxdumptrace.o ${srcdir}/../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: rxdebug
	${INSTALL} -d ${DESTDIR}${sbindir}
	${INSTALL_PROGRAM} rxdebug ${DESTDIR}${sbindir}/rxdebug

dest: rxdebug
	${INSTALL} -d ${DEST}/etc
	${INSTALL_PROGRAM} rxdebug ${DEST}/etc/rxdebug

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

include ../config/Makefile.version
