svn commit: r290627 - head

Bryan Drewery bdrewery at FreeBSD.org
Mon Nov 9 23:36:59 UTC 2015


Author: bdrewery
Date: Mon Nov  9 23:36:57 2015
New Revision: 290627
URL: https://svnweb.freebsd.org/changeset/base/290627

Log:
  Fix 'make cleanworld' to respect TARGET/TARGET_ARCH for cross-build objtrees.
  
  This simplifies the logic to always try removing the objdir if it exists
  and to fallback on a 'cleandir' if no objdir exists.  The reasoning for
  this is to avoid rm -rf src/* (r126024)
  
  Sponsored by:	EMC / Isilon Storage Division
  MFC after:	2 weeks

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Mon Nov  9 23:36:46 2015	(r290626)
+++ head/Makefile.inc1	Mon Nov  9 23:36:57 2015	(r290627)
@@ -2219,20 +2219,16 @@ builddtb:
 # created by bsd.obj.mk, except that we don't want to .include that file
 # in this makefile.
 #
-BW_CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR}
+BW_CANONICALOBJDIR:=${OBJTREE}${.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
+.if ${.CURDIR} == ${.OBJDIR} || ${.CURDIR}/obj == ${.OBJDIR}
 	#   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)


More information about the svn-src-all mailing list