1#	$NetBSD: bsd.rpc.mk,v 1.11 2004/05/12 16:38:01 christos Exp $
2
3.include <bsd.init.mk>
4
5RPC_XDIR?=	${.CURDIR}/
6
7# We don't use implicit suffix rules here to avoid dependencies in the
8# Installed files.
9
10.if defined(RPC_INCS)						# {
11
12.for I in ${RPC_INCS}
13${I}: ${I:.h=.x}
14	${_MKTARGET_CREATE}
15	${TOOL_RPCGEN} -C -h ${RPC_XDIR}${I:.h=.x} -o ${.TARGET}
16.endfor
17
18DPSRCS+=	${RPC_INCS}
19CLEANFILES+=	${RPC_INCS}
20
21.endif								# }
22
23
24.if defined(RPC_XDRFILES)					# {
25
26.for I in ${RPC_XDRFILES}
27${I}: ${RPC_XDIR}${I:_xdr.c=.x}
28	${_MKTARGET_CREATE}
29	${TOOL_RPCGEN} -C -c ${RPC_XDIR}${I:_xdr.c=.x} -o ${.TARGET}
30.endfor
31
32DPSRCS+=	${RPC_XDRFILES}
33CLEANFILES+=	${RPC_XDRFILES}
34
35.endif								# }
36
37
38.if defined(RPC_SVCFILES)					# {
39
40.for I in ${RPC_SVCCLASS}
41_RPCS += -s ${I}
42.endfor
43
44.for I in ${RPC_SVCFILES}
45
46${I}: ${RPC_XDIR}${I:_svc.c=.x}
47	${_MKTARGET_CREATE}
48	${TOOL_RPCGEN} -C ${_RPCS} ${RPC_SVCFLAGS} ${RPC_XDIR}${I:_svc.c=.x} \
49		-o ${.TARGET}
50.endfor
51
52DPSRCS+=	${RPC_SVCFILES}
53CLEANFILES+=	${RPC_SVCFILES}
54
55.endif								# }
56
57.if defined(RPC_CLNTFILES)					# {
58
59.for I in ${RPC_CLNTFILES}
60
61${I}: ${RPC_XDIR}${I:_clnt.c=.x}
62	${_MKTARGET_CREATE}
63	${TOOL_RPCGEN} -C -l ${_RPCS} ${RPC_CLNTFLAGS} \
64		${RPC_XDIR}${I:_clnt.c=.x} -o ${.TARGET}
65.endfor
66
67DPSRCS+=	${RPC_CLNTFILES}
68CLEANFILES+=	${RPC_CLNTFILES}
69
70.endif								# }
71
72##### Pull in related .mk logic
73.include <bsd.obj.mk>
74.include <bsd.sys.mk>
75.include <bsd.clean.mk>
76