From 987c375f87b704da469341f0ea6dfbda7cb85fcf Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Fri, 3 Jun 2016 21:35:19 +0000 Subject: [PATCH] WITH_META_MODE: Avoid "building" .depend if there is nothing to do. This avoids 'Building /path/.depend' when it will not actually produce a file. Sponsored by: EMC / Isilon Storage Division --- share/mk/bsd.dep.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index 0d53d4b4bb0..c371171512f 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -246,7 +246,9 @@ DPSRCS+= ${SRCS} # beforedepend/_EXTRADEPEND/afterdepend. The target is kept # to allow 'make depend' to generate files. ${DEPENDFILE}: ${DPSRCS} -.if !empty(.MAKE.MODE:Mmeta) || exists(${.OBJDIR}/${DEPENDFILE}) +.if exists(${.OBJDIR}/${DEPENDFILE}) || \ + ((commands(beforedepend) || commands(_EXTRADEPEND) || \ + commands(afterdepend)) && !empty(.MAKE.MODE:Mmeta)) rm -f ${DEPENDFILE} .endif .if target(_EXTRADEPEND)