bugmake - Bugs: bug #26596, MAKEFLAGS documentation tweak

 
 

bug #26596: MAKEFLAGS documentation tweak

Submitter:  None
Submitted:  Sun 17 May 2009 12:01:32 AM UTC
   
 
Severity:  3 - Normal Item Group:  Enhancement
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
Component Version:  3.81 Operating System:  Any
Fixed Release:  None Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by psmith (Philip Guenther)
  •  

    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.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-05-22 psmith Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code