summaryrefslogtreecommitdiff
path: root/file.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 /file.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 '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)