]> git.ipfire.org Git - thirdparty/make.git/commit
[SV 58341] Add non-trivial options to $(MAKEFLAGS)
authorPaul Smith <psmith@gnu.org>
Mon, 19 Apr 2021 21:27:54 +0000 (17:27 -0400)
committerPaul Smith <psmith@gnu.org>
Sun, 30 May 2021 19:11:30 +0000 (15:11 -0400)
commitf2771aa614d3a826b70973217c33f605fb4cd0c2
tree177cff419b52bc7e396ee372bb2edb0e1333d244
parent5e829188d3595c8749f9e7bcbe4b515c085779a6
[SV 58341] Add non-trivial options to $(MAKEFLAGS)

Previously only trivial (single-letter) options were available in
$(MAKEFLAGS) when it is examined from inside a makefile (the full
value was set before expanding recipes).

Ensure that all options (but, not command line variable overrides!)
are visible in the $(MAKEFLAGS) variable.  In order to do this
reset the default values of options, particularly options which are
lists, before re-reading MAKEFLAGS after makefiles have been read.
Otherwise we'll get duplicate values for options such as -I.

Unfortunately there are complications here as well: sometimes (for
jobserver options in particular) we modify the values of these
options while running: we must not reset these modifications.

* NEWS: Announce this change
* src/main.c (main): Call new reset_switches() before re-parsing
MAKEFLAGS.
(reset_switches): Reset the value of non-special options to their
defaults.
(define_makeflags): Add non-special options into MAKEFLAGS even
if 'all' is not set.
NEWS
src/main.c