477 |
|
|
478 |
/* Try each dependency; see if it "exists". */ |
/* Try each dependency; see if it "exists". */ |
479 |
|
|
|
/* @@ There is always only one dep line for any given implicit |
|
|
rule. So the loop is not necessary. Can rule->deps be 0? |
|
|
|
|
|
Watch out for conversion of suffix rules to implicit rules. |
|
|
*/ |
|
|
|
|
480 |
for (dep = rule->deps; dep != 0; dep = dep->next) |
for (dep = rule->deps; dep != 0; dep = dep->next) |
481 |
{ |
{ |
482 |
unsigned int len; |
unsigned int len; |
507 |
we just replace % with the stem value, later, when we do |
we just replace % with the stem value, later, when we do |
508 |
the second expansion, we will re-expand this stem value |
the second expansion, we will re-expand this stem value |
509 |
once again. This is not good especially if you have |
once again. This is not good especially if you have |
510 |
certain characters in your setm (like $). |
certain characters in your stem (like $). |
511 |
|
|
512 |
Instead, we will replace % with $* and allow the second |
Instead, we will replace % with $* and allow the second |
513 |
expansion to take care of it for us. This way (since $* |
expansion to take care of it for us. This way (since $* |
830 |
|
|
831 |
dep = (struct dep *) xmalloc (sizeof (struct dep)); |
dep = (struct dep *) xmalloc (sizeof (struct dep)); |
832 |
dep->ignore_mtime = d->ignore_mtime; |
dep->ignore_mtime = d->ignore_mtime; |
833 |
|
dep->staticpattern = 0; |
834 |
dep->need_2nd_expansion = 0; |
dep->need_2nd_expansion = 0; |
835 |
s = d->name; /* Hijacking the name. */ |
s = d->name; /* Hijacking the name. */ |
836 |
d->name = 0; |
d->name = 0; |
912 |
struct dep *new = (struct dep *) xmalloc (sizeof (struct dep)); |
struct dep *new = (struct dep *) xmalloc (sizeof (struct dep)); |
913 |
/* GKM FIMXE: handle '|' here too */ |
/* GKM FIMXE: handle '|' here too */ |
914 |
new->ignore_mtime = 0; |
new->ignore_mtime = 0; |
915 |
|
new->staticpattern = 0; |
916 |
new->need_2nd_expansion = 0; |
new->need_2nd_expansion = 0; |
917 |
new->name = p = (char *) xmalloc (rule->lens[i] + fullstemlen + 1); |
new->name = p = (char *) xmalloc (rule->lens[i] + fullstemlen + 1); |
918 |
bcopy (rule->targets[i], p, |
bcopy (rule->targets[i], p, |
924 |
rule->lens[i] - (rule->suffixes[i] - rule->targets[i]) + 1); |
rule->lens[i] - (rule->suffixes[i] - rule->targets[i]) + 1); |
925 |
new->file = enter_file (new->name); |
new->file = enter_file (new->name); |
926 |
new->next = file->also_make; |
new->next = file->also_make; |
927 |
|
|
928 |
/* Set precious flag. */ |
/* Set precious flag. */ |
929 |
f = lookup_file (rule->targets[i]); |
f = lookup_file (rule->targets[i]); |
930 |
if (f && f->precious) |
if (f && f->precious) |
931 |
new->file->precious = 1; |
new->file->precious = 1; |
932 |
|
|
933 |
file->also_make = new; |
file->also_make = new; |
934 |
} |
} |
935 |
|
|