From d4e443e0426fee44056ba3c1123455666d083aef Mon Sep 17 00:00:00 2001 From: sjg Date: Wed, 7 May 2014 23:50:44 +0000 Subject: [PATCH] Update - allow collecting stats when WITH_META_STATS is defined. --- share/mk/meta.autodep.mk | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/share/mk/meta.autodep.mk b/share/mk/meta.autodep.mk index c29c26e85e24..3d3bccdaf879 100644 --- a/share/mk/meta.autodep.mk +++ b/share/mk/meta.autodep.mk @@ -176,7 +176,9 @@ _depend = .info ${_DEPENDFILE:S,${SRCTOP}/,,} _depend=${_depend} .endif +.if ${UPDATE_DEPENDFILE} == "yes" gendirdeps: ${_DEPENDFILE} +.endif .if !target(${_DEPENDFILE}) .if ${_bootstrap_dirdeps} == "yes" @@ -259,4 +261,28 @@ ${_DEPENDFILE}: .PRECIOUS .endif CLEANFILES += *.meta filemon.* *.db + +# these make it easy to gather some stats +now_utc = ${%s:L:gmtime} +start_utc := ${now_utc} + +meta_stats= meta=${.MAKE.META.FILES:[#]} \ + created=${empty(.MAKE.META.CREATED):?0:${.MAKE.META.CREATED:[#]}} + +#.END: _reldir_finish +.if target(gendirdeps) +_reldir_finish: gendirdeps +.endif +_reldir_finish: .NOMETA + @echo "${TIME_STAMP} Finished ${RELDIR}.${TARGET_SPEC} seconds=$$(( ${now_utc} - ${start_utc} )) ${meta_stats}" + +#.ERROR: _reldir_failed +_reldir_failed: .NOMETA + @echo "${TIME_STAMP} Failed ${RELDIR}.${TARGET_SPEC} seconds=$$(( ${now_utc} - ${start_utc} )) ${meta_stats}" + +.ifdef WITH_META_STATS +.END: _reldir_finish +.ERROR: _reldir_failed +.endif + .endif