Index: head/share/mk/local.sys.mk =================================================================== --- head/share/mk/local.sys.mk (revision 301888) +++ head/share/mk/local.sys.mk (revision 301889) @@ -1,64 +1,76 @@ # $FreeBSD$ -.if ${MK_DIRDEPS_BUILD} == "yes" +.if ${MK_DIRDEPS_BUILD} == "yes" || ${MK_META_MODE} == "yes" + +# Not in the below list as it may make sense for non-meta mode +# eventually. meta.sys.mk (DIRDEPS_BUILD) also already adds these in. +.if ${MK_DIRDEPS_BUILD} == "no" && ${MK_META_MODE} == "yes" +MAKE_PRINT_VAR_ON_ERROR += \ + .ERROR_TARGET \ + .ERROR_META_FILE \ + .MAKE.LEVEL \ + MAKEFILE \ + .MAKE.MODE +.endif + MAKE_PRINT_VAR_ON_ERROR+= \ .CURDIR \ .MAKE \ .OBJDIR \ .TARGETS \ DESTDIR \ LD_LIBRARY_PATH \ MACHINE \ MACHINE_ARCH \ MAKEOBJDIRPREFIX \ MAKESYSPATH \ - MAKE_VERSION\ + MAKE_VERSION \ PATH \ SRCTOP \ OBJTOP \ ${MAKE_PRINT_VAR_ON_ERROR_XTRAS} .if ${.MAKE.LEVEL} > 0 MAKE_PRINT_VAR_ON_ERROR += .MAKE.MAKEFILES .PATH .endif .endif .if !empty(.OBJDIR) OBJTOP?= ${.OBJDIR:S,${.CURDIR},,}${SRCTOP} .endif .include "src.sys.mk" .if ${.MAKE.MODE:Mmeta*} != "" # we can afford to use cookies to prevent some targets # re-running needlessly but only when using filemon. # Targets that should support the meta mode cookie handling should just be # added to META_TARGETS. If bsd.sys.mk cannot be included then ${META_DEPS} # should be added as a target dependency as well. Otherwise the target # is added to in bsd.sys.mk since it comes last. .if ${.MAKE.MODE:Mnofilemon} == "" # Prepend .OBJDIR if not already there. _META_COOKIE_COND= "${.TARGET:M${.OBJDIR}/*}" == "" _META_COOKIE_DEFAULT= ${${_META_COOKIE_COND}:?${.OBJDIR}/${.TARGET}:${.TARGET}} # Use the default if COOKIE.${.TARGET} is not defined. META_COOKIE= ${COOKIE.${.TARGET}:U${_META_COOKIE_DEFAULT}} META_COOKIE_RM= @rm -f ${META_COOKIE} META_COOKIE_TOUCH= @touch ${META_COOKIE} CLEANFILES+= ${META_TARGETS} _meta_dep_before: .USEBEFORE .NOTMAIN ${META_COOKIE_RM} _meta_dep_after: .USE .NOTMAIN ${META_COOKIE_TOUCH} # Attach this to a target to allow it to benefit from meta mode's # not rerunning a command if it doesn't need to be considering its # metafile/filemon-tracked dependencies. META_DEPS= _meta_dep_before _meta_dep_after .META .endif .else # some targets need to be .PHONY - but not in meta mode META_NOPHONY= .PHONY .endif META_NOPHONY?= META_COOKIE_RM?= META_COOKIE_TOUCH?= META_DEPS+= ${META_NOPHONY} Index: head/tools/build/options/WITH_META_MODE =================================================================== --- head/tools/build/options/WITH_META_MODE (revision 301888) +++ head/tools/build/options/WITH_META_MODE (revision 301889) @@ -1,51 +1,54 @@ .\" $FreeBSD$ Creates .Xr make 1 meta files when building, which can provide a reliable incremental build when using .Xr filemon 4 . The meta file is created in the OBJDIR as .Pa target.meta . These meta files track the command ran, its output, and the current directory. The .Xr filemon 4 module is required unless .Va NO_FILEMON is defined. When the module is loaded, any files used by the commands executed will be tracked as dependencies for the target in its meta file. The target will be considered out-of-date and rebuilt if any of the following are true compared to the last build: .Bl -bullet -compact .It The command to execute changes. .It The current working directory changes. .It The target's meta file is missing. .It The target's meta file is missing filemon data when filemon is loaded and a previous run did not have it loaded. .It [requires .Xr filemon 4 ] Files read, executed or linked to are newer than the target. .It [requires .Xr filemon 4 ] Files read, written, executed or linked are missing. .El The meta files can also be useful for debugging. .Pp The build will hide commands ran unless .Va NO_SILENT is defined. +Errors will cause +.Xr make 1 +to show some of its environment for further debugging. .Pp The build operates as it normally would otherwise. This option originally invoked a different build system but that was renamed to .Va WITH_DIRDEPS_BUILD . .Pp Currently this also enforces .Va WITHOUT_SYSTEM_COMPILER .