helpmake - Support: sr #104348, Commands that update more than one...

 
 

You are not allowed to post comments on this tracker with your current authentification level.

sr #104348: Commands that update more than one target

Submitted by:  None
Submitted on:  Tue 21 Jun 2005 11:02:48 PM UTC  
 
Category: NonePriority: 5 - Normal
Severity: 3 - NormalStatus: None
Privacy: PublicAssigned to: None
Originator Email: -unavailable-Open/Closed: Open
Operating System: None

Wed 21 Jun 2006 08:39:49 PM UTC, comment #1:

Completely agree.

Oddly enough, you can do this already for pattern rules. Consider the following:

all : a.foo a.bar b.foo b.bar
%.foo %.bar :
@echo rule 1: $@
b.foo b.bar :
@echo rule 2: $@

This produces the following output:
rule 1: a.foo
rule 2: b.foo
rule 2: b.bar

Note that the pattern rule is executed only once (to update two files!), but the second rule is executed twice (once for each target).

Ian Prest <ijprest>
Tue 21 Jun 2005 11:02:48 PM UTC, original submission:

In GNU Make, it is possible to write a rule with more than one target. However, the meaning of this is the same as writing multiple rules that are identical except each has only one target. So if more than one of the targets is out-of-date, the command part of the rule will be executed more than one time.

There are programs that can create more than one output file when run. For example, "gcc -c foo.c bar.c" produces both foo.o and bar.o. For gcc, the only reason to use this feature would be to speed up compilation. Another example is "link.exe /pdb:bin/foo.pdb /out:bin/foo.exe src/foo.obj". In this example, both foo.pdb and foo.exe must be created by a single execution of link.exe.

GNU Make should have a syntax to support this concept: that a single command can update more than one target. There should be enough flexibility in the syntax to support both types of use.

Anonymous

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

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