version 1.11, 1998/07/13 02:11:37 |
version 1.12, 1998/12/05 00:06:27 |
|
|
* Hence, the makefile must have been parsed |
* Hence, the makefile must have been parsed |
* before this function is called. |
* before this function is called. |
* |
* |
|
* Job_End Cleanup any memory used. |
|
* |
* Job_Full Return TRUE if the job table is filled. |
* Job_Full Return TRUE if the job table is filled. |
* |
* |
* Job_Empty Return TRUE if the job table is completely |
* Job_Empty Return TRUE if the job table is completely |
|
|
* the line as a shell specification. Returns |
* the line as a shell specification. Returns |
* FAILURE if the spec was incorrect. |
* FAILURE if the spec was incorrect. |
* |
* |
* Job_End Perform any final processing which needs doing. |
* Job_Finish Perform any final processing which needs doing. |
* This includes the execution of any commands |
* This includes the execution of any commands |
* which have been/were attached to the .END |
* which have been/were attached to the .END |
* target. It should only be called when the |
* target. It should only be called when the |
|
|
* Job_ParseShell function */ |
* Job_ParseShell function */ |
static char *shellPath = NULL, /* full pathname of |
static char *shellPath = NULL, /* full pathname of |
* executable image */ |
* executable image */ |
*shellName; /* last component of shell */ |
*shellName = NULL, /* last component of shell */ |
|
*shellArgv = NULL; /* Custom shell args */ |
|
|
|
|
static int maxJobs; /* The most children we can run at once */ |
static int maxJobs; /* The most children we can run at once */ |
|
|
*/ |
*/ |
Make_HandleUse(DEFAULT, gn); |
Make_HandleUse(DEFAULT, gn); |
Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), gn); |
Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), gn); |
if (p1) |
efree(p1); |
free(p1); |
|
} else if (Dir_MTime(gn) == 0) { |
} else if (Dir_MTime(gn) == 0) { |
/* |
/* |
* The node wasn't the target of an operator we have no .DEFAULT |
* The node wasn't the target of an operator we have no .DEFAULT |
|
|
while (isspace(*line)) { |
while (isspace(*line)) { |
line++; |
line++; |
} |
} |
words = brk_string(line, &wordCount, TRUE); |
|
|
|
|
efree(shellArgv); |
|
|
|
words = brk_string(line, &wordCount, TRUE, &shellArgv); |
|
|
memset((Address)&newShell, 0, sizeof(newShell)); |
memset((Address)&newShell, 0, sizeof(newShell)); |
|
|
/* |
/* |
* Parse the specification by keyword |
* Parse the specification by keyword |
*/ |
*/ |
for (path = NULL, argc = wordCount - 1, argv = words + 1; |
for (path = NULL, argc = wordCount - 1, argv = words; |
argc != 0; |
argc != 0; |
argc--, argv++) { |
argc--, argv++) { |
if (strncmp(*argv, "path=", 5) == 0) { |
if (strncmp(*argv, "path=", 5) == 0) { |
|
|
} else { |
} else { |
Parse_Error(PARSE_FATAL, "Unknown keyword \"%s\"", |
Parse_Error(PARSE_FATAL, "Unknown keyword \"%s\"", |
*argv); |
*argv); |
|
free(words); |
return(FAILURE); |
return(FAILURE); |
} |
} |
fullSpec = TRUE; |
fullSpec = TRUE; |
|
|
|
|
/* |
/* |
*----------------------------------------------------------------------- |
*----------------------------------------------------------------------- |
* Job_End -- |
* Job_Finish -- |
* Do final processing such as the running of the commands |
* Do final processing such as the running of the commands |
* attached to the .END target. |
* attached to the .END target. |
* |
* |
|
|
*----------------------------------------------------------------------- |
*----------------------------------------------------------------------- |
*/ |
*/ |
int |
int |
Job_End() |
Job_Finish() |
{ |
{ |
if (postCommands != NILGNODE && !Lst_IsEmpty(postCommands->commands)) { |
if (postCommands != NILGNODE && !Lst_IsEmpty(postCommands->commands)) { |
if (errors) { |
if (errors) { |
|
|
return(errors); |
return(errors); |
} |
} |
|
|
|
/*- |
|
*----------------------------------------------------------------------- |
|
* Job_End -- |
|
* Cleanup any memory used by the jobs module |
|
* |
|
* Results: |
|
* None. |
|
* |
|
* Side Effects: |
|
* Memory is freed |
|
*----------------------------------------------------------------------- |
|
*/ |
|
void |
|
Job_End() |
|
{ |
|
efree(shellArgv); |
|
} |
|
|
/*- |
/*- |
*----------------------------------------------------------------------- |
*----------------------------------------------------------------------- |
* Job_Wait -- |
* Job_Wait -- |