Re: Evaluation and expansion

2023-06-07 Thread Kaz Kylheku
On 2023-06-06 15:14, Bartłomiej Wójcik wrote: > Hi, > > I would like to ask you for help with clarifying the idea of evaluation and > expansion related to makefile. As I understand, expansion refers to > replacing macro reference by its value and there are two possible ways of > expansion - *immed

Re: Evaluation and expansion

2023-06-07 Thread Bartłomiej Wójcik
Hi, Thank you for the response. I think that I understand that, but still not catching the part with other things. What is the term *evaluation*, when does it happen (in which phase) and how is it related to parsing, expanding? Regards, Bartek śr., 7 cze 2023 o 09:08 Kaz Kylheku napisał(a): >

Ignoring the whitespaces

2023-06-07 Thread Bartłomiej Wójcik
Hi, The GNU make documentation states: *define myrule target: echo built endef $(myrule) * *The above makefile results in the definition of a target ‘target’ with prerequisites ‘echo’ and ‘built’, as if the makefile contained target: echo built, rather than a rule with a recipe. Newlines

Re: Ignoring the whitespaces

2023-06-07 Thread Paul Smith
On Wed, 2023-06-07 at 12:23 +0200, Bartłomiej Wójcik wrote: > The GNU make documentation states: > > *define myrule > target: >     echo built > endef > > $(myrule) > * To be clear, the documentation says that the above will NOT work (as you intend). > *The above makefile results in the def

Re: Evaluation and expansion

2023-06-07 Thread Paul Smith
On Wed, 2023-06-07 at 00:14 +0200, Bartłomiej Wójcik wrote: > I also found that in the *immediate* context the expansion is done > before evaluation, and for the *deferred* context, it is the > opposite. But it is also stated that in the *immediate *context, the > expansion is done while parsing, w

Re: Evaluation and expansion

2023-06-07 Thread Kaz Kylheku
On 2023-06-07 00:37, Bartłomiej Wójcik wrote: > Hi, > Thank you for the response. I think that I understand that, > but still not catching the part with other things. > What is the term _evaluation_, when does it happen (in which phase) > and how is it related to parsing, expanding? We can think

Re: Evaluation and expansion

2023-06-07 Thread Paul Smith
On Wed, 2023-06-07 at 09:45 -0700, Kaz Kylheku wrote: > GNU Make's manual uses the word "evaluate" for all compile-time > calculations My suspicion is that there are various places in the manual where the terms "expand" and "evaluate" are not used exactly correctly. They might even be used interc

Re: Path prefix to src and targets

2023-06-07 Thread Paul Smith
On Tue, 2023-05-30 at 15:06 +0200, David Deutsch wrote: > I have checked the competence of GPT4 for make many times before I > decided to test it on mailing list questions. I have always found it > to be surprisingly good. I've seen people post answers to GNU Make questions on StackOverflow that

Re: Ignoring the whitespaces

2023-06-07 Thread Kaz Kylheku
On 2023-06-07 03:23, Bartłomiej Wójcik wrote: > Hi, > The GNU make documentation states: > > *define myrule > target: > echo built > endef > > $(myrule) > * > > *The above makefile results in the definition of a target ‘target’ with > prerequisites ‘echo’ and ‘built’, as if the makefile