version 1.36, 2000/01/08 09:45:15 |
version 1.37, 2000/03/26 16:21:32 |
|
|
{ |
{ |
GNode *pgn = (GNode *) pgnp; |
GNode *pgn = (GNode *) pgnp; |
GNode *cgn = (GNode *) cgnp; |
GNode *cgn = (GNode *) cgnp; |
if (Lst_Member (pgn->children, (ClientData)cgn) == NULL) { |
if (Lst_Member(pgn->children, cgn) == NULL) { |
Lst_AtEnd(pgn->children, (ClientData)cgn); |
Lst_AtEnd(pgn->children, cgn); |
if (specType == Not) { |
if (specType == Not) { |
Lst_AtEnd(cgn->parents, (ClientData)pgn); |
Lst_AtEnd(cgn->parents, pgn); |
} |
} |
pgn->unmade += 1; |
pgn->unmade += 1; |
} |
} |
|
|
* anything with their local variables, but better safe than |
* anything with their local variables, but better safe than |
* sorry. |
* sorry. |
*/ |
*/ |
Lst_ForEach(gn->parents, ParseLinkSrc, (ClientData)cohort); |
Lst_ForEach(gn->parents, ParseLinkSrc, cohort); |
cohort->type = OP_DOUBLEDEP|OP_INVISIBLE; |
cohort->type = OP_DOUBLEDEP|OP_INVISIBLE; |
Lst_AtEnd(gn->cohorts, (ClientData)cohort); |
Lst_AtEnd(gn->cohorts, cohort); |
|
|
/* |
/* |
* Replace the node in the targets list with the new copy |
* Replace the node in the targets list with the new copy |
*/ |
*/ |
ln = Lst_Member(targets, (ClientData)gn); |
ln = Lst_Member(targets, gn); |
Lst_Replace(ln, (ClientData)cohort); |
Lst_Replace(ln, cohort); |
gn = cohort; |
gn = cohort; |
} |
} |
/* |
/* |
|
|
* but checking is tedious, and the debugging output can show the |
* but checking is tedious, and the debugging output can show the |
* problem |
* problem |
*/ |
*/ |
Lst_AtEnd(p->successors, (ClientData)s); |
Lst_AtEnd(p->successors, s); |
Lst_AtEnd(s->preds, (ClientData)p); |
Lst_AtEnd(s->preds, p); |
return 0; |
return 0; |
} |
} |
else |
else |
|
|
if (keywd != -1) { |
if (keywd != -1) { |
int op = parseKeywords[keywd].op; |
int op = parseKeywords[keywd].op; |
if (op != 0) { |
if (op != 0) { |
Lst_ForEach (targets, ParseDoOp, (ClientData)&op); |
Lst_ForEach (targets, ParseDoOp, &op); |
return; |
return; |
} |
} |
if (parseKeywords[keywd].spec == Wait) { |
if (parseKeywords[keywd].spec == Wait) { |
|
|
* invoked if the user didn't specify a target on the command |
* invoked if the user didn't specify a target on the command |
* line. This is to allow #ifmake's to succeed, or something... |
* line. This is to allow #ifmake's to succeed, or something... |
*/ |
*/ |
Lst_AtEnd(create, (ClientData)estrdup(src)); |
Lst_AtEnd(create, estrdup(src)); |
/* |
/* |
* Add the name to the .TARGETS variable as well, so the user cna |
* Add the name to the .TARGETS variable as well, so the user cna |
* employ that, if desired. |
* employ that, if desired. |
|
|
*/ |
*/ |
gn = Targ_FindNode(src, TARG_CREATE); |
gn = Targ_FindNode(src, TARG_CREATE); |
if (predecessor != NULL) { |
if (predecessor != NULL) { |
Lst_AtEnd(predecessor->successors, (ClientData)gn); |
Lst_AtEnd(predecessor->successors, gn); |
Lst_AtEnd(gn->preds, (ClientData)predecessor); |
Lst_AtEnd(gn->preds, predecessor); |
} |
} |
/* |
/* |
* The current source now becomes the predecessor for the next one. |
* The current source now becomes the predecessor for the next one. |
|
|
if (tOp) { |
if (tOp) { |
gn->type |= tOp; |
gn->type |= tOp; |
} else { |
} else { |
Lst_ForEach (targets, ParseLinkSrc, (ClientData)gn); |
Lst_ForEach(targets, ParseLinkSrc, gn); |
} |
} |
if ((gn->type & OP_OPMASK) == OP_DOUBLEDEP) { |
if ((gn->type & OP_OPMASK) == OP_DOUBLEDEP) { |
register GNode *cohort; |
register GNode *cohort; |
|
|
if (tOp) { |
if (tOp) { |
cohort->type |= tOp; |
cohort->type |= tOp; |
} else { |
} else { |
Lst_ForEach(targets, ParseLinkSrc, (ClientData)cohort); |
Lst_ForEach(targets, ParseLinkSrc, cohort); |
} |
} |
} |
} |
} |
} |
|
|
} |
} |
|
|
gn->order = waiting; |
gn->order = waiting; |
Lst_AtEnd(allsrc, (ClientData)gn); |
Lst_AtEnd(allsrc, gn); |
if (waiting) { |
if (waiting) { |
Lst_ForEach(allsrc, ParseAddDep, (ClientData)gn); |
Lst_ForEach(allsrc, ParseAddDep, gn); |
} |
} |
} |
} |
|
|
|
|
if (paths == NULL) { |
if (paths == NULL) { |
paths = Lst_Init(); |
paths = Lst_Init(); |
} |
} |
Lst_AtEnd(paths, (ClientData)dirSearchPath); |
Lst_AtEnd(paths, dirSearchPath); |
break; |
break; |
case Main: |
case Main: |
if (!Lst_IsEmpty(create)) { |
if (!Lst_IsEmpty(create)) { |
|
|
case Interrupt: |
case Interrupt: |
gn = Targ_FindNode(line, TARG_CREATE); |
gn = Targ_FindNode(line, TARG_CREATE); |
gn->type |= OP_NOTMAIN; |
gn->type |= OP_NOTMAIN; |
Lst_AtEnd(targets, (ClientData)gn); |
Lst_AtEnd(targets, gn); |
break; |
break; |
case Default: |
case Default: |
gn = Targ_NewGN(".DEFAULT"); |
gn = Targ_NewGN(".DEFAULT"); |
gn->type |= (OP_NOTMAIN|OP_TRANSFORM); |
gn->type |= (OP_NOTMAIN|OP_TRANSFORM); |
Lst_AtEnd(targets, (ClientData)gn); |
Lst_AtEnd(targets, gn); |
DEFAULT = gn; |
DEFAULT = gn; |
break; |
break; |
case NotParallel: |
case NotParallel: |
|
|
if (paths == NULL) { |
if (paths == NULL) { |
paths = Lst_Init(); |
paths = Lst_Init(); |
} |
} |
Lst_AtEnd(paths, (ClientData)path); |
Lst_AtEnd(paths, path); |
} |
} |
} |
} |
} |
} |
|
|
* No wildcards, but we want to avoid code duplication, |
* No wildcards, but we want to avoid code duplication, |
* so create a list with the word on it. |
* so create a list with the word on it. |
*/ |
*/ |
Lst_AtEnd(curTargs, (ClientData)line); |
Lst_AtEnd(curTargs, line); |
} |
} |
|
|
while((targName = (char *)Lst_DeQueue(curTargs)) != NULL) { |
while((targName = (char *)Lst_DeQueue(curTargs)) != NULL) { |
|
|
} |
} |
|
|
if (gn != NULL) |
if (gn != NULL) |
Lst_AtEnd(targets, (ClientData)gn); |
Lst_AtEnd(targets, gn); |
} |
} |
} else if (specType == ExPath && *line != '.' && *line != '\0') { |
} else if (specType == ExPath && *line != '.' && *line != '\0') { |
Parse_Error(PARSE_WARNING, "Extra target (%s) ignored", line); |
Parse_Error(PARSE_WARNING, "Extra target (%s) ignored", line); |
|
|
|
|
cp++; /* Advance beyond operator */ |
cp++; /* Advance beyond operator */ |
|
|
Lst_ForEach (targets, ParseDoOp, (ClientData)&op); |
Lst_ForEach (targets, ParseDoOp, &op); |
|
|
/* |
/* |
* Get to the first source |
* Get to the first source |
|
|
beSilent = TRUE; |
beSilent = TRUE; |
break; |
break; |
case ExPath: |
case ExPath: |
Lst_ForEach(paths, ParseClearPath, (ClientData)NULL); |
Lst_ForEach(paths, ParseClearPath, NULL); |
break; |
break; |
default: |
default: |
break; |
break; |
|
|
Suff_AddSuffix (line); |
Suff_AddSuffix (line); |
break; |
break; |
case ExPath: |
case ExPath: |
Lst_ForEach(paths, ParseAddDir, (ClientData)line); |
Lst_ForEach(paths, ParseAddDir, line); |
break; |
break; |
case Includes: |
case Includes: |
Suff_AddInclude (line); |
Suff_AddInclude (line); |
|
|
* the first dependency line that is actually a real target |
* the first dependency line that is actually a real target |
* (i.e. isn't a .USE or .EXEC rule) to be made. |
* (i.e. isn't a .USE or .EXEC rule) to be made. |
*/ |
*/ |
Lst_ForEach (targets, ParseFindMain, (ClientData)0); |
Lst_ForEach(targets, ParseFindMain, NULL); |
} |
} |
|
|
/* |
/* |
|
|
oldFile->p = curPTR; |
oldFile->p = curPTR; |
oldFile->lineno = lineno; |
oldFile->lineno = lineno; |
|
|
Lst_AtFront(includes, (ClientData)oldFile); |
Lst_AtFront(includes, oldFile); |
|
|
/* |
/* |
* Once the previous state has been saved, we can get down to reading |
* Once the previous state has been saved, we can get down to reading |
|
|
oldFile->F = curFILE; |
oldFile->F = curFILE; |
oldFile->p = curPTR; |
oldFile->p = curPTR; |
|
|
Lst_AtFront(includes, (ClientData)oldFile); |
Lst_AtFront(includes, oldFile); |
|
|
curFILE = NULL; |
curFILE = NULL; |
curPTR = (PTR *) emalloc (sizeof (PTR)); |
curPTR = (PTR *) emalloc (sizeof (PTR)); |
|
|
oldFile->p = curPTR; |
oldFile->p = curPTR; |
oldFile->lineno = lineno; |
oldFile->lineno = lineno; |
|
|
Lst_AtFront(includes, (ClientData)oldFile); |
Lst_AtFront(includes, oldFile); |
|
|
/* |
/* |
* Once the previous state has been saved, we can get down to reading |
* Once the previous state has been saved, we can get down to reading |
|
|
ParseFinishLine() |
ParseFinishLine() |
{ |
{ |
if (inLine) { |
if (inLine) { |
Lst_ForEach(targets, Suff_EndTransform, (ClientData)NULL); |
Lst_ForEach(targets, Suff_EndTransform, NULL); |
Lst_Destroy (targets, ParseHasCommands); |
Lst_Destroy (targets, ParseHasCommands); |
targets = NULL; |
targets = NULL; |
inLine = FALSE; |
inLine = FALSE; |
|
|
*/ |
*/ |
Lst_ForEach (targets, ParseAddCmd, cp); |
Lst_ForEach (targets, ParseAddCmd, cp); |
#ifdef CLEANUP |
#ifdef CLEANUP |
Lst_AtEnd(targCmds, (ClientData) line); |
Lst_AtEnd(targCmds, line); |
#endif |
#endif |
continue; |
continue; |
} else { |
} else { |
|
|
Punt ("no target to make."); |
Punt ("no target to make."); |
/*NOTREACHED*/ |
/*NOTREACHED*/ |
} else if (mainNode->type & OP_DOUBLEDEP) { |
} else if (mainNode->type & OP_DOUBLEDEP) { |
Lst_AtEnd(listmain, (ClientData)mainNode); |
Lst_AtEnd(listmain, mainNode); |
Lst_Concat(listmain, mainNode->cohorts, LST_CONCNEW); |
Lst_Concat(listmain, mainNode->cohorts, LST_CONCNEW); |
} |
} |
else |
else |
Lst_AtEnd(listmain, (ClientData)mainNode); |
Lst_AtEnd(listmain, mainNode); |
return (listmain); |
return (listmain); |
} |
} |
|
|