]> git.ipfire.org Git - thirdparty/make.git/commit
Support the .EXTRA_PREREQS special variable
authorPaul Smith <psmith@gnu.org>
Thu, 2 Jan 2020 10:08:06 +0000 (05:08 -0500)
committerPaul Smith <psmith@gnu.org>
Fri, 3 Jan 2020 07:08:59 +0000 (02:08 -0500)
commit4e12a5fa458e8e6a28d6728d5d14a9dbc25f6bef
tree4c5301da843bcec66104e548ee72d43b017335b5
parente56243fe57710124d4e5eb6c05179065f49d1333
Support the .EXTRA_PREREQS special variable

Initial implementation by Christof Warlich <cwarlich@gmx.de>

* NEWS: Announce the new feature.
* doc/make.texi (Other Special Variables): Document .EXTRA_PREREQS.
* src/dep.h (struct dep): New flag to note extra prereq deps.
* src/filedef.h (expand_extra_prereqs): Declare a function to expand
the value of .EXTRA_PREREQS.
* src/file.c (expand_extra_prereqs): Given a struct variable lookup
of .EXTRA_PREREQS, convert it into a list of deps and for each one
make sure it has a struct file and has the new flag set.
(snap_file): A new function invoked by hash_map that will perform
per-file operations: set up second expansion, intermediate, and also
.EXTRA_PREREQS.  Manage circular dependencies by ignoring them.
(snap_deps): Defer per-file operations until the end.  Look up the
global .EXTRA_PREREQS and pass it along to snap_file for each file.
* src/implicit.c (struct patdeps): Remember the extra prereqs flag.
(pattern_search): Transfer extra prereqs flag settings into the
matched pattern rule.
* src/rule.h (snap_implicit_rules): Rename count_implicit_rules to
snap_implicit_rules since we now do more than count.
* src/rule.c (snap_implicit_rules): As we walk through all the pattern
rules, add in any global .EXTRA_PREREQS to the dep list.  Ensure we
take them into account for the max number of prereqs and name length.
* src/main.c (main): Add extra-prereqs to .FEATURES.
Call the renamed snap_implicit_rules.
* tests/scripts/variables/EXTRA_PREREQS: Add tests.
12 files changed:
AUTHORS
NEWS
doc/make.texi
src/commands.c
src/dep.h
src/file.c
src/filedef.h
src/implicit.c
src/main.c
src/rule.c
src/rule.h
tests/scripts/variables/EXTRA_PREREQS [new file with mode: 0644]