Avoid getting into a loop of "make cleandir" instances if the location

tool directory has been changed or wasn't recorded before.
This commit is contained in:
tron 2006-07-17 13:54:46 +00:00
parent ef1750eb29
commit c1af61f813
1 changed files with 7 additions and 5 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.101 2006/07/17 11:02:02 tron Exp $
# $NetBSD: Makefile,v 1.102 2006/07/17 13:54:46 tron Exp $
.include <bsd.own.mk>
@ -118,10 +118,12 @@ all-${dir} depend-${dir} dependall-${dir} install-${dir}:
.include <bsd.subdir.mk>
.include <bsd.obj.mk>
.if exists(PREVIOUSTOOLDIR)
.if !defined(PREVIOUSTOOLDIR)
. if exists(PREVIOUSTOOLDIR)
PREVIOUSTOOLDIR!= cat PREVIOUSTOOLDIR
.else
. else
PREVIOUSTOOLDIR=
. endif
.endif
CLEANFILES+= PREVIOUSTOOLDIR
@ -133,9 +135,9 @@ realall realdepend: .MAKE
@echo "*** != TOOLDIR '${TOOLDIR}'"
@echo "*** Cleaning mis-matched tools"
rm -f PREVIOUSTOOLDIR
(cd ${.CURDIR} && ${MAKE} cleandir)
(cd ${.CURDIR} && ${MAKE} PREVIOUSTOOLDIR=${PREVIOUSTOOLDIR} cleandir)
.endif
echo ${TOOLDIR} > PREVIOUSTOOLDIR
echo ${TOOLDIR} >PREVIOUSTOOLDIR
# For each .WAIT point, make sure the immediately preceding target is
# installed before building anything after that point.