make-alpha
[Top][All Lists]
Advanced

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

Re: Minor Comments on Gmake Internals


From: Paul Smith
Subject: Re: Minor Comments on Gmake Internals
Date: Sat, 18 Dec 2021 14:43:48 -0500
User-agent: Evolution 3.36.5-0ubuntu1

On Sat, 2021-12-18 at 11:35 -0800, Paul Eggert wrote:
> Yes, it appears that .TARGETS is a circa 2002 idea that never got
> published. The source code and/or commentary mentions .TARGETS twelve
> times and perhaps these should all be looked at.

I still want to do this.  I think it would be very useful.  This is one
reason I haven't removed these comments.

Unfortunately when implementing it I discovered a problem: the way make
parses rules it doesn't actually define the targets until after the
entire rule is parsed, and we can't know whether the entire rule is
parsed until we start the NEXT rule or variable assignment.

So for example this:

  foo:
          @echo foo

  $(info foo is $(if $(filter foo,$(.TARGETS)),,NOT )a target)

says "foo is NOT a target" which is clearly bogus.

To make this work the makefile parser needs to be changed to add
targets as soon as we determine we're parsing a new rule, then be able
to add the details about the target later once the rule is complete.

I haven't ever gotten around to doing that work.




reply via email to

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