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

 
 

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

Submitter:  None
Submitted:  Sat 09 Sep 2006 08:25:42 PM UTC
   
 
Severity:  3 - Normal Item Group:  None
Status:  Not A Bug Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  3.81 Operating System:  POSIX-Based
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-09-09 psmith StatusNone Not A Bug
    Open/ClosedOpen Closed

Back to the top

Powered by Savane 3.13-caa5.
Corresponding source code