diff options
| author | Hartmut Brandt <harti@FreeBSD.org> | 2005-05-12 14:16:44 +0000 |
|---|---|---|
| committer | Hartmut Brandt <harti@FreeBSD.org> | 2005-05-12 14:16:44 +0000 |
| commit | 8b8eb9e2ab2ce467d85186909ab0bf9ca1dfa7da (patch) | |
| tree | 62f3bf0ee1d651af1f65a442f72505ae0f4ba19c /usr.bin/make | |
| parent | 35fd572dcb20db6beb702a2c71902d09bb4a50df (diff) | |
Notes
Diffstat (limited to 'usr.bin/make')
| -rw-r--r-- | usr.bin/make/globals.h | 1 | ||||
| -rw-r--r-- | usr.bin/make/job.c | 7 | ||||
| -rw-r--r-- | usr.bin/make/job.h | 2 | ||||
| -rw-r--r-- | usr.bin/make/main.c | 9 | ||||
| -rw-r--r-- | usr.bin/make/parse.c | 2 |
5 files changed, 13 insertions, 8 deletions
diff --git a/usr.bin/make/globals.h b/usr.bin/make/globals.h index e23de1eeaddd..e6d1e6576738 100644 --- a/usr.bin/make/globals.h +++ b/usr.bin/make/globals.h @@ -69,6 +69,7 @@ extern struct Path parseIncPath; /* The system include path. */ extern struct Path sysIncPath; +extern int jobLimit; /* -j argument: maximum number of jobs */ extern Boolean jobsRunning; /* True if jobs are running */ extern Boolean compatMake; /* True if we are make compatible */ extern Boolean ignoreErrors; /* True if should ignore all errors */ diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c index f5b555b535d7..279fb66fc950 100644 --- a/usr.bin/make/job.c +++ b/usr.bin/make/job.c @@ -400,7 +400,12 @@ static struct Shell *commandShell = NULL; static char *shellPath = NULL; /* full pathname of executable image */ static char *shellName = NULL; /* last component of shell */ -int maxJobs; /* The most children we can run at once */ +/* + * The maximum number of jobs that may run. This is initialize from the + * -j argument for the leading make and from the FIFO for sub-makes. + */ +static int maxJobs; + static int nJobs; /* The number of children currently running */ /* The structures that describe them */ diff --git a/usr.bin/make/job.h b/usr.bin/make/job.h index 987b5fde6685..04253b8307d5 100644 --- a/usr.bin/make/job.h +++ b/usr.bin/make/job.h @@ -56,8 +56,6 @@ struct Buffer; struct GNode; struct Lst; -extern int maxJobs; /* Number of jobs that may run */ - void Shell_Init(void); void Job_Touch(struct GNode *, Boolean); Boolean Job_CheckCommands(struct GNode *, void (*abortProc)(const char *, ...)); diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index 5b456780d36d..8e41fd8e0f39 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -122,6 +122,7 @@ static Boolean expandVars; /* fully expand printed variables */ static Lst variables = Lst_Initializer(variables); static Boolean forceJobs; /* -j argument given */ +int jobLimit; /* -j argument: maximum number of jobs */ Boolean compatMake; /* -B argument */ Boolean debug; /* -d flag */ Boolean noExecute; /* -n flag */ @@ -362,8 +363,8 @@ rearg: char *endptr; forceJobs = TRUE; - maxJobs = strtol(optarg, &endptr, 10); - if (maxJobs <= 0 || *endptr != '\0') { + jobLimit = strtol(optarg, &endptr, 10); + if (jobLimit <= 0 || *endptr != '\0') { warnx("illegal number, -j argument -- %s", optarg); usage(); @@ -695,7 +696,7 @@ main(int argc, char **argv) debug = 0; /* No debug verbosity, please. */ jobsRunning = FALSE; - maxJobs = DEFMAXJOBS; + jobLimit = DEFMAXJOBS; forceJobs = FALSE; /* No -j flag */ compatMake = FALSE; /* No compat mode */ @@ -977,7 +978,7 @@ main(int argc, char **argv) * should it exist). */ if (!queryFlag) { - Job_Init(maxJobs); + Job_Init(jobLimit); jobsRunning = TRUE; } diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index 4df224f0092e..219675f3ed0a 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -882,7 +882,7 @@ ParseDoDependency(char *line) DEFAULT = gn; break; case NotParallel: - maxJobs = 1; + jobLimit = 1; break; case SingleShell: compatMake = 1; |
