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