summaryrefslogtreecommitdiff
path: root/implicit.c
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@kolpackov.net>2004-09-21 20:23:12 +0000
committerBoris Kolpackov <boris@kolpackov.net>2004-09-21 20:23:12 +0000
commit73e7767ffc14fad98dd2e78791a1237bcb3d6fe3 (patch)
tree4772e03f4350bbebfde62605316e340153d4813a /implicit.c
parent6e51d9c90a92933e6cf84ae494076b6b1cd17c3b (diff)
downloadgunmake-73e7767ffc14fad98dd2e78791a1237bcb3d6fe3.tar.gz
Fixed bug in implicit rule prerequisite evaluation code. Added test.
Diffstat (limited to 'implicit.c')
-rw-r--r--implicit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/implicit.c b/implicit.c
index 165afdb..10b41ff 100644
--- a/implicit.c
+++ b/implicit.c
@@ -342,6 +342,8 @@ pattern_search (struct file *file, int archive,
deps_found = 0;
for (dep = rule->deps; dep != 0; dep = dep->next)
{
+ struct file *f;
+
/* If the dependency name has a %, substitute the stem. */
p = strchr (dep_name (dep), '%');
if (p != 0)
@@ -396,7 +398,7 @@ pattern_search (struct file *file, int archive,
directory (the one gotten by prepending FILENAME's directory),
so it might actually exist. */
- if (lookup_file (p) != 0
+ if (((f = lookup_file (p)) != 0 && f->is_target)
|| ((!dep->changed || check_lastslash) && file_exists_p (p)))
{
found_files_im[deps_found] = dep->ignore_mtime;