* Each backslash/newline (plus subsequent whitespace) is converted to a
single space
-* New command line option: --trace enables tracing of targets. When enabled
- the recipe to be invoked is printed even if it would otherwise be suppressed
- by .SILENT or a "@" prefix character. Also before each recipe is run the
- makefile name and linenumber where it was defined are shown as well as the
- prerequisites that caused the target to be considered out of date.
-
* New command line option: --output-sync (-O) enables grouping of output by
target or by recursive make. This is useful during parallel builds to avoid
mixing output from different jobs together giving hard-to-understand
Reworked and enhanced by Frank Heckenbach <f.heckenbach@fh-soft.de>.
Windows support by Eli Zaretskii <eliz@gnu.org>.
+* New command line option: --trace enables tracing of targets. When enabled
+ the recipe to be invoked is printed even if it would otherwise be suppressed
+ by .SILENT or a "@" prefix character. Also before each recipe is run the
+ makefile name and linenumber where it was defined are shown as well as the
+ prerequisites that caused the target to be considered out of date. If the
+ "dir" option argument is given, it will display directory enter/leave
+ logging around each block of synchronized output.
+
* New feature: The "job server" capability is now supported on Windows.
Implementation contributed by Troy Runkel <Troy.Runkel@mathworks.com>
* New function: $(file ...) writes to a file.
+* New variable: $(GNUMAKEFLAGS) will be parsed for make flags, just like
+ MAKEFLAGS is. It can be set in the environment or the makefile, containing
+ GNU make-specific flags to allow your makefile to be portable to other
+ versions of make. GNU make never sets or modifies GNUMAKEFLAGS.
+
* On failure, the makefile name and linenumber of the recipe that failed are
shown.
#endif
#endif /* !VMS */
+ /* Make this assignment to avoid undefined variable warnings. */
+ "GNUMAKEFLAGS", "",
0, 0
};
\f
put in one of these variables, could have disastrous consequences and would
certainly have at least surprising and probably annoying effects.@refill
+If you'd like to run other implementations of @code{make} in addition
+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.
+
@node -w Option, , Options/Recursion, Recursion
@subsection The @samp{--print-directory} Option
@cindex directories, printing them
shell. Always allow recursive @code{make}'s to obtain these values
through the environment from its parent.
+@item GNUMAKEFLAGS
+
+Other flags parsed by @code{make}. You can set this in the environment or
+a makefile to set @code{make} command-line flags. GNU @code{make}
+never sets this variable itself. This variable is only needed if
+you'd like to set GNU @code{make}-specific flags in a POSIX-compliant
+makefile. This variable will be seen by GNU @code{make} and ignored
+by other @code{make} implementations. It's not needed if you only use
+GNU @code{make}; just use @code{MAKEFLAGS} directly.
+
@item MAKECMDGOALS
The targets given to @code{make} on the command line. Setting this
/* Decode the switches. */
+ decode_env_switches (STRING_SIZE_TUPLE ("GNUMAKEFLAGS"));
decode_env_switches (STRING_SIZE_TUPLE ("MAKEFLAGS"));
+
#if 0
/* People write things like:
MFLAGS="CC=gcc -pipe" "CFLAGS=-g"
#endif /* __MSDOS__ || __EMX__ */
/* Decode switches again, in case the variables were set by the makefile. */
+ decode_env_switches (STRING_SIZE_TUPLE ("GNUMAKEFLAGS"));
decode_env_switches (STRING_SIZE_TUPLE ("MAKEFLAGS"));
#if 0
decode_env_switches (STRING_SIZE_TUPLE ("MFLAGS"));
--- /dev/null
+# -*-perl-*-
+
+$description = "Test proper behavior of GNUMAKEFLAGS";
+
+# Accept flags from GNUMAKEFLAGS as well as MAKEFLAGS
+# Results always go in MAKEFLAGS
+
+$extraENV{'GNUMAKEFLAGS'} = '-e -r -R';
+
+run_make_test(q!
+all: ; @echo $(MAKEFLAGS)
+!,
+ '', 'Rre');
+
+# Long arguments mean everything is prefixed with "-"
+
+$extraENV{'GNUMAKEFLAGS'} = '--no-print-directory -e -r -R --trace=none --trace=dir';
+
+run_make_test(q!
+all: ; @echo $(MAKEFLAGS)
+!,
+ '', '--no-print-directory --trace=none --trace=dir --trace=none --trace=dir -Rre');
+
+1;