bugmake - Bugs: bug #11725, Target-specific variables are not...

 
 

bug #11725: Target-specific variables are not resolved when calculating dependencies for a pattern rule

Submitted by:  None
Submitted on:  Mon 24 Jan 2005 09:20:33 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: Not A BugPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 3.80Operating System: POSIX-Based
Fixed Release: NoneTriage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Mon 24 Jan 2005 10:17:43 PM UTC, comment #1:

Correct. This is not a bug: this is as documented and is true for explicit rules, too, not just implicit (pattern) rules. From the GNU make manual section "Target-specific Variable Values", second paragraph:

"As with automatic variables, these values are only available within the context of a target's command script (and in other target-specific assignments)."

Paul D. Smith <psmith>
Project Administrator
Mon 24 Jan 2005 09:20:33 PM UTC, original submission:

When a variable is in the prerequisite list of a pattern rule, and the variable is defined as a target-specific variable, the value of the variable is not used when resolving the dependencies of the pattern rule.

Thus, if I have a directory where the only file is this Makefile:

%.bar: $(PREREQS)
echo $(PREREQS)

foo.bar: PREREQS = foo bar baz

> make foo.bar

echo foo bar baz
foo bar baz

And the relevant portion of the debug output:

> make -d foo.bar

...
Considering target file `foo.bar'.
File `foo.bar' does not exist.
Looking for an implicit rule for `foo.bar'.
Trying pattern rule with stem `foo'.
Found an implicit rule for `foo.bar'.
Finished prerequisites of target file `foo.bar'.
Must remake target `foo.bar'.
...

make does not attempt to resolve the dependencies upon PREREQS, i.e. files foo, bar, and baz.

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

 

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

 

 

Follow 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Mon 24 Jan 2005 10:17:43 PM UTCpsmithStatusNone=>Not A Bug
  Open/ClosedOpen=>Closed
Mon 24 Jan 2005 09:24:35 PM UTCjtwangCarbon-Copy-=>Added -unavailable-

Back to the top


Powered by Savane 3.1-cleanup1