bug-make
[Top][All Lists]
Advanced

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

[bug #35711] Make needs to define targets earlier


From: Paul D. Smith
Subject: [bug #35711] Make needs to define targets earlier
Date: Sat, 03 Mar 2012 19:01:18 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11

URL:
  <http://savannah.gnu.org/bugs/?35711>

                 Summary: Make needs to define targets earlier
                 Project: make
            Submitted by: psmith
            Submitted on: Sat 03 Mar 2012 02:01:17 PM EST
                Severity: 4 - Important
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 3.80
        Operating System: None
           Fixed Release: None
           Triage Status: Medium Effort

    _______________________________________________________

Details:

Today make's parser does not define any targets until the entire target has
been parsed completely.  Because of the way makefile syntax works, make cannot
know that the target has been parsed completely until it's working on the NEXT
statement (variable definition or another target).

This means that in a makefile like this:

foo: bar
        @cp $< $@
FOO = bar

the target "foo" is not defined as a target in make's internal structures
until make has parsed the "FOO" line far enough to realize it's a different
statement (a variable assignment).

This causes various problems:

First, if the target is a special target like .POSIX then the handling of
.POSIX doesn't take effect immediately; this can cause some issues (for
example, if the next line is a variable assignment and POSIX-style
backslash/newline handling is desired).

Second, it means that new special variables like $(.TARGETS) are hard to
create properly: this would list all known targets BUT due to the delay above
the value of that variable is not always up to date when you expect it.

Make should make some effort to define targets as soon as it's parsed the
target list (before the ":"), so that they're entered into the database as
targets, then update them with final information later, after the rest of the
rule has been parsed.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?35711>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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