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


You are not allowed to post comments on this tracker with your current authentication 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:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  None
Privacy:  Public Assigned to:  None
Originator Email:  -email is 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 : :
@echo rule 1: $@ :
@echo rule 2: $@

This produces the following output:
  rule 1:
  rule 2:
  rule 2:

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.



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 add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.




No changes have been made to this item

Back to the top

Powered by Savane 3.6