From 10f160f479b38433f4047a2f25d5aa8f07bc60e6 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Fri, 21 Sep 2012 07:55:21 +0000 Subject: 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. --- usr.bin/make/buf.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'usr.bin/make/buf.h') diff --git a/usr.bin/make/buf.h b/usr.bin/make/buf.h index 980d15a9546..4806b434b51 100644 --- a/usr.bin/make/buf.h +++ b/usr.bin/make/buf.h @@ -1,7 +1,7 @@ #ifndef _BUF_H #define _BUF_H -/* $OpenBSD: buf.h,v 1.19 2010/07/19 19:46:43 espie Exp $ */ +/* $OpenBSD: buf.h,v 1.20 2012/09/21 07:55:20 espie Exp $ */ /* $NetBSD: buf.h,v 1.7 1996/12/31 17:53:22 christos Exp $ */ /* @@ -133,4 +133,7 @@ do { \ * Removes non-backslashed spaces at the end of a buffer. */ extern void Buf_KillTrailingSpaces(Buffer); +extern void Buf_printf(Buffer, const char *, ...); +#define Buf_puts(b, s) Buf_AddChars((b), strlen(s), (s)) + #endif /* _BUF_H */ -- cgit v1.2.3