summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortv <tv@NetBSD.org>2001-11-01 15:03:07 +0000
committertv <tv@NetBSD.org>2001-11-01 15:03:07 +0000
commitb6499748aef71ac3bfaa464ce1df51a403bb33ff (patch)
treeb17b5765c59d0183378f41bb282fe23e8af9ef7b
parent7a726f828b2cdefe5eca0fa473e10d3cfc55eaa7 (diff)
Be smarter about finding rpcgen's absolute path; only do it if ${RPCGEN}
(when evaluated) does not start with a /. Also don't go through a make(1) recursion step; just use !=.
-rw-r--r--include/rpc/Makefile10
-rw-r--r--lib/librpcsvc/Makefile12
2 files changed, 17 insertions, 5 deletions
diff --git a/include/rpc/Makefile b/include/rpc/Makefile
index 86541946a34..02f8bf1674b 100644
--- a/include/rpc/Makefile
+++ b/include/rpc/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2001/10/31 20:58:28 tv Exp $
+# $NetBSD: Makefile,v 1.8 2001/11/01 15:03:08 tv Exp $
#
INCS= auth.h auth_unix.h clnt.h clnt_soc.h nettype.h \
@@ -12,5 +12,11 @@ INCSDIR= /usr/include/rpc
.include <bsd.prog.mk>
-rpcb_prot.h: rpcb_prot.x ${RPCGEN}
+# Resolve rpcgen's path, to allow it to be a dependency.
+_RPCGEN:= ${RPCGEN}
+.if ${_RPCGEN:M/*} == ""
+_RPCGEN!= type ${RPCGEN} | awk '{print $$NF}'
+.endif
+
+rpcb_prot.h: rpcb_prot.x ${_RPCGEN}
${RPCGEN} -C -h ${.CURDIR}/rpcb_prot.x -o ${.TARGET}
diff --git a/lib/librpcsvc/Makefile b/lib/librpcsvc/Makefile
index 50060169979..12929eeb76d 100644
--- a/lib/librpcsvc/Makefile
+++ b/lib/librpcsvc/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.32 2001/10/31 20:56:09 tv Exp $
+# $NetBSD: Makefile,v 1.33 2001/11/01 15:03:07 tv Exp $
RPCSRCS= bootparam_prot.x klm_prot.x mount.x nfs_prot.x\
nlm_prot.x rex.x rnusers.x rusers.x rquota.x rstat.x rwall.x\
@@ -16,13 +16,19 @@ MKPIC= no
.include <bsd.lib.mk>
+# Resolve rpcgen's path, to allow it to be a dependency.
+_RPCGEN:= ${RPCGEN}
+.if ${_RPCGEN:M/*} == ""
+_RPCGEN!= type ${RPCGEN} | awk '{print $$NF}'
+.endif
+
# We don't use explicit suffix rules here to avoid dependencies in the
# Installed files.
.for I in ${RPCSRCS}
-${I:.x=.c}: $I ${RPCGEN}
+${I:.x=.c}: $I ${_RPCGEN}
${RPCGEN} -C -c ${.CURDIR}/$I -o ${.TARGET}
-${I:.x=.h}: $I ${RPCGEN}
+${I:.x=.h}: $I ${_RPCGEN}
${RPCGEN} -C -h ${.CURDIR}/$I -o ${.TARGET}
.endfor