From owner-svn-src-all@freebsd.org Fri Oct 23 19:42:00 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 EE44EA1DB60; Fri, 23 Oct 2015 19:41:59 +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 A9787D4F; Fri, 23 Oct 2015 19:41:59 +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 t9NJfwCO091890; Fri, 23 Oct 2015 19:41:58 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9NJfwhb091889; Fri, 23 Oct 2015 19:41:58 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201510231941.t9NJfwhb091889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 23 Oct 2015 19:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289846 - 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: Fri, 23 Oct 2015 19:42:00 -0000 Author: bdrewery Date: Fri Oct 23 19:41:58 2015 New Revision: 289846 URL: https://svnweb.freebsd.org/changeset/base/289846 Log: Fix regression from r289734 that caused crunchgen "subdirs" to not be properly recursed. The .for loop was defining a ${__dir} variable that was being set at a different evaluation time than the target itself, so every 'cd ${__dir}' became the last value that was in ${__dir}. This resulted in 'make obj' not properly being ran in the tree that would leave .depend files scattered around when 'make all' was ran in rescue/. To fix this, define a CRUNCH_SRCDIR_* for every prog if it does not already have one and then use that variable in every relevant place. This allows simplifying some logic as well. Reported by: emaste X-MFC-With: r289734 MFC after: 3 weeks 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 Fri Oct 23 19:28:24 2015 (r289845) +++ head/share/mk/bsd.crunchgen.mk Fri Oct 23 19:41:58 2015 (r289846) @@ -50,15 +50,18 @@ CLEANFILES+= ${CONF} *.o *.lo *.c *.mk * # Don't try to extract debug info from ${PROG}. MK_DEBUG_FILES= no +# Set a default SRCDIR for each for simpler handling below. +.for D in ${CRUNCH_SRCDIRS} +.for P in ${CRUNCH_PROGS_${D}} +CRUNCH_SRCDIR_${P}?= ${.CURDIR}/../../${D}/${P} +.endfor +.endfor + # Program names and their aliases contribute hardlinks to 'rescue' executable, # except for those that get suppressed. .for D in ${CRUNCH_SRCDIRS} .for P in ${CRUNCH_PROGS_${D}} -.ifdef CRUNCH_SRCDIR_${P} ${OUTPUTS}: ${CRUNCH_SRCDIR_${P}}/Makefile -.else -${OUTPUTS}: ${.CURDIR}/../../${D}/${P}/Makefile -.endif .if ${CRUNCH_GENERATE_LINKS} == "yes" .ifndef CRUNCH_SUPPRESS_LINK_${P} LINKS+= ${BINDIR}/${PROG} ${BINDIR}/${P} @@ -89,11 +92,7 @@ ${CONF}: Makefile .for D in ${CRUNCH_SRCDIRS} .for P in ${CRUNCH_PROGS_${D}} echo progs ${P} >>${.TARGET} -.ifdef CRUNCH_SRCDIR_${P} echo special ${P} srcdir ${CRUNCH_SRCDIR_${P}} >>${.TARGET} -.else - echo special ${P} srcdir ${.CURDIR}/../../${D}/${P} >>${.TARGET} -.endif .ifdef CRUNCH_BUILDOPTS_${P} echo special ${P} buildopts DIRPRFX=${DIRPRFX}${P}/ \ ${CRUNCH_BUILDOPTS_${P}} >>${.TARGET} @@ -138,13 +137,8 @@ build-tools: build-tools-${_tool} .for __target in clean cleandepend cleandir obj objlink .for D in ${CRUNCH_SRCDIRS} .for P in ${CRUNCH_PROGS_${D}} -.ifdef CRUNCH_SRCDIR_${P} -__dir= ${CRUNCH_SRCDIR_${P}} -.else -__dir= ${.CURDIR}/../../${D}/${P} -.endif ${__target}_crunchdir_${P}: .PHONY .MAKE - ${_+_}cd ${__dir} && \ + ${_+_}cd ${CRUNCH_SRCDIR_${P}} && \ ${CRUNCHENV} MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${__target} ${__target}: ${__target}_crunchdir_${P}