make/tests/scripts
Paul Smith 31036e648f [SV 64571] Add --print-targets option
Add an option to print a list of targets defined in the makefiles.
Don't print targets of implicit rules, or special targets.  To
support this remember which files are deemed suffix rule targets.

Add a missing warning for single-suffix targets with prerequisites.

Suggested by many.  Sample implementation by Tim <tdhutt@gmail.com>.

* NEWS: Announce the new option and single-suffix warning.
* doc/make.1: Add --print-targets to the man page.
* doc/make.texi: Add --print-targets to the documentation.  Clean up
the text around the definition of suffix rules.
* src/main.c (print_targets_flag): New variable for --print-targets.
(switches): Add a new long option --print-targets.
(main): If the option was provided call print_targets() and exit.
* src/filedef.h (struct file): Add a "suffix" boolean value.  Remove
print_prereqs() since it's static.  Add new print_targets().
* src/file.c (rehash_file): Merge the new suffix value.
(print_prereqs): Used only locally: change to static.
(print_target): Print targets which are not suffix rule targets and
are not special targets.
(print_targets): Call print_target() on each file.
* src/rule.c (convert_to_pattern): Make maxsuffix local; it doesn't
need to be static.  Emit ignoring prerequisites for single-suffix
rules as well as double-suffix rules.  Remember which files are
actually suffix rules.
* tests/scripts/features/suffixrules: Test single-suffix behavior.
* tests/scripts/options/print-targets: Add tests for --print-targets.
2024-01-08 23:31:58 -05:00
..
features [SV 64571] Add --print-targets option 2024-01-08 23:31:58 -05:00
functions * src/function.c (func_let): Don't edit nonexistent values 2024-01-01 19:31:37 -05:00
misc tests: Run each file in a separate directory 2023-04-02 17:32:09 -04:00
options [SV 64571] Add --print-targets option 2024-01-08 23:31:58 -05:00
targets * tests/scripts/targets/WAIT: Add whitespace to avoid W32 issues 2023-04-02 17:30:27 -04:00
variables [SV 65006] Allow secondary expansion of .EXTRA_PREREQS 2024-01-06 17:39:43 -05:00
vms Convert references from "GNU make" to "GNU Make" 2023-01-01 17:05:12 -05:00
test_template Update the test template. A few fixes in run_make_test(). 2004-09-22 04:36:17 +00:00