bugmake - Bugs: bug #35711, Make needs to define targets...

 
 

bug #35711: Make needs to define targets earlier

Submitted by:  Paul D. Smith <psmith>
Submitted on:  Sat 03 Mar 2012 07:01:17 PM UTC  
 
Severity: 4 - ImportantItem Group: Bug
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Component Version: 3.80Operating System: None
Fixed Release: NoneTriage Status: Medium Effort

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 03 Mar 2012 07:01:17 PM UTC, original submission:

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:
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.

Paul D. Smith <psmith>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by psmith (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup