I think you did not get what I'm complaining about. Please
try this 3-line Makefile:

### BEGIN
FOO +=
build/%: BAR +=
build/release: ; @echo "FOO='$(FOO)' BAR='$(BAR)'"
### END

And run "make FOO=X BAR=Y"

BAR is now **two** Y aka 'Y Y' which does not make any sense.

~Markus



On 2023-09-27 16:20, Bahman Movaqar wrote:
> Invoking make like `make FOO=X BAR=Y' causes Make to consider `FOO' and
> `BAR' as special recursive/deferred variables.
> 
>>From GNU Make manual:
> 
>> all ordinary assignments of the same variable in the makefile are 
>> ignored; we say they have been overridden by the command line 
>> argument. 
> 
> Each one will be appended to twice (matching pattern rules) before
> being expanded as `$(FOO)' and `$(BAR)'.
> 
> See https://www.gnu.org/software/make/manual/make.html#Overriding
> 
> ∎
> 
> On the other hand, `env FOO=X BAR=Y make' creates two environment
> variables which make does not treat as recursive variables.  They just
> always expand to the same value.
> 
> ∎
> 
> HTH,
> 

-- 
Markus Oberhumer, <mar...@oberhumer.com>, http://www.oberhumer.com/

Reply via email to