From owner-svn-src-head@freebsd.org Mon Nov 9 23:36:48 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 DED0CA2AACF; Mon, 9 Nov 2015 23:36:47 +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 B07D2131B; Mon, 9 Nov 2015 23:36:47 +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 tA9NakBB086025; Mon, 9 Nov 2015 23:36:46 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA9NakfC086022; Mon, 9 Nov 2015 23:36:46 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201511092336.tA9NakfC086022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 9 Nov 2015 23:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290626 - head 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: Mon, 09 Nov 2015 23:36:48 -0000 Author: bdrewery Date: Mon Nov 9 23:36:46 2015 New Revision: 290626 URL: https://svnweb.freebsd.org/changeset/base/290626 Log: Move 'make cleandir' from Makefile to Makefile.inc1. This leads the way for fixing cross-build cleanup, and eventually replacing 'cleandir' with it during the build. Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks Modified: head/Makefile head/Makefile.inc1 Modified: head/Makefile ============================================================================== --- head/Makefile Mon Nov 9 23:23:29 2015 (r290625) +++ head/Makefile Mon Nov 9 23:36:46 2015 (r290626) @@ -113,7 +113,7 @@ TGTS= all all-man buildenv buildenvvars buildkernel buildworld \ check-old check-old-dirs check-old-files check-old-libs \ - checkdpadd clean cleandepend cleandir \ + checkdpadd clean cleandepend cleandir cleanworld \ delete-old delete-old-dirs delete-old-files delete-old-libs \ depend distribute distributekernel distributekernel.debug \ distributeworld distrib-dirs distribution doxygen \ @@ -212,38 +212,6 @@ buildworld: upgrade_checks .endif # -# This 'cleanworld' target is not included in TGTS, because it is not a -# recursive target. All of the work for it is done right here. It is -# expected that BW_CANONICALOBJDIR == the CANONICALOBJDIR as would be -# created by bsd.obj.mk, except that we don't want to .include that file -# in this makefile. -# -# In the following, the first 'rm' in a series will usually remove all -# files and directories. If it does not, then there are probably some -# files with file flags set, so this unsets them and tries the 'rm' a -# second time. There are situations where this target will be cleaning -# some directories via more than one method, but that duplication is -# needed to correctly handle all the possible situations. Removing all -# files without file flags set in the first 'rm' instance saves time, -# because 'chflags' will need to operate on fewer files afterwards. -# -BW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR} -cleanworld: -.if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR} -.if exists(${BW_CANONICALOBJDIR}/) - -rm -rf ${BW_CANONICALOBJDIR}/* - -chflags -R 0 ${BW_CANONICALOBJDIR} - rm -rf ${BW_CANONICALOBJDIR}/* -.endif - # To be safe in this case, fall back to a 'make cleandir' - ${_+_}@cd ${.CURDIR}; ${_MAKE} cleandir -.else - -rm -rf ${.OBJDIR}/* - -chflags -R 0 ${.OBJDIR} - rm -rf ${.OBJDIR}/* -.endif - -# # Handle the user-driven targets, using the source relative mk files. # Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Nov 9 23:23:29 2015 (r290625) +++ head/Makefile.inc1 Mon Nov 9 23:36:46 2015 (r290626) @@ -2205,6 +2205,36 @@ builddtb: ############### +# cleanworld +# In the following, the first 'rm' in a series will usually remove all +# files and directories. If it does not, then there are probably some +# files with file flags set, so this unsets them and tries the 'rm' a +# second time. There are situations where this target will be cleaning +# some directories via more than one method, but that duplication is +# needed to correctly handle all the possible situations. Removing all +# files without file flags set in the first 'rm' instance saves time, +# because 'chflags' will need to operate on fewer files afterwards. +# +# It is expected that BW_CANONICALOBJDIR == the CANONICALOBJDIR as would be +# created by bsd.obj.mk, except that we don't want to .include that file +# in this makefile. +# +BW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR} +cleanworld: .PHONY +.if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR} +.if exists(${BW_CANONICALOBJDIR}/) + -rm -rf ${BW_CANONICALOBJDIR}/* + -chflags -R 0 ${BW_CANONICALOBJDIR} + rm -rf ${BW_CANONICALOBJDIR}/* +.endif + # To be safe in this case, fall back to a 'make cleandir' + ${_+_}@cd ${.CURDIR}; ${MAKE} cleandir +.else + -rm -rf ${.OBJDIR}/* + -chflags -R 0 ${.OBJDIR} + rm -rf ${.OBJDIR}/* +.endif + .if defined(TARGET) && defined(TARGET_ARCH) .if ${TARGET} == ${MACHINE} && ${TARGET_ARCH} == ${MACHINE_ARCH}