bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exponential Runtime in make 4.4.1 when export is used


From: Edward Welbourne
Subject: Re: Exponential Runtime in make 4.4.1 when export is used
Date: Mon, 9 Oct 2023 15:09:26 +0000

On Wed, Oct 4, 2023 at 6:09 PM Till Backhaus <till@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

[Prev in Thread] Current Thread [Next in Thread]