From 38a5601a02efa68903c62356bc3400967a010dab Mon Sep 17 00:00:00 2001 From: jlam Date: Wed, 21 Jul 2004 19:55:11 +0000 Subject: If a package Makefile sets USE_TBL to "yes", then add "tbl" to ${TOOLS_DIR}/bin. It will either point to /usr/bin/tbl or will depend on groff otherwise. This should allow removing dependencies on groff just for the sake of forcing the existence of tbl. --- mk/tools.mk | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'mk') diff --git a/mk/tools.mk b/mk/tools.mk index 9f885a0337c..c40d9b3177b 100644 --- a/mk/tools.mk +++ b/mk/tools.mk @@ -1,4 +1,4 @@ -# $NetBSD: tools.mk,v 1.35 2004/06/15 13:41:43 grant Exp $ +# $NetBSD: tools.mk,v 1.36 2004/07/21 19:55:11 jlam Exp $ # # This Makefile creates a ${TOOLS_DIR} directory and populates the bin # subdir with tools that hide the ones outside of ${TOOLS_DIR}. @@ -384,4 +384,25 @@ ${TOOLS_DIR}/bin/make: fi .endif +.if defined(USE_TBL) && !empty(USE_TBL:M[yY][eE][sS]) +. if exists(/usr/bin/tbl) +_TOOLS_PROGNAME.tbl= /usr/bin/tbl +. else +BUILD_DEPENDS+= groff>=1.19nb4:../../textproc/groff +_TOOLS_PROGNAME.tbl= ${LOCALBASE}/bin/tbl +. endif +. if exists(_TOOLS_PROGNAME.tbl) +TBL:= ${_TOOLS_PROGNAME.tbl} +. endif + +override-tools: ${TOOLS_DIR}/bin/tbl +${TOOLS_DIR}/bin/tbl: + ${_PKG_SILENT}${_PKG_DEBUG} \ + src="${_TOOLS_PROGNAME.tbl}"; \ + if [ -x $$src -a ! -f ${.TARGET} ]; then \ + ${MKDIR} ${.TARGET:H}; \ + ${LN} -sf $$src ${.TARGET}; \ + fi +.endif # USE_TBL + .endif # TOOLS_MK -- cgit v1.2.3