mirror of
https://salsa.debian.org/srivasta/make-dfsg.git
synced 2024-12-25 05:29:47 +00:00
Formerly implicit.c.~14~
This commit is contained in:
parent
5003c9b26b
commit
7789ea8a3c
1 changed files with 16 additions and 25 deletions
25
implicit.c
25
implicit.c
|
@ -113,7 +113,8 @@ pattern_search (file, archive, depth, recursions)
|
|||
|
||||
/* Buffer in which we store all the rules that are possibly applicable. */
|
||||
struct rule **tryrules
|
||||
= (struct rule **) alloca (num_pattern_rules * sizeof (struct rule *));
|
||||
= (struct rule **) alloca (num_pattern_rules * max_pattern_targets
|
||||
* sizeof (struct rule *));
|
||||
|
||||
/* Number of valid elements in TRYRULES. */
|
||||
unsigned int nrules;
|
||||
|
@ -164,9 +165,6 @@ pattern_search (file, archive, depth, recursions)
|
|||
nrules = 0;
|
||||
for (rule = pattern_rules; rule != 0; rule = rule->next)
|
||||
{
|
||||
int specific_rule_may_have_matched = 0;
|
||||
int check_lastslash;
|
||||
|
||||
/* If the pattern rule has deps but no commands, ignore it.
|
||||
Users cancel built-in rules by redefining them without commands. */
|
||||
if (rule->deps != 0 && rule->cmds == 0)
|
||||
|
@ -184,6 +182,7 @@ pattern_search (file, archive, depth, recursions)
|
|||
{
|
||||
char *target = rule->targets[i];
|
||||
char *suffix = rule->suffixes[i];
|
||||
int check_lastslash;
|
||||
|
||||
/* Rules that can match any filename and are not terminal
|
||||
are ignored if we're recursing, so that they cannot be
|
||||
|
@ -237,30 +236,22 @@ pattern_search (file, archive, depth, recursions)
|
|||
|
||||
/* Record if we match a rule that not all filenames will match. */
|
||||
if (target[1] != '\0')
|
||||
specific_rule_may_have_matched = 1;
|
||||
|
||||
/* We have a matching target. Don't search for any more. */
|
||||
break;
|
||||
}
|
||||
|
||||
/* None of the targets matched. */
|
||||
if (rule->targets[i] == 0)
|
||||
continue;
|
||||
|
||||
specific_rule_matched |= specific_rule_may_have_matched;
|
||||
specific_rule_matched = 1;
|
||||
|
||||
/* A rule with no dependencies and no commands exists solely to set
|
||||
specific_rule_matched when it matches. Don't try to use it. */
|
||||
if (rule->deps == 0 && rule->cmds == 0)
|
||||
continue;
|
||||
|
||||
/* Record this rule in TRYRULES and the index
|
||||
of the (first) matching target in MATCHES. */
|
||||
/* Record this rule in TRYRULES and the index of the matching
|
||||
target in MATCHES. If several targets of the same rule match,
|
||||
that rule will be in TRYRULES more than once. */
|
||||
tryrules[nrules] = rule;
|
||||
matches[nrules] = i;
|
||||
checked_lastslash[nrules] = check_lastslash;
|
||||
++nrules;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we have found a matching rule that won't match all filenames,
|
||||
retroactively reject any "terminal" rules that do always match. */
|
||||
|
|
Loading…
Reference in a new issue