svn commit: r311193 - stable/11/share/mk
Bryan Drewery
bdrewery at FreeBSD.org
Tue Jan 3 23:07:41 UTC 2017
Author: bdrewery
Date: Tue Jan 3 23:07:40 2017
New Revision: 311193
URL: https://svnweb.freebsd.org/changeset/base/311193
Log:
MFC r308599:
Consolidate the "don't build" optimizations into _SKIP_BUILD.
Modified:
stable/11/share/mk/bsd.dep.mk
stable/11/share/mk/bsd.init.mk
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/share/mk/bsd.dep.mk
==============================================================================
--- stable/11/share/mk/bsd.dep.mk Tue Jan 3 23:06:39 2017 (r311192)
+++ stable/11/share/mk/bsd.dep.mk Tue Jan 3 23:07:40 2017 (r311193)
@@ -77,12 +77,10 @@ _meta_filemon= 1
.endif
# Skip reading .depend when not needed to speed up tree-walks and simple
-# lookups. For install, only do this if no other targets are specified.
+# lookups. See _SKIP_BUILD logic in bsd.init.mk for more details.
# Also skip generating or including .depend.* files if in meta+filemon mode
# since it will track dependencies itself. OBJS_DEPEND_GUESS is still used.
-.if !empty(.MAKEFLAGS:M-V${_V_READ_DEPEND}) || make(obj) || make(clean*) || \
- ${.TARGETS:M*install*} == ${.TARGETS} || \
- make(analyze) || defined(_meta_filemon) || make(print-dir)
+.if defined(_SKIP_BUILD) || defined(_meta_filemon)
_SKIP_READ_DEPEND= 1
.if ${MK_DIRDEPS_BUILD} == "no" || make(analyze) || make(print-dir)
.MAKE.DEPENDFILE= /dev/null
Modified: stable/11/share/mk/bsd.init.mk
==============================================================================
--- stable/11/share/mk/bsd.init.mk Tue Jan 3 23:06:39 2017 (r311192)
+++ stable/11/share/mk/bsd.init.mk Tue Jan 3 23:07:40 2017 (r311193)
@@ -16,11 +16,27 @@ __<bsd.init.mk>__:
.include <bsd.own.mk>
.MAIN: all
-.if ${.MAKE.LEVEL:U1} == 0 && ${BUILD_AT_LEVEL0:Uyes:tl} == "no" && !make(clean*)
-# this tells lib.mk and prog.mk to not actually build anything
-_SKIP_BUILD = not building at level 0
+# Some targets need to know when something may build. This is used to
+# optimize targets that are only needed when building something, such as
+# (not) reading in depend files. For DIRDEPS_BUILD, it will only calculate
+# the dependency graph at .MAKE.LEVEL==0, so nothing should be built there.
+# Skip "build" logic if:
+# - DIRDEPS_BUILD at MAKELEVEL 0
+# - make -V is used without an override
+# - make install is used without other targets. This is to avoid breaking
+# things like 'make all install' or 'make foo install'.
+# - non-build targets are called
+.if ${MK_DIRDEPS_BUILD} == "yes" && ${.MAKE.LEVEL:U1} == 0 && \
+ ${BUILD_AT_LEVEL0:Uyes:tl} == "no" && !make(clean*)
+_SKIP_BUILD= not building at level 0
+.elseif !empty(.MAKEFLAGS:M-V${_V_DO_BUILD}) || \
+ ${.TARGETS:M*install*} == ${.TARGETS} || \
+ make(clean*) || make(obj) || make(analyze) || make(print-dir) || \
+ make(destroy*)
+# Skip building, but don't show a warning.
+_SKIP_BUILD=
.endif
-.if ${.MAKE.LEVEL} > 0 && !empty(_SKIP_BUILD)
+.if ${MK_DIRDEPS_BUILD} == "yes" && ${.MAKE.LEVEL} > 0 && !empty(_SKIP_BUILD)
.warning ${_SKIP_BUILD}
.endif
More information about the svn-src-stable
mailing list