not print the recipe used to remake those particular files before
executing them. The recipe for @code{.SILENT} is ignored.
-If mentioned as a target with no prerequisites, @code{.SILENT} says not
-to print any recipes before executing them. This usage of
-@samp{.SILENT} is supported only for historical compatibility. We
-recommend you use the more selective ways to silence specific recipes.
+If mentioned as a target with no prerequisites, @code{.SILENT} says
+not to print any recipes before executing them. You may also use more
+selective ways to silence specific recipe command lines.
@xref{Echoing, ,Recipe Echoing}. If you want to silence all recipes
for a particular run of @code{make}, use the @samp{-s} or
@w{@samp{--silent}} option (@pxref{Options Summary}).
flag to @code{make} prevents all echoing, as if all recipes
started with @samp{@@}. A rule in the makefile for the special target
@code{.SILENT} without prerequisites has the same effect
-(@pxref{Special Targets, ,Special Built-in Target Names}).
-@code{.SILENT} is essentially obsolete since @samp{@@} is more flexible.@refill
+(@pxref{Special Targets, ,Special Built-in Target Names}).@refill
@node Execution, Parallel, Echoing, Recipes
@section Recipe Execution
/* Nonzero means do not print commands to be executed (-s). */
int silent_flag;
+static const int default_silent_flag = 0;
/* Nonzero means just touch the files
that would appear to need remaking (-t) */
/* Nonzero means keep going even if remaking some file fails (-k). */
int keep_going_flag;
-int default_keep_going_flag = 0;
+static const int default_keep_going_flag = 0;
/* Nonzero means check symlink mtimes. */
N_("\
-s, --silent, --quiet Don't echo recipes.\n"),
N_("\
+ --no-silent Echo recipes (disable --silent mode).\n"),
+ N_("\
-S, --no-keep-going, --stop\n\
Turns off -k.\n"),
N_("\
{ 'r', flag, &no_builtin_rules_flag, 1, 1, 0, 0, 0, "no-builtin-rules" },
{ 'R', flag, &no_builtin_variables_flag, 1, 1, 0, 0, 0,
"no-builtin-variables" },
- { 's', flag, &silent_flag, 1, 1, 0, 0, 0, "silent" },
+ { 's', flag, &silent_flag, 1, 1, 0, 0, &default_silent_flag, "silent" },
{ 'S', flag_off, &keep_going_flag, 1, 1, 0, 0, &default_keep_going_flag,
"no-keep-going" },
{ 't', flag, &touch_flag, 1, 1, 1, 0, 0, "touch" },
"warn-undefined-variables" },
{ CHAR_MAX+6, strlist, &eval_strings, 1, 0, 0, 0, 0, "eval" },
{ CHAR_MAX+7, string, &sync_mutex, 1, 1, 0, 0, 0, "sync-mutex" },
- { CHAR_MAX+8, string, &jobserver_auth, 1, 0, 0, 0, 0, "jobserver-fds" },
+ { CHAR_MAX+8, flag_off, &silent_flag, 1, 1, 0, 0, &default_silent_flag, "no-silent" },
+ { CHAR_MAX+9, string, &jobserver_auth, 1, 0, 0, 0, 0, "jobserver-fds" },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
--- /dev/null
+# -*-perl-*-
+
+$description = "Test the -s (silent) and --no-silent options.\n";
+
+run_make_test(q!
+all: one two
+one: ; @echo MAKEFLAGS=$$MAKEFLAGS
+two: ; echo two
+!,
+ '', "MAKEFLAGS=\necho two\ntwo");
+
+run_make_test(undef, '-s', "MAKEFLAGS=s\ntwo");
+run_make_test(undef, '--silent', "MAKEFLAGS=s\ntwo");
+run_make_test(undef, '--quiet', "MAKEFLAGS=s\ntwo");
+
+run_make_test(undef, '--no-silent', "MAKEFLAGS=\necho two\ntwo");
+
+run_make_test(undef, '-s --no-silent', "MAKEFLAGS=\necho two\ntwo");
+run_make_test(undef, '--silent --no-silent', "MAKEFLAGS=\necho two\ntwo");
+run_make_test(undef, '--quiet --no-silent', "MAKEFLAGS=\necho two\ntwo");
+
+run_make_test(undef, '--no-silent -s', "MAKEFLAGS=s\ntwo");
+run_make_test(undef, '--no-silent --silent', "MAKEFLAGS=s\ntwo");
+run_make_test(undef, '--no-silent --quiet', "MAKEFLAGS=s\ntwo");
+
+1;