On 2023-06-20 12:55, Paul Smith wrote: > I don't understand how this is different than just: > > IMPORTANT_VAR := $(IMPORTANT_VAR) > > If the user specifies an override of the variable on the command line > then the value in the makefile will never be used, so the shell command > will never be invoked.
If I just have this: IMPORTANT_VAR := $(shell sh -c "echo calculate; echo executed 1>&2") and do "make IMPORTANT_VAR=alternative", I still see "executed" on standard output. (In an installation with Make 4.1.) If I just have this: IMPORTANT_VAR = $(shell sh -c "echo calculate; echo executed 1>&2") and use $(IMPORTANT_VAR) in multiple places, I see multiple "executed", of course.