1 mydir=lib$(S)rpc$(S)unit-test
2 BUILDTOP=$(REL)..$(S)..$(S)..
4 PROG_LIBPATH=-L$(TOPLIBD)
5 PROG_RPATH=$(KRB5_LIBDIR)
8 OBJS= client.o rpc_test_clnt.o rpc_test_svc.o server.o
9 SRCS= client.c rpc_test_clnt.c rpc_test_svc.c server.c
13 client: client.o rpc_test_clnt.o $(GSSRPC_DEPLIBS) $(KRB5_BASE_DEPLIBS)
14 $(CC_LINK) -o client client.o rpc_test_clnt.o \
15 $(GSSRPC_LIBS) $(KRB5_BASE_LIBS)
17 server: server.o rpc_test_svc.o $(GSSRPC_DEPLIBS) $(KRB5_BASE_DEPLIBS)
18 $(CC_LINK) -o server server.o rpc_test_svc.o \
19 $(GSSRPC_LIBS) $(KRB5_BASE_LIBS)
21 client.o server.o: rpc_test.h
23 # If rpc_test.h and rpc_test_*.c do not work on your system, you can
24 # try using rpcgen by uncommenting these lines (be sure to uncomment
25 # then in the generated not Makefile.in).
26 # rpc_test.h rpc_test_clnt.c rpc_test_svc.c: rpc_test.x
27 # -rm -f rpc_test_clnt.c rpc_test_svc.c rpc_test.h
28 # -ln -s $(srcdir)/rpc_test.x .
29 # rpcgen -l rpc_test.x -o rpc_test_clnt.c
30 # rpcgen -m rpc_test.x -o rpc_test_svc.c
31 # rpcgen -h rpc_test.x -o rpc_test.h
34 # rm -f rpc_test.h rpc_test_clnt.c rpc_test_svc.c
37 check unit-test:: unit-test-@DO_TEST@
41 @echo "+++ WARNING: lib/rpc unit tests not run."
42 @echo "+++ Either tcl, runtest, or Perl is unavailable."
45 unit-test-ok:: unit-test-body
49 $(RM) krb5cc_rpc_test_*
50 $(ENV_SETUP) $(VALGRIND) $(START_SERVERS)
51 RPC_TEST_SRVTAB=/tmp/rpc_test_v5srvtab.$$$$ ; export RPC_TEST_SRVTAB ; \
52 trap "echo Failed, cleaning up... ; rm -f $$RPC_TEST_SRVTAB ; $(ENV_SETUP) $(STOP_SERVERS) ; trap '' 0 ; exit 1" 0 1 2 3 14 15 ; \
54 $(RUNTEST) SERVER=./server CLIENT=./client \
55 KINIT=$(BUILDTOP)/clients/kinit/kinit \
56 KDESTROY=$(BUILDTOP)/clients/kdestroy/kdestroy \
57 PRIOCNTL_HACK=@PRIOCNTL_HACK@ VALGRIND="$(VALGRIND)" \
58 PASS="$(PASS)" --tool rpc_test $(RUNTESTFLAGS) ; \
60 echo Cleaning up... ; \
61 rm -f $$RPC_TEST_SRVTAB krb5cc_rpc_test_* ; \
62 $(ENV_SETUP) $(STOP_SERVERS) ; \
68 $(RM) dbg.log rpc_test.log rpc_test.sum