diff --git a/Makefile.inc1 b/Makefile.inc1 index 28dc8fbfc4e5..65b0ebc0ab92 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -144,6 +144,15 @@ CLEANDIR= clean cleandepend CLEANDIR= cleandir .endif +.if ${MK_META_MODE} == "yes" +# If filemon is used then we can rely on the build being incremental-safe. +# The .meta files will also track the build command and rebuild should +# it change. +.if empty(.MAKE.MODE:Mnofilemon) +NO_CLEAN= t +.endif +.endif + LOCAL_TOOL_DIRS?= PACKAGEDIR?= ${DESTDIR}/${DISTDIR} diff --git a/share/man/man7/build.7 b/share/man/man7/build.7 index 36603dac5ac3..a605c2846bd2 100644 --- a/share/man/man7/build.7 +++ b/share/man/man7/build.7 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 29, 2016 +.Dd April 14, 2016 .Dt BUILD 7 .Os .Sh NAME @@ -539,6 +539,14 @@ instead of .Dq make cleandir . .It Va NO_CLEAN If set, no object tree files are cleaned at all. +This is the default when +.Va WITH_META_MODE +is used with +.Xr filemon 4 +loaded. +See +.Xr src.conf 5 +for more details. Setting .Va NO_CLEAN implies