# 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
#
# Portions Copyright (c) 2003 Apple Computer, Inc.

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


RTL=@TOP_OBJDIR@/tests/rpctestlib
RX=@TOP_OBJDIR@/src/rx
VICED=@TOP_OBJDIR@/src/viced
UTIL=@TOP_OBJDIR@/src/util
FSINT=@TOP_OBJDIR@/src/fsint
MCAS=@TOP_OBJDIR@/src/mcas
OSI=@TOP_OBJDIR@/src/osi

MODULE_CFLAGS=-DNINTERFACE -DRXDEBUG -DFSSYNC_BUILD_SERVER \
	      -DSALVSYNC_BUILD_CLIENT -I${RX} -I${MCAS} ${OSI_XCFLAGS} \
	      ${MCAS_CFLAGS} -DSUBSYS_LOG_MACRO=RTLLog

headers= ${RTL}/rpc_test_procs.h

RTLOBJS= rpc_test_procs.o rpc_test_cb_procs.o

FSINTOBJS= afsaux.o afscbint.ss.o afsint.cs.o afscbint.xdr.o \
	afsint.xdr.o

RXOBJS = rx_pthread.o

LIBOBJS= ${RTLOBJS} ${FSINTOBJS} ${RXOBJS}

LIBS=${TOP_LIBDIR}/libafsauthent.a ${TOP_LIBDIR}/libafsrpc.a ${TOP_LIBDIR}/util.a

all: xmpl_driver

CFLAGS_rx_pthread.o = -DDPF_FSLOG

rx_pthread.o: ${RX}/rx_pthread.c

rpc_test_main.o: ${RTL}/rpc_test_main.c ${headers}
rpc_test_procs.o: ${RTL}/rpc_test_procs.c ${headers}
rpc_test_cb_procs.o: ${RTL}/rpc_test_cb_procs.c ${headers}

CFLAGS_afsaux.o = -I{FSINT}
afsaux.o: ${FSINT}/afsaux.c
afscbint.ss.o: ${FSINT}/afscbint.ss.c
afsint.cs.o: ${FSINT}/afsint.cs.c
afsint.ss.o: ${FSINT}/afsint.ss.c
afsint.xdr.o: ${FSINT}/afsint.xdr.c
afscbint.xdr.o: ${FSINT}/afscbint.xdr.c

xmpl_driver: librpc_test_lib.a rpc_test_main.o ${LIBS}
	$(AFS_LDRULE) rpc_test_main.o librpc_test_lib.a \
		${LIBS} ${MT_LIBS} ${XLIBS}

librpc_test_lib.a: ${LIBOBJS}
	$(RM) -f $@
	$(AR) crv $@ ${LIBOBJS}
	$(RANLIB) $@

install:

dest:

clean:
	$(RM) -f *.o *.a *.gch xmpl_driver core

include @TOP_OBJDIR@/src/config/Makefile.version
