El vie, 31 dic 2021 a la(s) 09:30, Laslo Hunhold (d...@frign.de) escribió: > > On Fri, 31 Dec 2021 12:49:46 +0600 > NRK <n...@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.