summaryrefslogtreecommitdiff
path: root/usr.bin/make/dump.h
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2012-09-21 07:55:21 +0000
committerMarc Espie <espie@cvs.openbsd.org>2012-09-21 07:55:21 +0000
commit10f160f479b38433f4047a2f25d5aa8f07bc60e6 (patch)
tree3c0207b7741e4887482742726e4bc1238f03de6b /usr.bin/make/dump.h
parent844d86d53b6754d7a21150eb94823f41ce76becc (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/dump.h')
-rw-r--r--usr.bin/make/dump.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/usr.bin/make/dump.h b/usr.bin/make/dump.h
new file mode 100644
index 00000000000..78531abcd3b
--- /dev/null
+++ b/usr.bin/make/dump.h
@@ -0,0 +1,34 @@
+/* $OpenBSD: dump.h,v 1.1 2012/09/21 07:55:20 espie Exp $ */
+#ifndef _DUMP_H_
+#define _DUMP_H_
+
+/*
+ * Copyright (c) 2012 Marc Espie.
+ *
+ * Extensive code modifications for the OpenBSD project.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OPENBSD PROJECT AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBSD
+ * PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/* implementation of -p option */
+extern void dump_data(void);
+
+#endif