]> git.ipfire.org Git - thirdparty/make.git/commit
[SV 62706] Only second-expand targets that might be built
authorDmitry Goncharov <dgoncharov@users.sf.net>
Sun, 24 Jul 2022 22:16:50 +0000 (18:16 -0400)
committerPaul Smith <psmith@gnu.org>
Sat, 30 Jul 2022 22:40:28 +0000 (18:40 -0400)
commit07eea3aa496184bb763b7306e9de6a40a94605c9
treef0b5e2b330b6ef40627b7050738c603aec4cd79b
parent16e14b4114c0c9cc14d15e818bf22588a79e39da
[SV 62706] Only second-expand targets that might be built

Second-expand only the prerequisites of the targets being built.
Defer second-expanding the prerequisites of targets until we need
to decide if they should be built.

* NEWS: Mention the change in behavior.
* doc/make.texi (Secondary Expansion): Document the new behavior.
* src/filedef.h (struct file): Add flag snapped.
(expand_deps): Declare a function to second expand the
prerequisites of a target.
* src/file.c (rehash_file): Merge flag snapped.
(expand_deps): Remove qualifier static. Check flag snapped.
(snap_deps): Remove the loop which performed second expansion for all
targets.
* src/remake.c (update_file_1): Second expand the prerequisites of
the considered target.
* tests/scripts/features/se_explicit: Add tests.
* tests/scripts/features/se_implicit: Ditto.
* tests/scripts/features/se_statpat: Ditto.
NEWS
doc/make.texi
src/file.c
src/filedef.h
src/remake.c
tests/scripts/features/se_explicit
tests/scripts/features/se_implicit
tests/scripts/features/se_statpat