# 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 = ${srcdir}/../../src/rx
VICED=@TOP_OBJDIR@/src/viced
FSINT=@TOP_OBJDIR@/src/fsint
OSI=@TOP_OBJDIR@/src/osi

MODULE_CFLAGS=-DNINTERFACE -DRXDEBUG -DFSSYNC_BUILD_SERVER \
	      -DSALVSYNC_BUILD_CLIENT -I${RX} ${OSI_XCFLAGS} \
	      -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}/libopr.a \
     $(top_builddir)/src/util/liboafs_util.la

all: xmpl_driver

CFLAGS_rx_pthread.o = -DDPF_FSLOG

rx_pthread.o: ${RX}/rx_pthread.c
	$(AFS_CCRULE) $(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
	$(AFS_CCRULE) ${FSINT}/afsaux.c
afscbint.ss.o: ${FSINT}/afscbint.ss.c
	$(AFS_CCRULE) ${FSINT}/afscbint.ss.c
afsint.cs.o: ${FSINT}/afsint.cs.c
	$(AFS_CCRULE) ${FSINT}/afsint.cs.c
afsint.ss.o: ${FSINT}/afsint.ss.c
	$(AFS_CCRULE) ${FSINT}/afsint.ss.c
afsint.xdr.o: ${FSINT}/afsint.xdr.c
	$(AFS_CCRULE) ${FSINT}/afsint.xdr.c
afscbint.xdr.o: ${FSINT}/afscbint.xdr.c
	$(AFS_CCRULE) ${FSINT}/afscbint.xdr.c

xmpl_driver: librpc_test_lib.a rpc_test_main.o ${LIBS}
	$(LT_LDRULE_static) rpc_test_main.o librpc_test_lib.a \
		${LIBS} ${LIB_hcrypto} ${MT_LIBS}

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

install:

dest:

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

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