Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Jan 2009 13:10:29 +0100
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        arch@freebsd.org
Cc:        des@des.no, Hartmut.Brandt@dlr.de
Subject:   RFC: adding > and >= to /usr/bin/make conditionals ?
Message-ID:  <20090106121029.GA83861@onelab2.iet.unipi.it>
In-Reply-To: <E2F5A6372272F744859F67CB11ABC1110507C7@exbe05.intra.dlr.de>
References:  <200812262231.mBQMVjHC052150@svn.freebsd.org> <867i59lvbj.fsf@ds4.des.no> <20090105142929.GA70683@onelab2.iet.unipi.it> <E2F5A6372272F744859F67CB11ABC1110507C7@exbe05.intra.dlr.de>

next in thread | previous in thread | raw e-mail | index | archive | help
[not sure what is the proper forum for discussing this...]

I recently realised (and documented in the manpage) that /usr/bin/make
only implements == and != when comparing strings in coditionals,
yet it would be totally trivial to add support for > >= < <= as
well, because the underlying code already uses strcmp(), and
according to Harti (message attached below) there are no restrictions
from the standards point of view.

There is some value in having this feature, e.g. when comparing
package names to find out which one is more recent, etc.;
on the other hand, if we add (and start using) this feature,
our Makefiles might become harder to reuse on other platforms
(e.g. other BSDs, OSX ports) which use the same 'make' program.

So, I am polling to see if there is any consensus for or against
adding this feature to /usr/bin/make

	cheers
	luigi

[excerpt from Harti's message explaining the relation with standards]

On Mon, Jan 05, 2009 at 05:40:33PM +0100, Hartmut.Brandt@dlr.de wrote:
...
> >From the Posix standpoint of view, we can do what we want as long as we
> are not syntax compatible with posix-make :-) This is the reason, why
> most of our make extensions are compatible with posix. As soon as you
> have a construct that is a syntax error according to the Posix
> specification you invoke implementation-defined behaviour and as such
> you just have to document it. There are several of these escape
> mechanisms in the standard: the .POSIX pseudo-target and all targets
> that start with a dot and consist of uppercase letters.
> 
> With regard to conditionals: there is no standard. Posix decided to
> standard only minimal make, which is roughly compatible to V7 make. If
> you change things like conditional semantics you should: (1) document
> it, and (2) arrange a full ports build with the portcluster people. This
> takes some days, but is a good thing to do.
> 
> harti



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