Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Jan 2012 18:08:46 +0000
From:      Chris Rees <utisoft@gmail.com>
To:        Matthew Seaman <m.seaman@infracaninophile.co.uk>
Cc:        freebsd-ports <freebsd-ports@freebsd.org>
Subject:   Re: BSD make -- Malformed conditional
Message-ID:  <CADLo83-Qk=ZoaLqx6CuPvPFur4mKCne=mA_zSSr1v07ny5ykZA@mail.gmail.com>
In-Reply-To: <4F22E29F.8080602@infracaninophile.co.uk>
References:  <4F22CB51.6070507@infracaninophile.co.uk> <CADLo83-Q9O5AMTReRG9v=U5y1d37NUnK1dGUWe5Yk4ZMbd1Zjw@mail.gmail.com> <4F22E29F.8080602@infracaninophile.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
On 27 January 2012 17:45, Matthew Seaman
<m.seaman@infracaninophile.co.uk> wrote:
> On 27/01/2012 16:51, Chris Rees wrote:
>>> .for item in ${LIST}
>>> > .if ${item} =3D=3D "this" =A0# Ooops
>
>> You shouldn't use quotes either.
>
> I think that not quoting might be better style, but it's not the typical
> usage in make(1). =A0There are quite a few contrary examples in the ports=
:
>
> % < /tmp/ports-makefiles xargs grep '} =3D=3D "' | wc -l
> =A0 =A01674
> % < /tmp/ports-makefiles xargs grep '} =3D=3D [^"]' | wc -l
> =A0 =A0 531

These counterexamples are wrong.  Just because it works doesn't make it rig=
ht.

Quotes are way overused in Makefiles, just because in other languages
they're necessary doesn't mean we should use them when unneccessary.

Thought is required about which language you're writing in.

Equally, no-one should be advocating things like:

.if (${FOO} =3D=3D "bar")

just because it works-- we're not writing in C :)

We have the same problem with GNU test accepting "=3D=3D", for example.

Chris



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADLo83-Qk=ZoaLqx6CuPvPFur4mKCne=mA_zSSr1v07ny5ykZA>