help-make
[Top][All Lists]
Advanced

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

Re: question on Makefile first flavor assignment


From: Bahman Movaqar
Subject: Re: question on Makefile first flavor assignment
Date: Thu, 14 Sep 2023 02:52:18 -0700
User-agent: Evolution 3.48.4

I believe a Makefile is worth a thousand words!  

Try out the attached Makefile by simply running `make'.  I hope it
clearly demonstrates why extra care should be taken when using
recursive variables.

Let me know if you need more clarification.

-- 
Bahman


On Wed, 2023-09-13 at 16:48 -0700, Tom Ma wrote:
> Hi gnu make friend,
> 
> I am trying to understand the first flavor of variable - recursively
> expanded variable assignment disadvantages mentioned in gnu make
> manual,
> 
> Another disadvantage is that any functions (see Functions for
> Transforming
> Text
> <https://www.gnu.org/software/make/manual/html_node/Functions.html>)
> referenced in the definition will be executed every time the variable
> is
> expanded. This makes make run slower; worse, it causes the wildcard
> and
> shell functions to give unpredictable results because you cannot
> easily
> control when they are called, or even how many times.
> 
> For the recursively expanded variable assignment  on Transforming
> Text
> functions, it will be executed every time the variable is expanded,
> which
> will cause make run slower.
> Can you give a simple example to make it a little bit more clearer?
> 
> Thanks,
> Tom

Attachment: Makefile
Description: Text Data


reply via email to

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