Imported Upstream version 1.15.1
[platform/upstream/krb5.git] / src / lib / rpc / unit-test / Makefile.in
1 mydir=lib$(S)rpc$(S)unit-test
2 BUILDTOP=$(REL)..$(S)..$(S)..
3
4 OBJS= client.o rpc_test_clnt.o rpc_test_svc.o server.o
5 SRCS= client.c rpc_test_clnt.c rpc_test_svc.c server.c
6
7 all: client server
8
9 client: client.o rpc_test_clnt.o $(GSSRPC_DEPLIBS) $(KRB5_BASE_DEPLIBS)
10         $(CC_LINK) -o client client.o rpc_test_clnt.o \
11                 $(GSSRPC_LIBS) $(KRB5_BASE_LIBS)
12
13 server: server.o rpc_test_svc.o $(GSSRPC_DEPLIBS) $(KRB5_BASE_DEPLIBS)
14         $(CC_LINK) -o server server.o rpc_test_svc.o \
15                 $(GSSRPC_LIBS) $(KRB5_BASE_LIBS)
16
17 client.o server.o: rpc_test.h
18
19 # If rpc_test.h and rpc_test_*.c do not work on your system, you can
20 # try using rpcgen by uncommenting these lines (be sure to uncomment
21 # then in the generated not Makefile.in).
22 # rpc_test.h rpc_test_clnt.c rpc_test_svc.c: rpc_test.x
23 #       -rm -f rpc_test_clnt.c rpc_test_svc.c rpc_test.h
24 #       -ln -s $(srcdir)/rpc_test.x .
25 #       rpcgen -l rpc_test.x -o rpc_test_clnt.c
26 #       rpcgen -m rpc_test.x -o rpc_test_svc.c
27 #       rpcgen -h rpc_test.x -o rpc_test.h
28
29 # clean:
30 #       rm -f rpc_test.h rpc_test_clnt.c rpc_test_svc.c
31
32
33 check unit-test: unit-test-@DO_TEST@
34
35 unit-test-:
36         @echo "+++"
37         @echo "+++ WARNING: lib/rpc unit tests not run."
38         @echo "+++ Either tcl, runtest, or Perl is unavailable."
39         @echo "+++"
40         @echo 'Skipped rpc tests: runtest or Perl not found' >> $(SKIPTESTS)
41
42 unit-test-ok: unit-test-body
43
44 PASS=@PASS@
45 unit-test-body:
46         $(RM) krb5cc_rpc_test_*
47         $(ENV_SETUP) $(VALGRIND) $(START_SERVERS)
48         RPC_TEST_SRVTAB=/tmp/rpc_test_v5srvtab.$$$$ ; export RPC_TEST_SRVTAB ; \
49         trap "echo Failed, cleaning up... ; rm -f $$RPC_TEST_SRVTAB ; $(ENV_SETUP) $(STOP_SERVERS) ; trap '' 0 ; exit 1" 0 1 2 3 14 15 ; \
50         if $(ENV_SETUP) \
51                 $(RUNTEST) SERVER=./server CLIENT=./client \
52                 KINIT=$(BUILDTOP)/clients/kinit/kinit \
53                 KDESTROY=$(BUILDTOP)/clients/kdestroy/kdestroy \
54                 PRIOCNTL_HACK=@PRIOCNTL_HACK@ VALGRIND="$(VALGRIND)" \
55                 PASS="$(PASS)" --tool rpc_test $(RUNTESTFLAGS) ; \
56         then \
57                 echo Cleaning up... ; \
58                 rm -f $$RPC_TEST_SRVTAB krb5cc_rpc_test_* ; \
59                 $(ENV_SETUP) $(STOP_SERVERS) ; \
60                 trap 0 ; exit 0 ; \
61         else exit 1 ; fi
62
63 clean:
64         $(RM) server client
65         $(RM) dbg.log rpc_test.log rpc_test.sum
66