version 1.258, 2020/11/21 12:01:16 |
version 1.259, 2020/11/21 13:11:13 |
Line 203 static Suff *emptySuff; |
|
Line 203 static Suff *emptySuff; |
|
static void SuffFindDeps(GNode *, SrcList *); |
static void SuffFindDeps(GNode *, SrcList *); |
static void SuffExpandWildcards(GNodeListNode *, GNode *); |
static void SuffExpandWildcards(GNodeListNode *, GNode *); |
|
|
|
/* Change the value of a Suff variable, adjusting the reference counts. */ |
|
static void |
|
SuffReassign(Suff **var, Suff *suff) |
|
{ |
|
if (*var != NULL) |
|
(*var)->refCount--; |
|
*var = suff; |
|
suff->refCount++; |
|
} |
|
|
|
/* Set a Suff variable to NULL, adjusting the reference count. */ |
|
static void |
|
SuffUnassign(Suff **var) |
|
{ |
|
if (*var != NULL) |
|
(*var)->refCount--; |
|
*var = NULL; |
|
} |
|
|
/* |
/* |
* See if pref is a prefix of str. |
* See if pref is a prefix of str. |
* Return NULL if it ain't, pointer to character in str after prefix if so. |
* Return NULL if it ain't, pointer to character in str after prefix if so. |
Line 1612 SuffFindNormalDepsPath(GNode *gn, Src *t |
|
Line 1631 SuffFindNormalDepsPath(GNode *gn, Src *t |
|
char savec; |
char savec; |
char *ptr; |
char *ptr; |
|
|
if (gn->suffix) |
SuffReassign(&gn->suffix, targ->suff); |
gn->suffix->refCount--; |
|
gn->suffix = targ->suff; |
|
gn->suffix->refCount++; |
|
|
|
savec = gn->path[savep]; |
savec = gn->path[savep]; |
gn->path[savep] = '\0'; |
gn->path[savep] = '\0'; |
Line 1632 SuffFindNormalDepsPath(GNode *gn, Src *t |
|
Line 1648 SuffFindNormalDepsPath(GNode *gn, Src *t |
|
char *ptr; |
char *ptr; |
|
|
/* The .PREFIX gets the full path if the target has no known suffix. */ |
/* The .PREFIX gets the full path if the target has no known suffix. */ |
if (gn->suffix) |
SuffUnassign(&gn->suffix); |
gn->suffix->refCount--; |
|
gn->suffix = NULL; |
|
|
|
if ((ptr = strrchr(gn->path, '/')) != NULL) |
if ((ptr = strrchr(gn->path, '/')) != NULL) |
ptr++; |
ptr++; |
|
|
for (src = bottom; src->parent != NULL; src = src->parent) { |
for (src = bottom; src->parent != NULL; src = src->parent) { |
targ = src->parent; |
targ = src->parent; |
|
|
if (src->node->suffix) |
SuffReassign(&src->node->suffix, src->suff); |
src->node->suffix->refCount--; |
|
src->node->suffix = src->suff; |
|
src->node->suffix->refCount++; |
|
|
|
if (targ->node == NULL) |
if (targ->node == NULL) |
targ->node = Targ_GetNode(targ->file); |
targ->node = Targ_GetNode(targ->file); |
|
|
} |
} |
} |
} |
|
|
if (gn->suffix != NULL) |
SuffReassign(&gn->suffix, src->suff); |
gn->suffix->refCount--; |
|
gn->suffix = src->suff; |
|
gn->suffix->refCount++; |
|
|
|
/* |
/* |
* Nuke the transformation path and the Src structures left over in the |
* Nuke the transformation path and the Src structures left over in the |
Line 1901 SuffFindDeps(GNode *gn, SrcList *slst) |
|
Line 1909 SuffFindDeps(GNode *gn, SrcList *slst) |
|
* value). |
* value). |
*/ |
*/ |
Suff *suff = FindSuffByName(LIBSUFF); |
Suff *suff = FindSuffByName(LIBSUFF); |
if (gn->suffix) |
|
gn->suffix->refCount--; |
|
if (suff != NULL) { |
if (suff != NULL) { |
gn->suffix = suff; |
SuffReassign(&gn->suffix, suff); |
gn->suffix->refCount++; |
|
Arch_FindLib(gn, suff->searchPath); |
Arch_FindLib(gn, suff->searchPath); |
} else { |
} else { |
gn->suffix = NULL; |
SuffUnassign(&gn->suffix); |
Var_Set(TARGET, gn->name, gn); |
Var_Set(TARGET, gn->name, gn); |
} |
} |
/* |
/* |