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. --- file.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'file.c') diff --git a/file.c b/file.c index 2602810..1e87443 100644 --- a/file.c +++ b/file.c @@ -680,15 +680,30 @@ static void print_file (f) struct file *f; { - register struct dep *d; + struct dep *d; + struct dep *ood = 0; putchar ('\n'); if (!f->is_target) puts (_("# Not a target:")); printf ("%s:%s", f->name, f->double_colon ? ":" : ""); + /* Print all normal dependencies; note any order-only deps. */ for (d = f->deps; d != 0; d = d->next) - printf (" %s", dep_name (d)); + if (! d->ignore_mtime) + printf (" %s", dep_name (d)); + else if (! ood) + ood = d; + + /* Print order-only deps, if we have any. */ + if (ood) + { + printf (" | %s", dep_name (ood)); + for (d = ood->next; d != 0; d = d->next) + if (d->ignore_mtime) + printf (" %s", dep_name (d)); + } + putchar ('\n'); if (f->precious) -- cgit v1.2.3