From 543521cd475e7182e30a17bd032b9fe2bb740bcb Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 29 Sep 2013 13:15:00 -0400 Subject: Reset GNUMAKEFLAGS after parsing. If we don't do this we'll continually add flags on recursion. This is mainly for users to set in their environment before invoking make. --- doc/make.texi | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'doc') diff --git a/doc/make.texi b/doc/make.texi index f89f8b7..42cec7f 100644 --- a/doc/make.texi +++ b/doc/make.texi @@ -4808,10 +4808,17 @@ to GNU @code{make}, and hence do not want to add GNU @code{make}-specific flags to the @code{MAKEFLAGS} variable, you can add them to the @code{GNUMAKEFLAGS} variable instead. This variable is parsed just before @code{MAKEFLAGS}, in the same way as -@code{MAKEFLAGS}. Note, however, that when @code{make} constructs -@code{MAKEFLAGS} to pass to a recursive @code{make} it will include -all flags. GNU @code{make} never sets the @code{GNUMAKEFLAGS} -variable itself. +@code{MAKEFLAGS}. When @code{make} constructs @code{MAKEFLAGS} to +pass to a recursive @code{make} it will include all flags, even those +taken from @code{GNUMAKEFLAGS}. As a result, after parsing +@code{GNUMAKEFLAGS} GNU @code{make} sets this variable to the empty +string to avoid duplicating flags during recursion. + +It's best to use @code{GNUMAKEFLAGS} only with flags which won't +materially change the behavior of your makefiles. If your makefiles +require GNU make anyway then simply use @code{MAKEFLAGS}. Flags such +as @samp{--no-print-directory} or @samp{--output-sync} may be +appropriate for @code{GNUMAKEFLAGS}. @node -w Option, , Options/Recursion, Recursion @subsection The @samp{--print-directory} Option -- cgit v1.2.3