diff --git a/Makefile.inc1 b/Makefile.inc1 index 18bd7ecd3ac..074bdedeb67 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -89,6 +89,9 @@ MK_GCC_BOOTSTRAP= no .if make(installworld) || make(install) || make(distributeworld) || \ make(stageworld) .-include "${OBJTOP}/compiler-metadata.mk" +.if !defined(_LOADED_COMPILER_METADATA) +.error A build is required first. You may have the wrong MAKEOBJDIRPREFIX set. +.endif .endif # Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. Pull it from the @@ -195,6 +198,7 @@ compiler-metadata.mk: .PHONY .META @: > ${.TARGET} @echo ".info Using cached compiler metadata from build at $$(hostname) on $$(date)" \ > ${.TARGET} + @echo "_LOADED_COMPILER_METADATA=t" >> ${.TARGET} .for v in ${_COMPILER_METADATA_VARS} @echo "${v}=${${v}}" >> ${.TARGET} .endfor