summaryrefslogtreecommitdiff
path: root/src/output.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2020-03-30 14:07:10 -0400
committerPaul Smith <psmith@gnu.org>2020-03-31 00:17:49 -0400
commit8e024a253273a1e98b005d71c8ae4f6d2651fed4 (patch)
tree84db1882beac5d5d86a442ca06d2ea484e9b3b5d /src/output.c
parent660a2eafe52b8fad0dbee8ccddb990015dc68b54 (diff)
downloadmake-git-8e024a253273a1e98b005d71c8ae4f6d2651fed4.tar.gz
Obey order of multiple print/no-print directory options
Previously if --no-print-directory was seen anywhere even once (environment, command line, etc.) it would always take precedence over any --print-directory option. Change this so that the last seen option (which will be the command line, if present there) takes precedence. * NEWS: Mark this change in behavior. * src/makeint.h (print_directory): A new variable to control printing. * src/output.c (output_dump): Use the new variable. (output_start): Ditto. * src/main.c: Add a new variable print_directory. Use -1 for print_directory_flag so we know of the option was seen or not. Add a new default_print_directory_flag set to -1 to keep options from being added. (switches): Use flag_off for --no-print-directory, rather than a separate inhibit_print_directory_flag. (main): If print_directory_flag was set by the user, use that for print_directory. If not, compute the print_directory value based on -s, -C, and sub-makes as before. * tests/scripts/variables/GNUMAKEFLAGS: -w is not added automatically * tests/scripts/options/print-directory: Add tests for overriding print-directory options.
Diffstat (limited to 'src/output.c')
-rw-r--r--src/output.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/output.c b/src/output.c
index 22117496..4845f202 100644
--- a/src/output.c
+++ b/src/output.c
@@ -367,7 +367,7 @@ output_dump (struct output *out)
void *sem = acquire_semaphore ();
/* Log the working directory for this dump. */
- if (print_directory_flag && output_sync != OUTPUT_SYNC_RECURSE)
+ if (print_directory && output_sync != OUTPUT_SYNC_RECURSE)
traced = log_working_directory (1);
if (outfd_not_empty)
@@ -517,7 +517,7 @@ output_start (void)
/* If we're not syncing this output per-line or per-target, make sure we emit
the "Entering..." message where appropriate. */
if (output_sync == OUTPUT_SYNC_NONE || output_sync == OUTPUT_SYNC_RECURSE)
- if (! stdio_traced && print_directory_flag)
+ if (! stdio_traced && print_directory)
stdio_traced = log_working_directory (1);
}