summaryrefslogtreecommitdiffstats
path: root/src/lib/rpc/unit-test/Makefile.in
blob: 26c10c79d393a5fb0aed972068883dff25024cc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
CFLAGS	= $(CCOPTS) $(DEFS) $(LOCALINCLUDE) -I.

OBJS= client.o rpc_test_clnt.o rpc_test_svc.o server.o

all:: client server

client: client.o rpc_test_clnt.o $(DEPLIBS)
	$(LD) $(LDFLAGS) $(LDARGS) -o client client.o rpc_test_clnt.o $(LIBS)

server: server.o rpc_test_svc.o $(DEPLIBS)
	$(LD) $(LDFLAGS) $(LDARGS) -o server server.o rpc_test_svc.o $(LIBS)

client.o server.o: rpc_test.h

# If rpc_test.h and rpc_test_*.c do not work on your system, you can
# try using rpcgen by uncommenting these lines (be sure to uncomment
# then in the generated not Makefile.in).
# rpc_test.h rpc_test_clnt.c rpc_test_svc.c: rpc_test.x
# 	-rm -f rpc_test_clnt.c rpc_test_svc.c rpc_test.h
# 	-ln -s $(srcdir)/rpc_test.x .
# 	rpcgen -l rpc_test.x -o rpc_test_clnt.c
# 	rpcgen -m rpc_test.x -o rpc_test_svc.c
# 	rpcgen -h rpc_test.x -o rpc_test.h
# 
# clean::
# 	rm -f rpc_test.h rpc_test_clnt.c rpc_test_svc.c
# 

check unit-test:: unit-test-@DO_TEST@

unit-test-:
	@echo "+++"
	@echo "+++ WARNING: lib/rpc unit tests not run."
	@echo "+++ Either tcl, runtest, or Perl is unavailable."
	@echo "+++"

unit-test-ok:: unit-test-setup unit-test-body unit-test-cleanup

unit-test-body:: unit-test-body-tcp unit-test-body-udp

unit-test-body-tcp:
	RPC_TEST_SRVTAB=/tmp/rpc_test_v5srvtab $(ENV_SETUP) \
		$(RUNTEST) SERVER=./server CLIENT=./client \
		KINIT=$(BUILDTOP)/clients/kinit/kinit \
		KDESTROY=$(BUILDTOP)/clients/kdestroy/kdestroy \
		PROT=-t --tool rpc_test

unit-test-body-udp:
	RPC_TEST_SRVTAB=/tmp/rpc_test_v5srvtab $(ENV_SETUP) \
		$(RUNTEST) SERVER=./server CLIENT=./client \
		KINIT=$(BUILDTOP)/clients/kinit/kinit \
		KDESTROY=$(BUILDTOP)/clients/kdestroy/kdestroy \
		PROT=-u --tool rpc_test

unit-test-setup::
	$(ENV_SETUP) $(START_SERVERS)
	RPC_TEST_SRVTAB=/tmp/rpc_test_v5srvtab $(ENV_SETUP) $(srcdir)/rpc_test_setup.sh

unit-test-cleanup::
	$(ENV_SETUP) $(STOP_SERVERS)
	-rm -f /tmp/rpc_test_v5srvtab /tmp/krb5cc_rpc_test_fullrun

clean::
	$(RM) server client
	$(RM) dbg.log rpc_test.log rpc_test.sum