version 1.96, 2007/10/09 09:39:21 |
version 1.97, 2007/10/09 09:40:26 |
|
|
* for a target. Should this number be |
* for a target. Should this number be |
* 0, no shell will be executed. */ |
* 0, no shell will be executed. */ |
|
|
/* |
|
* Return values from JobStart. |
|
*/ |
|
#define JOB_RUNNING 0 /* Job is running */ |
|
#define JOB_ERROR 1 /* Error in starting the job */ |
|
#define JOB_FINISHED 2 /* The job is already finished */ |
|
#define JOB_STOPPED 3 /* The job is stopped */ |
|
|
|
#define SHELL_ECHO_OFF "set -" |
#define SHELL_ECHO_OFF "set -" |
#define SHELL_ECHO_ON "set -v" |
#define SHELL_ECHO_ON "set -v" |
#define SHELL_ERROR_ON "set -e" |
#define SHELL_ERROR_ON "set -e" |
|
|
static void JobExec(Job *, char **); |
static void JobExec(Job *, char **); |
static void JobMakeArgv(Job *, char **); |
static void JobMakeArgv(Job *, char **); |
static void JobRestart(Job *); |
static void JobRestart(Job *); |
static int JobStart(GNode *, int); |
static void JobStart(GNode *, int); |
static char *JobOutput(Job *, char *, char *, int); |
static char *JobOutput(Job *, char *, char *, int); |
static void JobDoOutput(Job *, bool); |
static void JobDoOutput(Job *, bool); |
static void JobInterrupt(int, int); |
static void JobInterrupt(int, int); |
|
|
* Start a target-creation process going for the target described |
* Start a target-creation process going for the target described |
* by the graph node gn. |
* by the graph node gn. |
* |
* |
* Results: |
|
* JOB_ERROR if there was an error in the commands, JOB_FINISHED |
|
* if there isn't actually anything left to do for the job and |
|
* JOB_RUNNING if the job has been started. |
|
* |
|
* Side Effects: |
* Side Effects: |
* A new Job node is created and added to the list of running |
* A new Job node is created and added to the list of running |
* jobs. PMake is forked and a child shell created. |
* jobs. PMake is forked and a child shell created. |
*----------------------------------------------------------------------- |
*----------------------------------------------------------------------- |
*/ |
*/ |
static int |
static void |
JobStart(GNode *gn, /* target to create */ |
JobStart(GNode *gn, /* target to create */ |
int flags) /* flags for the job to override normal ones. |
int flags) /* flags for the job to override normal ones. |
* e.g. JOB_SPECIAL */ |
* e.g. JOB_SPECIAL */ |
|
|
Make_Update(job->node); |
Make_Update(job->node); |
} |
} |
free(job); |
free(job); |
return JOB_FINISHED; |
return; |
} else { |
} else { |
free(job); |
free(job); |
return JOB_ERROR; |
return; |
} |
} |
} else { |
} else { |
(void)fflush(job->cmdFILE); |
(void)fflush(job->cmdFILE); |
|
|
} |
} |
JobExec(job, argv); |
JobExec(job, argv); |
} |
} |
return JOB_RUNNING; |
|
} |
} |
|
|
static char * |
static char * |