summaryrefslogtreecommitdiff
path: root/src/filedef.h
diff options
context:
space:
mode:
authorDmitry Goncharov <dgoncharov@users.sf.net>2022-07-24 18:16:50 -0400
committerPaul Smith <psmith@gnu.org>2022-07-30 18:40:28 -0400
commit07eea3aa496184bb763b7306e9de6a40a94605c9 (patch)
treef0b5e2b330b6ef40627b7050738c603aec4cd79b /src/filedef.h
parent16e14b4114c0c9cc14d15e818bf22588a79e39da (diff)
downloadmake-git-07eea3aa496184bb763b7306e9de6a40a94605c9.tar.gz
[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.
Diffstat (limited to 'src/filedef.h')
-rw-r--r--src/filedef.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/filedef.h b/src/filedef.h
index 4330d787..1eb8f61c 100644
--- a/src/filedef.h
+++ b/src/filedef.h
@@ -110,6 +110,8 @@ struct file
diagnostics has been issued (dontcare). */
unsigned int was_shuffled:1; /* Did we already shuffle 'deps'? used when
--shuffle passes through the graph. */
+ unsigned int snapped:1; /* True if the deps of this file have been
+ secondary expanded. */
};
@@ -120,6 +122,7 @@ struct file *lookup_file (const char *name);
struct file *enter_file (const char *name);
struct dep *split_prereqs (char *prereqstr);
struct dep *enter_prereqs (struct dep *prereqs, const char *stem);
+void expand_deps (struct file *f);
struct dep *expand_extra_prereqs (const struct variable *extra);
void remove_intermediates (int sig);
void snap_deps (void);