bugmake - Bugs: bug #39485, target specific make variables are...

 
 

bug #39485: target specific make variables are incorrectly accumulated

Submitted by:  None
Submitted on:  Sun 14 Jul 2013 08:22:00 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: Not A BugPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 3.82Operating System: Any
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.

 

Sun 14 Jul 2013 10:51:52 PM UTC, comment #1:

This is defined as the correct behavior for target-specific variables; from the GNU make manual:

The idea is to support usages such as:

Now when you run "make" you'll get the non-debug version (DEBUGFLAGS is empty), but when you run "make debug" you get the debug version (DEBUGFLAGS is set to -g).

Paul D. Smith <psmith>
Project Administrator
Sun 14 Jul 2013 08:22:00 PM UTC, original submission:

$ cat Makefile
V=
t1: t2
t1: V+=v1
t2: V+=v2
%:
@echo target=$@ V=$(V)

$ make t1
target=t2 V=v1 v2
target=t1 V=v1
$ make t2
target=t2 V=v2
$ make t2 t1
target=t2 V=v2
target=t1 V=v1
$ make t1 t2
target=t2 V=v1 v2
target=t1 V=v1
make: `t2' is up to date.

i expected V to be consistently v2 for target t2,
the fact that t2 is a dependency of t1 should not
change the variable setting for t2 because that
makes the result unpredictable

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

 

Carbon-Copy List
  • -unavailable- added by psmith (Posted a comment)
  •  

    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
    Sun 14 Jul 2013 10:51:52 PM UTCpsmithStatusNone=>Not A Bug
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1