summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c19
1 files changed, 17 insertions, 2 deletions
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)