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

Add a New Comment(Rich 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



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

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)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    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.3