diff --git a/usr.sbin/rpc.pcnfsd/Makefile b/usr.sbin/rpc.pcnfsd/Makefile index 2429aa444d99..5aebbf1a27c6 100644 --- a/usr.sbin/rpc.pcnfsd/Makefile +++ b/usr.sbin/rpc.pcnfsd/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.13 2002/08/02 02:47:58 christos Exp $ +# $NetBSD: Makefile,v 1.14 2002/09/14 05:35:13 thorpej Exp $ .include @@ -17,20 +17,19 @@ SRCS= pcnfsd_v1.c pcnfsd_v2.c pcnfsd_misc.c \ DPADD= ${LIBRPCSVC} ${LIBCRYPT} ${LIBUTIL} LDADD= -lrpcsvc -lcrypt -lutil -.ifnmake getrpcgen -XRPCGEN != cd ${.CURDIR} && ${MAKE} -B getrpcgen +# Resolve rpcgen's path, to allow it to be a dependency. +_RPCGEN:= ${RPCGEN:M*rpcgen} +.if ${_RPCGEN:M/*} == "" +_RPCGEN!= type ${RPCGEN} | awk '{print $$NF}' .endif -getrpcgen: - @set -- X `type ${RPCGEN}` && shift `expr $$# - 1` && echo "$$1" - -pcnfsd_svc.c: pcnfsd.x ${XRPCGEN} +pcnfsd_svc.c: pcnfsd.x ${_RPCGEN} ${RPCGEN} -C -s udp -s tcp -I ${.CURDIR}/pcnfsd.x -o $@ -pcnfsd_xdr.c: pcnfsd.x ${XRPCGEN} +pcnfsd_xdr.c: pcnfsd.x ${_RPCGEN} ${RPCGEN} -C -c ${.CURDIR}/pcnfsd.x -o $@ -pcnfsd.h: pcnfsd.x ${XRPCGEN} +pcnfsd.h: pcnfsd.x ${_RPCGEN} ${RPCGEN} -C -h ${.CURDIR}/pcnfsd.x -o $@ CLEANFILES += pcnfsd_svc.c pcnfsd_xdr.c pcnfsd.h