Subject: Re: tools framework and FGREP AWOL?
To: Dan McMahill <dmcmahill@NetBSD.org>
From: Roland Illig <roland.illig@gmx.de>
List: tech-pkg
Date: 05/18/2005 04:22:55
Dan McMahill wrote:
> Is there a new way this should be done?  Should there be some target
> which says "give me some tools for bulk type operations"?

I am thinking about a make target show-tools which emits a shell code 
fragment defining all known tools. (This can also be used by users and 
developers to see whether a certain tool is defined.) Example:

$ make show-tools
...
INSTALL=/usr/bin/install
LN=/bin/ln
LS=/bin/ls
MKDIR=/bin/mkdir\ -p
MTREE=/usr/sbin/mtree
MV=/bin/mv
PAX=/bin/pax
...


The code for this has to be inserted at the very end of bsd.pkg.mk:

_ALL_TOOLS=             ${PKGSRC_USE_TOOLS} ${USE_TOOLS}
.PHONY: show-tools
show-tools:
.for _t_ in ${_ALL_TOOLS:O:u}
.  if defined(_TOOLS_VARNAME.${_t_})
         @${ECHO} ${_TOOLS_VARNAME.${_t_}:Q}=${TOOLS_PLATFORM.${_t_}:Q:Q}
.  endif
.endfor

Roland