summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-03-01 07:15:13 -0800
committerKaz Kylheku <kaz@kylheku.com>2021-03-01 07:15:13 -0800
commit63e94bdae67101bbcc52a660a9161d86a05d5146 (patch)
tree4fa847f78a8d2c88660139bb1ba47f9aeeea0b18 /Makefile
parent5495d95b00a2b32bb8e52fb2ab0db425038af7ef (diff)
downloadtxr-63e94bdae67101bbcc52a660a9161d86a05d5146.tar.gz
txr-63e94bdae67101bbcc52a660a9161d86a05d5146.tar.bz2
txr-63e94bdae67101bbcc52a660a9161d86a05d5146.zip
build: cautiously allow parallel builds.
Over two years ago, I disabled parallel building with a .NOTPARALLEL: directive in the Makefile, due to some rules that depended on order of updates of their prerequisites. Today the situation is better. It looks like there are just a few rules that have to be fixed, all in the area of executing tests. Let us not enable that by default, though, to protect downstream users from themselves. Some operating system distribution builds optimistically run make -j N on all the packages, and then have to deal with sporadic breakages when some of those packages have parallel build bugs. We can prevent TXR from ever being implicated in such a breakage by turning off parallel building even if make -j requests it. There will now be a ./configure --parallelmake option to allow parallel builds, off by default. The --maintainer configuration mode will flip that default; configuring in maintainer mode will enable parallel builds, unless explicitly disabled with --no-parallelmake. * Makefile (.NOTPARALLEL): Conditionally assert, if parallelmake is false. (tst/tests/014/dgram-stream.ok, tst/tests/014/socket-basic.ok): Enforce order between these two tests. They clash in their use of network ports so cannot run at the same time. (test.clean): test.clean must finish executing before tests; enforce order. * configure (parallelmake, parallelmake_given): New variables. (help text): Add parallelmake option to help. (gen_config_make): Generate the parallelmake make variable into config.make. New script section, defaulting parallelmake to y in maintainer mode.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 8 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index d0970049..2b234e53 100644
--- a/Makefile
+++ b/Makefile
@@ -24,10 +24,12 @@
# 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.
-.NOTPARALLEL:
-
-include config.make
+ifeq ($(parallelmake),)
+.NOTPARALLEL:
+endif
+
VERBOSE :=
TXR_CFLAGS := -iquote . $(if $(top_srcdir), -iquote $(top_srcdir)) \
$(LANG_FLAGS) $(DIAG_FLAGS) \
@@ -409,6 +411,8 @@ tst/tests/016/%: TXR_DBG_OPTS :=
tst/tests/017/%: TXR_DBG_OPTS :=
tst/tests/018/%: TXR_DBG_OPTS :=
+tst/tests/014/dgram-stream.ok: | tst/tests/014/socket-basic.ok
+
TST_EXPECTED = $(word 2,$^)
TST_OUT = $(patsubst %.expected,tst/%.out,$(TST_EXPECTED))
@@ -439,11 +443,11 @@ tst/%.ok: %.tl %.expected $(TXR)
$(call SH,touch $@)
.PHONY: tests.clean
-tests.clean:
+tests.clean: | tests
rm -rf tst
.PHONY: retest
-retest: tests.clean tests
+retest: | tests.clean tests
define GREP_CHECK
$(V)if [ $$(grep -E $(1) $(SRCS) | wc -l) -ne $(3) ] ; then \