Re: Use "?=" operator for a contrib makefile in documentation
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Maxim Orlov <orlovmg@gmail.com>,
Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-09-29T14:19:24Z
Lists: pgsql-hackers
On 29.09.25 16:00, Tom Lane wrote: > Peter Eisentraut <peter@eisentraut.org> writes: >> On 25.09.25 15:17, Maxim Orlov wrote: >>> I think that the Makefile should be written so that variable values, >>> specifically, PG_CONFIG, can be given to it from the environment rather >>> than the make command line. As a result, using the "?=" operator rather >>> than "=" to set a default value to the PG_CONFIG variable appears more >>> acceptable. > >> I think the current text is preferable. This allows running >> make PG_CONFIG=... >> so that you can pick a different PostgreSQL installation for a >> particular build. > > AFAICT that would still work with ?=. Nonetheless, I agree with > Peter that we shouldn't change this advice (much less change all our > Makefiles that do it like that). The reason is that the gmake manual > advises caution in the use of this feature: Yes, that's what I meant. The current code allows the "postfix" make syntax (make PG_CONFIG=...), but it doesn't allow environment variables to take effect silently (which also prevents the "prefix" syntax (PG_CONFIG=... make), but that's just the way things work).