xref: /minix3/share/mk/bsd.rpc.mk (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc#	$NetBSD: bsd.rpc.mk,v 1.13 2013/12/15 00:28:45 christos Exp $
29152e1c5SLionel Sambuc
39152e1c5SLionel Sambuc.include <bsd.init.mk>
49152e1c5SLionel Sambuc
59152e1c5SLionel SambucRPC_XDIR?=	${.CURDIR}/
6*0a6a1f1dSLionel SambucRPCGEN_FLAGS?=	-B
79152e1c5SLionel Sambuc
89152e1c5SLionel Sambuc# We don't use implicit suffix rules here to avoid dependencies in the
99152e1c5SLionel Sambuc# Installed files.
109152e1c5SLionel Sambuc
119152e1c5SLionel Sambuc.if defined(RPC_INCS)						# {
129152e1c5SLionel Sambuc
139152e1c5SLionel Sambuc.for I in ${RPC_INCS}
149152e1c5SLionel Sambuc${I}: ${I:.h=.x}
159152e1c5SLionel Sambuc	${_MKTARGET_CREATE}
16*0a6a1f1dSLionel Sambuc	${TOOL_RPCGEN} ${RPCGEN_FLAGS} -h ${RPC_XDIR}${I:.h=.x} -o ${.TARGET}
179152e1c5SLionel Sambuc.endfor
189152e1c5SLionel Sambuc
199152e1c5SLionel SambucDPSRCS+=	${RPC_INCS}
209152e1c5SLionel SambucCLEANFILES+=	${RPC_INCS}
219152e1c5SLionel Sambuc
229152e1c5SLionel Sambuc.endif								# }
239152e1c5SLionel Sambuc
249152e1c5SLionel Sambuc
259152e1c5SLionel Sambuc.if defined(RPC_XDRFILES)					# {
269152e1c5SLionel Sambuc
279152e1c5SLionel Sambuc.for I in ${RPC_XDRFILES}
289152e1c5SLionel Sambuc${I}: ${RPC_XDIR}${I:_xdr.c=.x}
299152e1c5SLionel Sambuc	${_MKTARGET_CREATE}
30*0a6a1f1dSLionel Sambuc	${TOOL_RPCGEN} ${RPCGEN_FLAGS} -c ${RPC_XDIR}${I:_xdr.c=.x} -o ${.TARGET}
319152e1c5SLionel Sambuc.endfor
329152e1c5SLionel Sambuc
339152e1c5SLionel SambucDPSRCS+=	${RPC_XDRFILES}
349152e1c5SLionel SambucCLEANFILES+=	${RPC_XDRFILES}
359152e1c5SLionel Sambuc
369152e1c5SLionel Sambuc.endif								# }
379152e1c5SLionel Sambuc
389152e1c5SLionel Sambuc
399152e1c5SLionel Sambuc.if defined(RPC_SVCFILES)					# {
409152e1c5SLionel Sambuc
419152e1c5SLionel Sambuc.for I in ${RPC_SVCCLASS}
429152e1c5SLionel Sambuc_RPCS += -s ${I}
439152e1c5SLionel Sambuc.endfor
449152e1c5SLionel Sambuc
459152e1c5SLionel Sambuc.for I in ${RPC_SVCFILES}
469152e1c5SLionel Sambuc
479152e1c5SLionel Sambuc${I}: ${RPC_XDIR}${I:_svc.c=.x}
489152e1c5SLionel Sambuc	${_MKTARGET_CREATE}
49*0a6a1f1dSLionel Sambuc	${TOOL_RPCGEN} ${RPCGEN_FLAGS} ${_RPCS} ${RPC_SVCFLAGS} ${RPC_XDIR}${I:_svc.c=.x} \
509152e1c5SLionel Sambuc		-o ${.TARGET}
519152e1c5SLionel Sambuc.endfor
529152e1c5SLionel Sambuc
539152e1c5SLionel SambucDPSRCS+=	${RPC_SVCFILES}
549152e1c5SLionel SambucCLEANFILES+=	${RPC_SVCFILES}
559152e1c5SLionel Sambuc
569152e1c5SLionel Sambuc.endif								# }
579152e1c5SLionel Sambuc
589152e1c5SLionel Sambuc.if defined(RPC_CLNTFILES)					# {
599152e1c5SLionel Sambuc
609152e1c5SLionel Sambuc.for I in ${RPC_CLNTFILES}
619152e1c5SLionel Sambuc
629152e1c5SLionel Sambuc${I}: ${RPC_XDIR}${I:_clnt.c=.x}
639152e1c5SLionel Sambuc	${_MKTARGET_CREATE}
64*0a6a1f1dSLionel Sambuc	${TOOL_RPCGEN} ${RPCGEN_FLAGS} -l ${_RPCS} ${RPC_CLNTFLAGS} \
659152e1c5SLionel Sambuc		${RPC_XDIR}${I:_clnt.c=.x} -o ${.TARGET}
669152e1c5SLionel Sambuc.endfor
679152e1c5SLionel Sambuc
689152e1c5SLionel SambucDPSRCS+=	${RPC_CLNTFILES}
699152e1c5SLionel SambucCLEANFILES+=	${RPC_CLNTFILES}
709152e1c5SLionel Sambuc
719152e1c5SLionel Sambuc.endif								# }
729152e1c5SLionel Sambuc
739152e1c5SLionel Sambuc##### Pull in related .mk logic
749152e1c5SLionel Sambuc.include <bsd.obj.mk>
759152e1c5SLionel Sambuc.include <bsd.sys.mk>
769152e1c5SLionel Sambuc.include <bsd.clean.mk>
77