2002-04-17 13:49:29 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
2014-04-24 02:02:51 +00:00
|
|
|
# The include file <bsd.init.mk> includes <bsd.opts.mk>,
|
|
|
|
# ../Makefile.inc and <bsd.own.mk>; this is used at the
|
|
|
|
# top of all <bsd.*.mk> files that actually "build something".
|
|
|
|
# bsd.opts.mk is included early so Makefile.inc can use the
|
|
|
|
# MK_FOO variables.
|
2002-04-17 13:49:29 +00:00
|
|
|
|
|
|
|
.if !target(__<bsd.init.mk>__)
|
|
|
|
__<bsd.init.mk>__:
|
2014-04-24 02:02:51 +00:00
|
|
|
.include <bsd.opts.mk>
|
2015-06-13 19:20:56 +00:00
|
|
|
.-include "local.init.mk"
|
2002-04-17 13:49:29 +00:00
|
|
|
.if exists(${.CURDIR}/../Makefile.inc)
|
|
|
|
.include "${.CURDIR}/../Makefile.inc"
|
|
|
|
.endif
|
|
|
|
.include <bsd.own.mk>
|
|
|
|
.MAIN: all
|
2012-08-22 19:25:57 +00:00
|
|
|
|
2016-11-13 00:11:02 +00:00
|
|
|
# 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=
|
2012-08-22 19:25:57 +00:00
|
|
|
.endif
|
2016-11-13 00:11:02 +00:00
|
|
|
.if ${MK_DIRDEPS_BUILD} == "yes" && ${.MAKE.LEVEL} > 0 && !empty(_SKIP_BUILD)
|
2015-06-13 19:20:56 +00:00
|
|
|
.warning ${_SKIP_BUILD}
|
|
|
|
.endif
|
2012-08-22 19:25:57 +00:00
|
|
|
|
2016-11-13 00:10:59 +00:00
|
|
|
beforebuild: .PHONY .NOTMAIN
|
|
|
|
.if !defined(_SKIP_BUILD)
|
|
|
|
all: beforebuild .WAIT
|
|
|
|
.endif
|
|
|
|
|
2016-06-14 16:20:19 +00:00
|
|
|
.if ${MK_META_MODE} == "yes"
|
|
|
|
.if !exists(/dev/filemon) && \
|
|
|
|
${UPDATE_DEPENDFILE:Uyes:tl} != "no" && !defined(NO_FILEMON) && \
|
2016-08-31 19:30:52 +00:00
|
|
|
!make(showconfig) && !make(print-dir) && ${.MAKEFLAGS:M-V} == ""
|
2016-06-14 16:20:19 +00:00
|
|
|
.warning The filemon module (/dev/filemon) is not loaded.
|
|
|
|
.warning META_MODE is less useful for incremental builds without filemon.
|
|
|
|
.warning 'kldload filemon' or pass -DNO_FILEMON to suppress this warning.
|
|
|
|
.endif
|
|
|
|
.endif # ${MK_META_MODE} == "yes"
|
|
|
|
|
2005-04-11 07:13:29 +00:00
|
|
|
.endif # !target(__<bsd.init.mk>__)
|