509 |
break; /* No more words */ |
break; /* No more words */ |
510 |
|
|
511 |
/* If the dependency name has %, substitute the stem. |
/* If the dependency name has %, substitute the stem. |
512 |
Watch out, we are going to do something very smart |
Watch out, we are going to do something tricky here. If |
513 |
here. If we just replace % with the stem value, |
we just replace % with the stem value, later, when we do |
514 |
later, when we do the second expansion, we will |
the second expansion, we will re-expand this stem value |
515 |
re-expand this stem value once again. This is not |
once again. This is not good especially if you have |
516 |
good especially if you have certain characters in |
certain characters in your setm (like $). |
517 |
your setm (like $). |
|
518 |
|
Instead, we will replace % with $* and allow the second |
519 |
Instead, we will replace % with $* and allow the |
expansion to take care of it for us. This way (since $* |
520 |
second expansion to take care of it for us. This |
is a simple variable) there won't be additional |
521 |
way (since $* is a simple variable) there won't |
re-expansion of the stem. */ |
|
be additional re-expansion of the stem.*/ |
|
522 |
|
|
523 |
for (p2 = p; p2 < p + len && *p2 != '%'; ++p2); |
for (p2 = p; p2 < p + len && *p2 != '%'; ++p2) |
524 |
|
; |
525 |
|
|
526 |
if (p2 < p + len) |
if (p2 < p + len) |
527 |
{ |
{ |
836 |
|
|
837 |
dep = (struct dep *) xmalloc (sizeof (struct dep)); |
dep = (struct dep *) xmalloc (sizeof (struct dep)); |
838 |
dep->ignore_mtime = d->ignore_mtime; |
dep->ignore_mtime = d->ignore_mtime; |
839 |
|
dep->need_2nd_expansion = 0; |
840 |
s = d->name; /* Hijacking the name. */ |
s = d->name; /* Hijacking the name. */ |
841 |
d->name = 0; |
d->name = 0; |
842 |
if (recursions == 0) |
if (recursions == 0) |
909 |
struct dep *new = (struct dep *) xmalloc (sizeof (struct dep)); |
struct dep *new = (struct dep *) xmalloc (sizeof (struct dep)); |
910 |
/* GKM FIMXE: handle '|' here too */ |
/* GKM FIMXE: handle '|' here too */ |
911 |
new->ignore_mtime = 0; |
new->ignore_mtime = 0; |
912 |
|
new->need_2nd_expansion = 0; |
913 |
new->name = p = (char *) xmalloc (rule->lens[i] + fullstemlen + 1); |
new->name = p = (char *) xmalloc (rule->lens[i] + fullstemlen + 1); |
914 |
bcopy (rule->targets[i], p, |
bcopy (rule->targets[i], p, |
915 |
rule->suffixes[i] - rule->targets[i] - 1); |
rule->suffixes[i] - rule->targets[i] - 1); |