summaryrefslogtreecommitdiff
path: root/rule.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1993-10-18 11:04:04 +0000
committerRoland McGrath <roland@redhat.com>1993-10-18 11:04:04 +0000
commit7c456a73686ced966739157bfe31a2971b09c032 (patch)
tree8a4940523aaa3139c1ccd6c6eeb249b11329ec77 /rule.c
parenta8c24526e39658ec717f70f27e8b0d4dbf80394c (diff)
downloadgunmake-7c456a73686ced966739157bfe31a2971b09c032.tar.gz
Formerly rule.c.~16~
Diffstat (limited to 'rule.c')
-rw-r--r--rule.c50
1 files changed, 29 insertions, 21 deletions
diff --git a/rule.c b/rule.c
index 027aa29..98d7010 100644
--- a/rule.c
+++ b/rule.c
@@ -503,13 +503,37 @@ create_pattern_rule (targets, target_percents,
/* Print the data base of rules. */
+static void /* Useful to call from gdb. */
+print_rule (r)
+ struct rule *r;
+{
+ register unsigned int i;
+ register struct dep *d;
+
+ for (i = 0; r->targets[i] != 0; ++i)
+ {
+ fputs (r->targets[i], stdout);
+ if (r->targets[i + 1] != 0)
+ putchar (' ');
+ else
+ putchar (':');
+ }
+ if (r->terminal)
+ putchar (':');
+
+ for (d = r->deps; d != 0; d = d->next)
+ printf (" %s", dep_name (d));
+ putchar ('\n');
+
+ if (r->cmds != 0)
+ print_commands (r->cmds);
+}
+
void
print_rule_data_base ()
{
register unsigned int rules, terminal;
register struct rule *r;
- register struct dep *d;
- register unsigned int i;
puts ("\n# Implicit Rules");
@@ -519,26 +543,10 @@ print_rule_data_base ()
++rules;
putchar ('\n');
- for (i = 0; r->targets[i] != 0; ++i)
- {
- fputs (r->targets[i], stdout);
- if (r->targets[i + 1] != 0)
- putchar (' ');
- else
- putchar (':');
- }
- if (r->terminal)
- {
- ++terminal;
- putchar (':');
- }
+ print_rule (r);
- for (d = r->deps; d != 0; d = d->next)
- printf (" %s", dep_name (d));
- putchar ('\n');
-
- if (r->cmds != 0)
- print_commands (r->cmds);
+ if (r->terminal)
+ ++terminal;
}
if (rules == 0)