diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2012-09-21 07:55:21 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2012-09-21 07:55:21 +0000 |
commit | 10f160f479b38433f4047a2f25d5aa8f07bc60e6 (patch) | |
tree | 3c0207b7741e4887482742726e4bc1238f03de6b /usr.bin/make/defines.h | |
parent | 844d86d53b6754d7a21150eb94823f41ce76becc (diff) |
major overhaul of the way make handle jobs, inspired by dpb:
instead of forking a "job" per target, and having that job further fork
separate commands, have make maintain a list of jobs, indexed by pid
of currently running commands, and handle process termination
continuation-style. This has lots of benefits:
- make is responsible for most printing, so we no longer need pipes nor
job control: make -j jobs see the tty.
- no more special-casing for jobs that don't really execute anything.
- unify code for make -jn and make -B, including signal handlers and
job waiting. So make -n, make -q, +cmd now run commands in the same
way in all cases.
- unified more accurate error-reporting, as make knows precisely which
command failed. Commands are tagged with their lines, and we display failing
commands in silent mode.
- fine-grained "expensive" command handling (recursion limiter). Do it
per-command instead of per-target.
Moreover, signal response is now simpler, as we just block the signals
in a small critical sections, test for events, and sigpause (thanks a lot
to guenther@ and millert@), so running make is now almost always paused
without any busy-waiting.
Thanks to everyone who tested and gave input.
Diffstat (limited to 'usr.bin/make/defines.h')
-rw-r--r-- | usr.bin/make/defines.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.bin/make/defines.h b/usr.bin/make/defines.h index 267860fc1aa..a0b20860d48 100644 --- a/usr.bin/make/defines.h +++ b/usr.bin/make/defines.h @@ -1,7 +1,7 @@ #ifndef DEFINES_H #define DEFINES_H -/* $OpenBSD: defines.h,v 1.10 2012/03/22 13:47:12 espie Exp $ */ +/* $OpenBSD: defines.h,v 1.11 2012/09/21 07:55:20 espie Exp $ */ /* * Copyright (c) 2001 Marc Espie. @@ -57,6 +57,9 @@ struct Name; struct ListNode_; typedef struct ListNode_ *LstNode; +struct Job_; +typedef struct Job_ Job; + /* some useful defines for gcc */ #ifdef __GNUC__ @@ -91,9 +94,10 @@ extern int debug; #define DEBUG_VAR 0x0200 #define DEBUG_FOR 0x0400 #define DEBUG_LOUD 0x0800 -#define DEBUG_JOBBANNER 0x1000 -#define DEBUG_PARALLEL 0x2000 -#define DEBUG_NAME_MATCHING 0x4000 +#define DEBUG_PARALLEL 0x1000 +#define DEBUG_NAME_MATCHING 0x2000 +#define DEBUG_QUICKDEATH 0x4000 +#define DEBUG_EXPENSIVE 0x8000 #define CONCAT(a,b) a##b |