pull up r24469, r24530, r24533, r24534, r24535, r24537 from trunk
[krb5.git] / src / lib / rpc / unit-test / Makefile.in
1 mydir=lib$(S)rpc$(S)unit-test
2 BUILDTOP=$(REL)..$(S)..$(S)..
3 LOCALINCLUDES = -I.
4 PROG_LIBPATH=-L$(TOPLIBD)
5 PROG_RPATH=$(KRB5_LIBDIR)
6 DEFS=
7
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
10
11 all:: client server
12
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)
16
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)
20
21 client.o server.o: rpc_test.h
22
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
32
33 # clean::
34 #       rm -f rpc_test.h rpc_test_clnt.c rpc_test_svc.c
35
36
37 check unit-test:: unit-test-@DO_TEST@
38
39 unit-test-:
40         @echo "+++"
41         @echo "+++ WARNING: lib/rpc unit tests not run."
42         @echo "+++ Either tcl, runtest, or Perl is unavailable."
43         @echo "+++"
44
45 unit-test-ok:: unit-test-body
46
47 PASS=@PASS@
48 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 ; \
53         if $(ENV_SETUP) \
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) ; \
59         then \
60                 echo Cleaning up... ; \
61                 rm -f $$RPC_TEST_SRVTAB krb5cc_rpc_test_* ; \
62                 $(ENV_SETUP) $(STOP_SERVERS) ; \
63                 trap 0 ; exit 0 ; \
64         else exit 1 ; fi
65
66 clean::
67         $(RM) server client
68         $(RM) dbg.log rpc_test.log rpc_test.sum
69