Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Nov 2001 20:51:29 +0100 (CET)
From:      Cyrille Lefevre <clefevre@citeweb.net>
To:        Akinori MUSHA <knu@iDaemons.org>
Cc:        portmgr@FreeBSD.org, ports@FreeBSD.org
Subject:   Re: patches for bsd.port.mk
Message-ID:  <200111111951.fABJpTP11901@gits.dyndns.org>
In-Reply-To: <86lmheb8gg.wl@archon.local.idaemons.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200111111951.fABJpTP11901>