bugmake - Bugs: bug #9523, Recursive vars collapsed...

 
 

bug #9523: Recursive vars collapsed prematurely, ignoring late definitions

Submitted by:  None
Submitted on:  Thu 01 Jul 2004 01:59:29 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: Not A BugPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 3.79.1Operating 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.

 

Thu 01 Jul 2004 08:02:29 PM UTC, comment #1:

This is not a bug. The evaluation rules of make clearly show that variables are expanded when they are used in an immediate context: examples of an immediate context include both the target and prerequisite lists of a rule (like "make: $(CHECK_ENV)".

Please see the GNU make manual chapter "How 'make' Reads a Makefile" for a detailed discussion of immediate vs. deferred contexts and when variable expansion occurs.

Paul D. Smith <psmith>
Project Administrator
Thu 01 Jul 2004 01:59:29 PM UTC, original submission:

I'm using an "Variable Missing Check" pattern in my makefile. I have a construction that looks like:

make: $(CHECK_ENV)

If I defer defining the $(CHECK_ENV) until late in the file, the definition is not constructed correctly:

CHECK_ENV = $($(LC_ALL)BAD)env
BAD = bad

badenv:
@echo "You must set LC_ALL"
false

env:
@echo "Your LC_ALL is okay"

If I put both CHECK_ENV= and BAD= definitions above the make: line, then all is well. But deferring either variable until after the target appears causes incorrect behavior.

=Austin
(Austin_Hastings@yahoo.com)

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
Thu 01 Jul 2004 08:02:29 PM UTCpsmithStatusNone=>Not A Bug
  Open/ClosedOpen=>Closed
  Carbon-Copy-=>Added austin_hastings --AT-- yahoo --DOT-- com

Back to the top


Powered by Savane 3.1-cleanup1