Re: [dev] Special target ".POSIX" in Makefiles

From: Ismael Luceno <ismael.luceno_AT_gmail.com>
Date: Mon, 3 Jan 2022 13:33:49 +0100

El vie, 31 dic 2021 a la(s) 09:30, Laslo Hunhold (dev_AT_frign.de) escribió:
>
> On Fri, 31 Dec 2021 12:49:46 +0600
> NRK <nrk_AT_disroot.org> wrote:
>
> Dear NRK,
>
> > Hmm, I was under the impression that `?=` was accepted into POSIX.
> > But I cannot find any mention of it in the posix manpage (man 1p
> > make) so I guess I was wrong.
> >
> > What would be a posix replacement for `?=` ? I assume something like:
> >
> > VAR = $$(if test -n "$$VAR"; then printf "%s" "$$VAR"; else
> > printf "fallback"; fi)
> >
> > - NRK
>
> that is exactly what I meant earlier on that the POSIX-intended good
> practices get destroyed by the retarded GNU extensions.

Actually, many of those extensions come from SunPro Make, so not
really GNU extensions, and I guess they were implemented in GNU make
mainly for compatibility reasons, as at the time SunOS was probably
the most relevant platform for the development of GNU (remember, this
was a long time before autoconf/automake).

Also, "?=" is meant to provide a default value for something you want
to take from the environment into the makefile for substitution, but
where otherwise you really want the environment value, so it has its
uses; and it's fairly widespread.
Received on Mon Jan 03 2022 - 13:33:49 CET

This archive was generated by hypermail 2.3.0 : Mon Jan 03 2022 - 13:48:07 CET