From 19a4f23ea130a386a5886cf148440e216be8da91 Mon Sep 17 00:00:00 2001 From: jlam Date: Wed, 18 Jan 2006 20:18:04 +0000 Subject: Move the following targets from bsd.pkg.mk to bsd.utils.mk: show-depends-dirs show-all-depends-dirs show-all-depends-dirs-excl While we're here, reimplement them using the new pkg_paths and depends-depth-first.awk scripts. As a side effect, this speeds up the execution of these targets by around 5-15% depending on the complexity of the dependency graph. NOTE: This *does* change the behavior of these targets slightly because the output is now newline-separated instead of space-separated, and the order of the output lines doesn't match the original targets because the dependency graph is now walked depth-first instead of breadth first. --- mk/bsd.utils.mk | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'mk/bsd.utils.mk') diff --git a/mk/bsd.utils.mk b/mk/bsd.utils.mk index 45430b9a2b5..55d3709368b 100644 --- a/mk/bsd.utils.mk +++ b/mk/bsd.utils.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.utils.mk,v 1.3 2006/01/18 18:03:08 jlam Exp $ +# $NetBSD: bsd.utils.mk,v 1.4 2006/01/18 20:18:04 jlam Exp $ # # This Makefile fragment is included by bsd.pkg.mk and defines utility # and otherwise miscellaneous variables and targets. @@ -25,8 +25,8 @@ _PKG_PATHS_CMD= \ PWD_CMD=${TOOLS_PWD_CMD:Q} TEST=${TOOLS_TEST:Q} \ ${SH} ${.CURDIR}/../../mk/scripts/pkg_path -.PHONY: show-depends-pkgpaths -show-depends-pkgpaths: +.PHONY: show-depends-dirs show-depends-pkgpaths +show-depends-dirs show-depends-pkgpaths: @${_PKG_PATHS_CMD} ${_ALL_DEPENDS_PKGSRCDIRS:O:u} # _DEPENDS_WALK_CMD holds the command (sans arguments) to walk the @@ -38,3 +38,17 @@ _DEPENDS_WALK_CMD= \ MAKEFLAGS=${_DEPENDS_WALK_MAKEFLAGS:Q} \ PKGSRCDIR=${PKGSRCDIR:Q} TEST=${TOOLS_TEST:Q} \ ${AWK} -f ${.CURDIR}/../../mk/scripts/depends-depth-first.awk -- + +# show-all-depends-dirs prints a list of every dependency, implied and +# direct", of the current package, and includes the current package. +# +.PHONY: show-all-depends-dirs +show-all-depends-dirs: + @(${_DEPENDS_WALK_CMD} -r ${PKGPATH}) + +# show-all-depends-dirs-excl prints a list of every dependency, implied and +# direct", of the current package. +# +.PHONY: show-all-depends-dirs-excl +show-all-depends-dirs-excl: + @(${_DEPENDS_WALK_CMD} ${PKGPATH}) -- cgit v1.2.3