make/tests/scripts/features
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
..
archives * tests/scripts/features/archives: Set CC properly 2023-02-19 14:49:56 -05:00
comments * tests/scripts/features/comments: Add missing "1;" 2023-05-06 14:45:09 -04:00
conditionals [SV 64402] Correct locating "," in ifeq/ifneq conditionals 2024-01-06 17:42:40 -05:00
default_names Add preprocessor macros for different platforms 2022-10-18 14:20:44 -04:00
dircache [SV 41273] Allow the directory cache to be invalidated 2020-11-29 17:59:16 -05:00
double_colon * tests/scripts/features/double_colon: Test parallel double-colon rules 2023-04-30 09:40:50 -04:00
echoing Portability changes for the test suite. 2016-12-26 09:01:59 -05:00
errors tests [WINDOWS32]: Support Strawberry Perl on Windows 2022-12-20 02:14:18 -05:00
escape Add test suite support to Windows 2017-06-04 18:37:20 -04:00
exec Clean up memory leak warnings from ASAN and Valgrind 2023-04-01 11:13:12 -04:00
expand [SV 64124] Avoid stack overflows for large command lines 2023-06-19 13:27:50 -04:00
export Convert references from "GNU make" to "GNU Make" 2023-01-01 17:05:12 -05:00
grouped_targets [SV 12078, SV 62809] Rebuild grouped targets if any is missing 2022-09-20 03:55:39 -04:00
implicit_search Adjust output strings to be aligned 2023-04-02 10:02:18 -04:00
include Adjust output strings to be aligned 2023-04-02 10:02:18 -04:00
jobserver [SV 63981] Don't warn on explicit -j1 2023-04-02 10:29:37 -04:00
load Remove the "preview" status from the loaded object feature 2023-05-07 16:51:06 -04:00
loadapi [SV 63219] Support an "unload" function for loaded objects 2023-05-14 18:26:35 -04:00
mult_rules Adjust output strings to be aligned 2023-04-02 10:02:18 -04:00
mult_targets
order_only
output-sync Clean up memory leak warnings from ASAN and Valgrind 2023-04-01 11:13:12 -04:00
override
parallelism Avoid using false(1) in regression tests 2022-12-31 10:51:24 -05:00
patspecific_vars [SV 39709] Fix some typos. 2013-10-09 01:53:55 -04:00
patternrules Adjust output strings to be aligned 2023-04-02 10:02:18 -04:00
quoting Add test suite support to Windows 2017-06-04 18:37:20 -04:00
recursion [SV 46013] Allow recursive variable overrides from Makefiles 2019-05-19 19:25:50 -04:00
reinvoke * tests/scripts/features/reinvoke: Warn about closing STDIN. 2023-01-11 20:35:11 -05:00
rule_glob [Bug #39310] Parse simple pattern prereqs for globbing. 2013-07-22 02:23:02 -04:00
se_explicit Adjust output strings to be aligned 2023-04-02 10:02:18 -04:00
se_implicit Fix tests for MacOS and Windows 2022-08-30 21:05:34 -04:00
se_statpat Fix tests for MacOS and Windows 2022-08-30 21:05:34 -04:00
shell_assignment [SV 62654] Support GNU Make on z/OS 2023-01-08 10:45:38 -05:00
statipattrules Apply spelling fixes discovered by Codespell 2022-12-31 13:21:09 -05:00
suffixrules [SV 64571] Add --print-targets option 2024-01-08 23:31:58 -05:00
targetvars Special-case Windows error results 2021-11-28 14:27:10 -05:00
temp_stdin Clean up memory leak warnings from ASAN and Valgrind 2023-04-01 11:13:12 -04:00
utf8
varnesting Fix issues found by ASAN and Coverity 2022-10-31 02:23:04 -04:00
vpath tests: Run each file in a separate directory 2023-04-02 17:32:09 -04:00
vpathgpath tests: Run each file in a separate directory 2023-04-02 17:32:09 -04:00
vpathplus tests: Run each file in a separate directory 2023-04-02 17:32:09 -04:00