From owner-freebsd-ports Sun Nov 11 11:51:45 2001 Delivered-To: freebsd-ports@freebsd.org Received: from smtp.noos.fr (descartes.noos.net [212.198.2.74]) by hub.freebsd.org (Postfix) with ESMTP id DD26D37B420 for ; Sun, 11 Nov 2001 11:51:34 -0800 (PST) Received: (qmail 41335078 invoked by uid 0); 11 Nov 2001 19:51:32 -0000 Received: from unknown (HELO gits.dyndns.org) ([212.198.229.145]) (envelope-sender ) by 212.198.2.74 (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 11 Nov 2001 19:51:32 -0000 Received: (from root@localhost) by gits.dyndns.org (8.11.6/8.11.6) id fABJpTP11901; Sun, 11 Nov 2001 20:51:29 +0100 (CET) (envelope-from root) Message-Id: <200111111951.fABJpTP11901@gits.dyndns.org> Subject: Re: patches for bsd.port.mk In-Reply-To: <86lmheb8gg.wl@archon.local.idaemons.org> To: Akinori MUSHA Date: Sun, 11 Nov 2001 20:51:29 +0100 (CET) Cc: portmgr@FreeBSD.org, ports@FreeBSD.org Reply-To: clefevre@citeweb.net From: Cyrille Lefevre Organization: ACME X-Face: X-Mailer: ELM [version 2.4ME+ PL95a (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Akinori MUSHA wrote: [snip] > 3) Add a bunch of generally used commands, and use shell (ash or ksh) > builtins where available for efficiency. [snip] > -ECHO?= /bin/echo > +CUT?= /usr/bin/cut > +DC?= /usr/bin/dc > +ECHO?= echo # Shell builtin +ECHO_CMD?= echo > +EGREP?= /usr/bin/egrep > 5) Add a optional field to *DEPENDS, to pass arbitrary arguments to > make when building depend target. [snip] take care when using ${ECHO} since it may not work as expected. it is better to declare and use ECHO_CMD in addition to ECHO to avoid inappropriate results. the explanation is in /usr/share/mk/sys.mk : .if ${.MAKEFLAGS:M-s} == "" ECHO ?= echo ECHODIR ?= echo .else ECHO ?= true .if ${.MAKEFLAGS:M-s} == "-s" ECHODIR ?= echo .else ECHODIR ?= true .endif .endif so, ECHO may be defined to `true' instead of `echo' and this may broke many constructions if `make' is called w/ `-s'. let's try : $ cd /usr/ports/net/isc-dhcp3 $ make -V ECHO -V ECHODIR echo echo $ make -V ECHO -V ECHODIR -s true echo $ make -V ECHO -V ECHODIR -s -s true true declaring and using ECHO_CMD avoid this problem. Cyrille. -- Cyrille Lefevre mailto:clefevre@citeweb.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message