From owner-freebsd-ports Wed Dec 6 03:02:07 1995 Return-Path: owner-ports Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id DAA00983 for ports-outgoing; Wed, 6 Dec 1995 03:02:07 -0800 (PST) Received: from silvia.HIP.Berkeley.EDU (silvia.HIP.Berkeley.EDU [136.152.64.181]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id DAA00974 for ; Wed, 6 Dec 1995 03:02:01 -0800 (PST) Received: (from asami@localhost) by silvia.HIP.Berkeley.EDU (8.6.12/8.6.9) id DAA06667; Wed, 6 Dec 1995 03:01:53 -0800 Date: Wed, 6 Dec 1995 03:01:53 -0800 Message-Id: <199512061101.DAA06667@silvia.HIP.Berkeley.EDU> To: jkh@time.cdrom.com CC: ports@freebsd.org In-reply-to: <13988.818198260@time.cdrom.com> (jkh@time.cdrom.com) Subject: Re: Proposed change to bsd.port.mk From: asami@cs.berkeley.edu (Satoshi Asami) Sender: owner-ports@freebsd.org Precedence: bulk * I was just thinking today that it might be nice to be able to write * your own scripts for traversing the ports tree, so I came up with this: * * *** /usr/src/share/mk/bsd.port.mk Fri Oct 6 00:20:35 1995 * --- /usr/share/mk/bsd.port.mk Tue Dec 5 02:24:42 1995 * *************** * *** 402,409 **** * --- 402,422 ---- * @${DO_NADA} * .endif * * + .if defined(ALL_HOOK) * + all_hook: * + @/usr/bin/env CURDIR=${.CURDIR} DISTNAME=${DISTNAME} \ * + DISTDIR=${DISTDIR} WRKDIR=${WRKDIR} \ * + WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR} SCRIPTDIR=${SCRIPTDIR} \ * + FILESDIR=${FILESDIR} PORTSDIR=${PORTSDIR} PREFIX=${PREFIX} \ * + DEPENDS="${DEPENDS}" BUILD_DEPENDS="${BUILD_DEPENDS}" \ * + RUN_DEPENDS="${RUN_DEPENDS}" X11BASE=${X11BASE} \ * + ${ALL_HOOK} * + * + all: all_hook * + .else * .if !target(all) * all: build * + .endif * .endif * * .if !defined(IS_DEPENDED_TARGET) This seems useful and correct (at least I tested your example :), no objections from me. By the way, two small questions about technical details: (1) Why don't you just define the new target as "all" and get rid of the extra "all: all_hook" line? (2) The new target should be either moved completely inside the test for "!target(all)" or outside (i.e., the added ".endif" should go in place of the added ".else"). The way it is now, it's sort of confusing as it mixes two tests. The Gunslinger