bugmake - Bugs: bug #32042, Rules with multiple outputs and...

 
 

bug #32042: Rules with multiple outputs and intermediate chains

Submitted by:  None
Submitted on:  Mon 03 Jan 2011 07:32:15 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Component Version: NoneOperating 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.

 

Mon 10 Sep 2012 05:46:23 AM UTC, comment #1:

I agree this is a bug. I think fixing it will not be so simple; by the time we are setting the intermediate flag on foo.def, foo.ghi has already been defined as a target and at that point we can't tell whether it was done as a side-effect of the pattern, or whether there really IS an explicit target foo.ghi in the makefile (and so we shouldn't mark it intermediate). We'll need to find a way to make that distinction.

FYI, the formatting caused problems with your example; here's the makefile I used to test:

Paul D. Smith <psmith>
Project Administrator
Mon 03 Jan 2011 07:32:15 PM UTC, original submission:

In the case below, if both output files from a pattern rule are later used as prerequisites, only the first one will be treated as intermediate.

The steps to reproduce are below.

Expected result of make all: foo.jkl is created, and all other files are created then deleted
Actual result of make all: foo.jkl is created; foo.abc, foo.def, and foo.ghi are created; foo.abc and foo.def are deleted; foo.ghi is NOT deleted

all: foo.jkl

%.abc:
date > $@

%.def %.ghi: %.abc
@echo "Generating $.def and $.ghi from $*.abc"
@sleep 2
@touch $.def $.ghi

%.jkl: %.def %.ghi
cat $^ > $@
clean:
rm -f .

When I change the makefile such that the pattern rule that creates %.def and %.ghi is created through the use of a template and $(eval $(call MY_TEMPLATE)) as in section 8.8 of the GNU Make Manual, neither foo.def nor foo.ghi are deleted.

This behavior seems to be inconsistent with the description of how implicit chains should be handled (in section 10.4 of the manual).

Anonymous

 

(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 (Posted a comment)
  •  

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

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 10 Sep 2012 05:46:23 AM UTCpsmithTriage StatusNone=>Medium Effort

    Back to the top


    Powered by Savane 3.1-cleanup