summaryrefslogtreecommitdiff
path: root/read.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2002-07-09 06:35:56 +0000
committerPaul Smith <psmith@gnu.org>2002-07-09 06:35:56 +0000
commit6c9a393f954805d49ab6c66957b46199ddd6e78e (patch)
tree88a3c6a2e807a1356d4bcca1ecca91a6cc037ee5 /read.c
parent724925be2b9a48f7911ee6baa315b872bd86995c (diff)
downloadgunmake-6c9a393f954805d49ab6c66957b46199ddd6e78e.tar.gz
Documentation and tests for order-only prerequisites.
Add a new test suite for automatic variables.
Diffstat (limited to 'read.c')
-rw-r--r--read.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/read.c b/read.c
index 510266a..4b7c79c 100644
--- a/read.c
+++ b/read.c
@@ -1524,10 +1524,17 @@ uniquize_deps (chain)
last = d;
next = d->next;
while (next != 0)
- if (streq (dep_name (d), dep_name (next))
- && d->ignore_mtime == next->ignore_mtime)
+ if (streq (dep_name (d), dep_name (next)))
{
struct dep *n = next->next;
+ /* If ignore_mtimes are not equal, one of these is an order-only
+ prerequisite and one isn't. That means that we should remove
+ the one that isn't and keep the one that is. Ideally we'd
+ like to keep the normal one always but that's hard, and
+ probably not very important, so just remove the second one and
+ force the first one to be normal. */
+ if (d->ignore_mtime != next->ignore_mtime)
+ d->ignore_mtime = 0;
last->next = n;
if (next->name != 0 && next->name != d->name)
free (next->name);