BSD 4_4 release
[unix-history] / usr / src / lib / librpc / rpcsvc / Makefile
CommitLineData
ad787160
C
1#
2# @(#)Makefile 2.3 88/08/11 4.0 RPCSRC
3#
4#
5RPCCOM = rpcgen
6LIB = -lrpclib
7
8DESTDIR=
9CFLAGS= -O
10LDFLAGS=
11
12HDRS= klm_prot.h mount.h nfs_prot.h nlm_prot.h rex.h rquota.h rnusers.h\
13 rquota.h rstat.h sm_inter.h spray.h yppasswd.h yp.h
14XFILES= bootparam_prot.x klm_prot.x mount.x nfs_prot.x nlm_prot.x \
15 rex.x rnusers.x rquota.x rstat.x sm_inter.x spray.x yppasswd.x yp.x
16BIN= rstat
17SVCBIN= rstat_svc
18GEN= rstat_clnt.c rstat_svc.c rstat_xdr.c
19
20all: $(HDRS) $(BIN) $(SVCBIN)
21
22install: $(HDRS) $(XFILES)
23 @echo "Creating RPC service headers directory"
24 -mkdir ${DESTDIR}/usr/include/rpcsvc && \
25 chown bin ${DESTDIR}/usr/include/rpcsvc && \
26 chmod 755 ${DESTDIR}/usr/include/rpcsvc
27 @echo "Installing RPC service header and definition files"
28 for i in $(HDRS) $(XFILES); do \
29 (install -c -m 644 $$i ${DESTDIR}/usr/include/rpcsvc) done
30 -mkdir ${DESTDIR}/etc && chown bin ${DESTDIR}/etc && \
31 chmod 755 ${DESTDIR}/etc
32 @echo "Installing ${SVCBIN} in ${DESTDIR}/etc"
33 @set -x;for i in ${SVCBIN}; do \
34 (install -c -s $$i ${DESTDIR}/etc/$$i); done
35 @echo "Installing ${BIN} in ${DESTDIR}/usr/bin"
36 @set -x;for i in ${BIN}; do \
37 (install -c -s $$i ${DESTDIR}/usr/bin/$$i); done
38
39rstat_svc: rstat_proc.o rstat_svc.o rstat_xdr.o
40 $(CC) $(LDFLAGS) -o $@ rstat_proc.o rstat_svc.o rstat_xdr.o $(LIB)
41
42rstat: rstat.o rstat_clnt.o rstat_xdr.o
43 $(CC) $(LDFLAGS) -o $@ rstat.o rstat_clnt.o rstat_xdr.o $(LIB)
44
45rstat.c rstat_proc.c: rstat.h
46
47klm_prot.h: klm_prot.x
48 $(RPCCOM) -h klm_prot.x -o $@
49mount.h: mount.x
50 $(RPCCOM) -h mount.x -o $@
51nfs_prot.h: nfs_prot.x
52 $(RPCCOM) -h nfs_prot.x -o $@
53nlm_prot.h: nlm_prot.x
54 $(RPCCOM) -h nlm_prot.x -o $@
55rex.h: rex.x
56 $(RPCCOM) -h rex.x -o $@
57rnusers.h: rnusers.x
58 $(RPCCOM) -h rnusers.x -o $@
59rquota.h: rquota.x
60 $(RPCCOM) -h rquota.x -o $@
61rstat.h: rstat.x
62 $(RPCCOM) -h rstat.x -o $@
63sm_inter.h: sm_inter.x
64 $(RPCCOM) -h sm_inter.x -o $@
65spray.h: spray.x
66 $(RPCCOM) -h spray.x -o $@
67yp.h: yp.x
68 $(RPCCOM) -h yp.x -o $@
69yppasswd.h: yppasswd.x
70 $(RPCCOM) -h yppasswd.x -o $@
71
72rstat_clnt.c: rstat.x
73 $(RPCCOM) -l rstat.x -o $@
74rstat_svc.c: rstat.x
75 $(RPCCOM) -s udp rstat.x -o $@
76rstat_xdr.c: rstat.x
77 $(RPCCOM) -c rstat.x -o $@
78
79clean cleanup:
80 rm -f *.o $(GEN) $(BIN) $(SVCBIN)