From owner-svn-src-head@freebsd.org Wed Oct 14 04:42:07 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10F10A12718; Wed, 14 Oct 2015 04:42:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6BEE847; Wed, 14 Oct 2015 04:42:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9E4g5wd006335; Wed, 14 Oct 2015 04:42:05 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9E4g52H006334; Wed, 14 Oct 2015 04:42:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510140442.t9E4g52H006334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 14 Oct 2015 04:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289286 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2015 04:42:07 -0000 Author: bdrewery Date: Wed Oct 14 04:42:05 2015 New Revision: 289286 URL: https://svnweb.freebsd.org/changeset/base/289286 Log: Follow-up r288218 by ensuring common objects are built before recursing. Some example where this is a problem: lib/atf/libatf-c++/tests/Makefile:SRCS.${_T}= ${_T}.cpp test_helpers.cpp lib/atf/libatf-c++/tests/detail/Makefile:SRCS.${_T}= ${_T}.cpp test_helpers.cpp lib/atf/libatf-c/tests/Makefile:SRCS.${_T}= ${_T}.c test_helpers.c lib/atf/libatf-c/tests/detail/Makefile:SRCS.${_T}= ${_T}.c test_helpers.c lib/libpam/libpam/tests/Makefile:SRCS.${test} = ${test}.c ${COMMONSRC} A similar change may be needed for FILES, SCRIPTS, or INCS, but for now stay with just SRCS. Reported by: rodrigc MFC after: 3 weeks X-MFC-With: r288218 Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.progs.mk Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Wed Oct 14 04:32:55 2015 (r289285) +++ head/share/mk/bsd.progs.mk Wed Oct 14 04:42:05 2015 (r289286) @@ -84,6 +84,25 @@ $v = # tell progs.mk we might want to install things PROGS_TARGETS+= checkdpadd clean cleandepend cleandir depend install +# Find common sources among the PROGS and depend on them before building +# anything. This allows parallelization without them each fighting over +# the same objects. +_PROGS_COMMON_SRCS= +_PROGS_ALL_SRCS= +.for p in ${PROGS} +.for s in ${SRCS.${p}} +.if ${_PROGS_ALL_SRCS:M${s}} && !${_PROGS_COMMON_SRCS:M${s}} +_PROGS_COMMON_SRCS+= ${s} +.else +_PROGS_ALL_SRCS+= ${s} +.endif +.endfor +.endfor +.if !empty(_PROGS_COMMON_SRCS) +_PROGS_COMMON_OBJS= ${_PROGS_COMMON_SRCS:N*.h:R:S/$/.o/g} +${PROGS}: ${_PROGS_COMMON_OBJS} +.endif + .for p in ${PROGS} .if defined(PROGS_CXX) && !empty(PROGS_CXX:M$p) # bsd.prog.mk may need to know this