From owner-svn-src-all@freebsd.org Thu Oct 22 04:42:18 2015 Return-Path: Delivered-To: svn-src-all@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 C8CBBA1B058; Thu, 22 Oct 2015 04:42:18 +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 875361149; Thu, 22 Oct 2015 04:42:18 +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 t9M4gHjD044331; Thu, 22 Oct 2015 04:42:17 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9M4gHcB044330; Thu, 22 Oct 2015 04:42:17 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510220442.t9M4gHcB044330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 22 Oct 2015 04:42:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289734 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2015 04:42:19 -0000 Author: bdrewery Date: Thu Oct 22 04:42:17 2015 New Revision: 289734 URL: https://svnweb.freebsd.org/changeset/base/289734 Log: Rewrite crunchgen target handling for progs so that it can be parallelized. This covers 'clean', 'cleandepend', 'cleandir', 'obj', 'objlink' and 'build-tools'. This uses the same method as bsd.subdir.mk. MFC after: 2 weeks X-MFC-With: r289731 Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.crunchgen.mk Modified: head/share/mk/bsd.crunchgen.mk ============================================================================== --- head/share/mk/bsd.crunchgen.mk Thu Oct 22 04:38:05 2015 (r289733) +++ head/share/mk/bsd.crunchgen.mk Thu Oct 22 04:42:17 2015 (r289734) @@ -123,29 +123,32 @@ objs: $(OUTMK) # Someone should replace the bin/csh and bin/sh build-tools with # shell scripts so we can remove this nonsense. -build-tools: .for _tool in $(CRUNCH_BUILDTOOLS) +build-tools-${_tool}: ${_+_}cd $(.CURDIR)/../../${_tool}; \ - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} obj; \ - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} build-tools + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} obj; \ + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} build-tools +build-tools: build-tools-${_tool} .endfor # Use a separate build tree to hold files compiled for this crunchgen binary # Yes, this does seem to partly duplicate bsd.subdir.mk, but I can't # get that to cooperate with bsd.prog.mk. Besides, many of the standard # targets should NOT be propagated into the components. -cleandepend cleandir obj objlink: +.for __target in clean cleandepend cleandir obj objlink .for D in $(CRUNCH_SRCDIRS) .for P in $(CRUNCH_PROGS_$(D)) .ifdef CRUNCH_SRCDIR_${P} - ${_+_}cd ${CRUNCH_SRCDIR_$(P)} && \ - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ - DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} +__dir= ${CRUNCH_SRCDIR_$(P)} .else - ${_+_}cd $(.CURDIR)/../../${D}/${P} && \ - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ - DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} +__dir= ${.CURDIR}/../../${D}/${P} .endif +${__target}_crunchdir_${P}: .PHONY .MAKE + ${_+_}cd ${__dir} && \ + ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ + DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${__target} +${__target}: ${__target}_crunchdir_${P} +.endfor .endfor .endfor @@ -154,16 +157,3 @@ clean: ${_+_}if [ -e ${.OBJDIR}/$(OUTMK) ]; then \ ${CRUNCHENV} MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) clean; \ fi -.for D in $(CRUNCH_SRCDIRS) -.for P in $(CRUNCH_PROGS_$(D)) -.ifdef CRUNCH_SRCDIR_${P} - ${_+_}cd ${CRUNCH_SRCDIR_$(P)} && \ - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ - DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} -.else - ${_+_}cd $(.CURDIR)/../../${D}/${P} && \ - ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ - DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} -.endif -.endfor -.endfor