make/tests/scripts/options
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
..
dash-B Adjust output strings to be aligned 2023-04-02 10:02:18 -04:00
dash-C Convert references from "GNU make" to "GNU Make" 2023-01-01 17:05:12 -05:00
dash-d * src/main.c (decode_debug_flags): [SV 607777] Preserve -d options 2021-09-06 20:36:15 -04:00
dash-e [SV 61218] Ensure MAKEFLAGS is expanded even with -e 2023-01-08 16:40:55 -05:00
dash-f * tests/scripts/features/reinvoke: Warn about closing STDIN. 2023-01-11 20:35:11 -05:00
dash-I tests [WINDOWS32]: Support Strawberry Perl on Windows 2022-12-20 02:14:18 -05:00
dash-k tests: Run each file in a separate directory 2023-04-02 17:32:09 -04:00
dash-l * tests/scripts/options/dash-l: Simplify the test via the helper 2023-02-26 13:46:02 -05:00
dash-n * tests/run_make_test.pl: Fix support for valgrind. 2019-09-21 15:13:24 -04:00
dash-q [SV 47151] Exit with 1 when checking recursive make -q 2016-02-29 01:33:50 -05:00
dash-r [SV 64107] Disable builtins immediately on -R or -r 2023-04-30 09:40:50 -04:00
dash-s [SV 63537] Document and test flippable switches 2022-12-18 20:06:38 -05:00
dash-t Commit fix for bug #1418. 2003-03-25 00:15:25 +00:00
dash-W Adjust output strings to be aligned 2023-04-02 10:02:18 -04:00
eval Add test suite support to Windows 2017-06-04 18:37:20 -04:00
general Add test suite support to Windows 2017-06-04 18:37:20 -04:00
print-directory Convert references from "GNU make" to "GNU Make" 2023-01-01 17:05:12 -05:00
print-targets [SV 64571] Add --print-targets option 2024-01-08 23:31:58 -05:00
shuffle Adjust output strings to be aligned 2023-04-02 10:02:18 -04:00
symlinks tests: Run each file in a separate directory 2023-04-02 17:32:09 -04:00
warn [SV 64115] Suppress warnings about undefined GNUMAKEFLAGS 2023-04-30 09:40:50 -04:00