]> git.ipfire.org Git - thirdparty/make.git/commit
Obey order of multiple print/no-print directory options
authorPaul Smith <psmith@gnu.org>
Mon, 30 Mar 2020 18:07:10 +0000 (14:07 -0400)
committerPaul Smith <psmith@gnu.org>
Tue, 31 Mar 2020 04:17:49 +0000 (00:17 -0400)
commit8e024a253273a1e98b005d71c8ae4f6d2651fed4
tree84db1882beac5d5d86a442ca06d2ea484e9b3b5d
parent660a2eafe52b8fad0dbee8ccddb990015dc68b54
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.
NEWS
src/main.c
src/makeint.h
src/output.c
tests/scripts/options/print-directory
tests/scripts/variables/GNUMAKEFLAGS