On Wed, Oct 4, 2023 at 6:09 PM Till Backhaus <t...@backha.us> wrote:
>> This rather short Makefile shows exponential runtime depending on the number 
>> of variables.
>> VAR_1 ?= $(shell echo 1)

Dmitry Goncharov (6 October 2023 17:35) replied, ending:
> Prefer simply expanded variables with $(shell).

and if you really need the "only set if not already set" aspects of ?=,
use a suitable if check around the immediate assignments, e.g.

ifeq($(VAR_1),)
VAR_1 := $(shell echo 1)
endif

(and, generally, avoid using $(shell ...) for anything that can be
achieved using other make built-in functions, but I assume your real
Makefile has something more complicated as the shell command).

        Eddy.

Reply via email to