From 6c9a393f954805d49ab6c66957b46199ddd6e78e Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Tue, 9 Jul 2002 06:35:56 +0000 Subject: Documentation and tests for order-only prerequisites. Add a new test suite for automatic variables. --- read.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'read.c') 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); -- cgit v1.2.3