bug-make
[Top][All Lists]
Advanced

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

Re: feature requests: $(__FILE__) and $(__LINE__) textual macros


From: Paul Smith
Subject: Re: feature requests: $(__FILE__) and $(__LINE__) textual macros
Date: Sat, 27 Jan 2024 14:11:39 -0500
User-agent: Evolution 3.50.3 (by Flathub.org)

On Sat, 2024-01-27 at 18:06 +0100, Basile Starynkevitch wrote:
> For non-trivial GNUmakefile-s on Linux it would be nice to have a 
> $(__FILE__) and $(__LINE__) textual macros of GNU make.

It would be great if you could provide examples where these would be
useful, especially examples that are not already covered by the output
of the -p option to GNU Make.

I'm not saying we shouldn't introduce these, although I think you
misunderstand how tricky it would be to use them (for example, if you
set:

    FOO = $(__LINE__)

    BAR := $(FOO)

then will BAR get line number 3, where the variable reference $(FOO) is
expanded, or the line number 1, where the variable FOO is defined?) 
But we need to understand the use-cases to evaluate the request.

-- 
Paul D. Smith <psmith@gnu.org>            Find some GNU make tips at:
https://www.gnu.org                       http://make.mad-scientist.net
"Please remain calm...I may be mad, but I am a professional." --Mad
Scientist



reply via email to

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