diff --git a/tools/Makefile b/tools/Makefile index 0cd0eb296882..50d2b51623e6 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -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 @@ -118,10 +118,12 @@ all-${dir} depend-${dir} dependall-${dir} install-${dir}: .include .include -.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.