From ade4face27319fa6ab07c056f20376cd48efb7df Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Thu, 1 Mar 2018 18:02:34 -0800 Subject: [PATCH] reduce race risk in parallel builds (cherry picked from commit 74347f4a556d3049b2504615a51fbd13d17641a3) (cherry picked from commit 7f4e62d90216ac2cdd24d97136aca2ee74fa238a) --- bin/Makefile.in | 6 ++---- bin/tests/Makefile.in | 14 +++++++++++--- bin/tests/system/Makefile.in | 3 ++- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/bin/Makefile.in b/bin/Makefile.in index f3cbed3f78..d65c2b3654 100644 --- a/bin/Makefile.in +++ b/bin/Makefile.in @@ -4,14 +4,12 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -# $Id: Makefile.in,v 1.29 2009/10/05 12:07:08 fdupont Exp $ - srcdir = @srcdir@ VPATH = @srcdir@ top_srcdir = @top_srcdir@ -SUBDIRS = named rndc dig delv dnssec tools tests nsupdate \ - check confgen @NZD_TOOLS@ @PYTHON_TOOLS@ @PKCS11_TOOLS@ +SUBDIRS = named rndc dig delv dnssec tools nsupdate check confgen \ + @NZD_TOOLS@ @PYTHON_TOOLS@ @PKCS11_TOOLS@ tests TARGETS = @BIND9_MAKE_RULES@ diff --git a/bin/tests/Makefile.in b/bin/tests/Makefile.in index 3dfec149e7..2eb28c4baf 100644 --- a/bin/tests/Makefile.in +++ b/bin/tests/Makefile.in @@ -29,7 +29,8 @@ ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@ LIBS = @LIBS@ -SUBDIR = system @PKCS11_TOOLS@ optional +SUBDIRS = system @PKCS11_TOOLS@ +TESTDIRS = system # Test programs that are built by default: # cfg_test is needed for regenerating doc/misc/options @@ -38,14 +39,20 @@ SUBDIR = system @PKCS11_TOOLS@ optional # other opptional test programs have been moved to ./optional # Alphabetically +XTARGETS = all_tests TARGETS = cfg_test@EXEEXT@ makejournal@EXEEXT@ \ - wire_test@EXEEXT@ + wire_test@EXEEXT@ @XTARGETS@ SRCS = cfg_test.c makejournal.c wire_test.c @BIND9_MAKE_RULES@ -all_tests: subdirs +.NOTPARALLEL: + +.PHONY: +all_tests: + echo "making depend in `pwd`/optional"; \ + (cd optional; ${MAKE} ${MAKEDEFS} DESTDIR="${DESTDIR}" $@) wire_test@EXEEXT@: wire_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS} ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ wire_test.@O@ \ @@ -64,6 +71,7 @@ distclean:: clean distclean:: rm -f ${TARGETS} + ( cd optional; $(MAKE) $@) check: test diff --git a/bin/tests/system/Makefile.in b/bin/tests/system/Makefile.in index 13ea8374fd..8df1d250a9 100644 --- a/bin/tests/system/Makefile.in +++ b/bin/tests/system/Makefile.in @@ -36,10 +36,11 @@ TARGETS = feature-test@EXEEXT@ @BIND9_MAKE_RULES@ +subdirs: ${TARGETS} + feature-test@EXEEXT@: feature-test.@O@ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ feature-test.@O@ ${ISCLIBS} ${LIBS} - # Running the scripts below is bypassed when a separate build directory is # used.