bugmake - Bugs: bug #17665, Content of computed variable name...

 
 

bug #17665: Content of computed variable name not considered as dependency

Submitted by:  None
Submitted on:  Sat 09 Sep 2006 08:25:42 PM UTC  
 
Severity: 3 - NormalItem Group: None
Status: Not A BugPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 3.81Operating 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.

 

Sat 09 Sep 2006 09:49:46 PM UTC, comment #1:

> I do not know if this is intentional, a bug, or simply been
> forgotten to write down in the documentation.


None of the above. You are just misunderstanding what's happening. See the section "How make Reads a Makefile"; it will explain that targets and prerequisites are expanded immediately as the makefile is being read in. The section on automatic variables will explain that these variables are not instantiated until much later, when make is running the rule. So, the value of $@ when make reads the makefile is the empty string, which means your patsubst in the prerequisite list is a no-op.

The most straightforward way to do what you want is to use the secondary expansion feature recently added to GNU make. See the .SECONDEXPANSION target and associated documentation in the GNU make manual for more details.

Paul D. Smith <psmith>
Project Administrator
Sat 09 Sep 2006 08:25:42 PM UTC, original submission:

I have read the documentation and it states nothing about not
using computed variablenames as dependency, so I tried it.

I wanted to have a variable containing destinationfiles and
for each destinationfile a list of auxiliary files (i.e.
included TeX files).

In reality it makes no difference if the file, in my example
the content of variable all_TEX is present or not. "blub" is
not present and the echo comes with the expected output, with
a present file the same thing happens.

I do not know if this is intentional, a bug, or simply been
forgotten to write down in the documentation.

I shortened it for a quick insight:
#----------CUT HERE---------#
all_TEX=blub

all.dvi: $($(patsubst %.dvi,%,$@))
echo "Text: " $($(patsubst %.dvi,%, $@)_TEX)
#----------END CUT----------#

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 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sat 09 Sep 2006 09:49:46 PM UTCpsmithStatusNone=>Not A Bug
  Open/ClosedOpen=>Closed

Back to the top


Powered by Savane 3.1-cleanup1