URL: <http://savannah.gnu.org/bugs/?26596>
Summary: MAKEFLAGS documentation tweak Project: make 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 Discussion Lock: Any Component Version: 3.81 Operating System: Any Fixed Release: None _______________________________________________________ Details: 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 _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?26596> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-make mailing list Bug-make@gnu.org http://lists.gnu.org/mailman/listinfo/bug-make