bugmake - Bugs: bug #26596, MAKEFLAGS documentation tweak

 
 

bug #26596: MAKEFLAGS documentation tweak

Submitted by:  None
Submitted on:  Sun 17 May 2009 12:01:32 AM UTC  
 
Severity: 3 - NormalItem Group: Enhancement
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Component Version: 3.81Operating System: Any
Fixed Release: NoneTriage Status: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Wed 22 May 2013 03:17:45 PM UTC, comment #1:

Hm. I'm not sure why the immediate expansion has limited content. Is there any purpose to this? Wouldn't it just be better to have the immediate expansion resolve to the entire thing? I'll have to look into it; maybe there's a good reason for doing it this way.

Paul D. Smith <psmith>
Project Administrator
Sun 17 May 2009 12:01:32 AM UTC, original submission:

Right now, the value of MAKEFLAGS varies during the processing. For immediate expansion, its value doesn't include any options that have arguments, nor does it include variable assignments. Later, during deferred expansion, its value is recalculated to include those. My guess is that this was done to avoid false positives when testing for flags, however it should be documented, preferably on the "Conditionals that Test Flags" page, so that someone wanting to test for the presence of -j can deduce that they need to do it in the commands using $(if) instead of using an ifeq/ifneq directive.

(There's probably no sane way to provide a MAKEFLAGS that includes options with arguments without also including their options. The best I can figure would be to put the option argument values (and internal options like --jobserver-fds) into their own hidden variables and reference those from MAKEFLAGS. I.e., this command:
make -I"My Desktop/include" -nw -j3

would result in the equivalent of
1 = --jobserver-fds=3,4
2 = "My Desktop/include"
MAKEFLAGS = wn ${1} -j -I ${2}

that would permit safe flag testing, even during deferred expansion, by using $(findstring) against this:
$(if $(filter --,$(value MAKEFLAGS)),$(filter-out -- $(lastword $(value MAKEFLAGS)),$(value MAKEFLAGS)),$(value MAKEFLAGS))

But I doubt anyone actually cares enough about the possibility of false positives against $(MAKEOVERRIDES) or the .POSIX equivalent to actually bother with that...)

Philip Guenther

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)
  • -unavailable- added by psmith (Philip Guenther)
  •  

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

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 22 May 2013 03:13:39 PM UTCpsmithCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup