summaryrefslogtreecommitdiff
path: root/src/remake.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2019-05-12 17:01:55 -0400
committerPaul Smith <psmith@gnu.org>2019-05-19 15:27:26 -0400
commitb5de783f77aa85ae8bd7a8e81d143e09a848fa29 (patch)
tree4abd147dc5cda1423c7fc2270c7b9ce8453e7a0c /src/remake.c
parent389dcb608fa1ee4d7d59b7c2df792e23dbe306c4 (diff)
downloadmake-git-b5de783f77aa85ae8bd7a8e81d143e09a848fa29.tar.gz
[SV 54740] Ensure .SILENT settings do not leak into sub-makes
Create a new variable run_silent to hold the current instance's global silence setting, allowing silent_flag to represent only whether the -s option was provided on the command line. * src/makeint.h: Change silent_flag variable to run_silent. * src/job.c: Ditto. * src/remake.c: Ditto. * src/file.c: Ditto. * src/main.c: Add a new global variable run_silent. (decode_switches): After switches are decoded, initialize run_silent. * tests/scripts/targets/SILENT: Add a test for recursive behavior.
Diffstat (limited to 'src/remake.c')
-rw-r--r--src/remake.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/remake.c b/src/remake.c
index 0f0a6d32..a331a63a 100644
--- a/src/remake.c
+++ b/src/remake.c
@@ -221,7 +221,7 @@ update_goal_chain (struct goaldep *goaldeps)
any commands were actually started for this goal. */
&& file->update_status == us_success && !g->changed
/* Never give a message under -s or -q. */
- && !silent_flag && !question_flag)
+ && !run_silent && !question_flag)
OS (message, 1, ((file->phony || file->cmds == 0)
? _("Nothing to be done for '%s'.")
: _("'%s' is up to date.")),
@@ -1144,7 +1144,7 @@ check_dep (struct file *file, unsigned int depth,
static enum update_status
touch_file (struct file *file)
{
- if (!silent_flag)
+ if (!run_silent)
OS (message, 0, "touch %s", file->name);
/* Print-only (-n) takes precedence over touch (-t). */