3 # This is included very early from share/mk/src.sys.env.mk, after
4 # /etc/src-env.conf but before /etc/make.conf, /etc/src.conf, or OBJDIR
6 # - It is not safe to use .OBJDIR/OBJTOP/OBJROOT here.
7 # - __ENV_ONLY_OPTIONS have been parsed by now except for opporutunistic
11 .if ${MK_DIRDEPS_BUILD} == "no"
12 # For AUTO_OBJ many targets do not need object directories created at top-level
13 # for each visited directory. Only when things are being built are they
14 # needed. Having AUTO_OBJ disabled in a build target is fine as it should
15 # fallback to running 'make obj' as needed. If a target is not in this list
16 # then it is ran with MK_AUTO_OBJ=no in environment.
17 # 'showconfig' is in the list to avoid forcing MK_AUTO_OBJ=no for it.
18 AUTO_OBJ_TGT_WHITELIST+= \
19 _* all all-man build* depend everything *toolchain* includes \
20 libraries obj objlink showconfig tags xdev xdev-build native-xtools \
21 stage* create-packages* real-packages sign-packages package-pkg \
22 tinderbox universe* kernel kernels world worlds bmake
24 # Only allow AUTO_OBJ for the whitelisted targets. See AUTO_OBJ_TGT_WHITELIST
25 # above. MK_AUTO_OBJ not checked here for "yes" as it may not yet be enabled
26 # since it is opportunistic.
27 .if empty(.MAKEOVERRIDES:MMK_AUTO_OBJ)
28 .for _tgt in ${AUTO_OBJ_TGT_WHITELIST}
30 _CAN_USE_AUTO_OBJ?= yes
33 .if !defined(_CAN_USE_AUTO_OBJ)
34 _MAKEARGS+= MK_AUTO_OBJ=no
36 # This will prevent src.sys.obj.mk from opportunistically enabling AUTO_OBJ
37 # in this make execution and for sub-makes. For all of these targets we
38 # just want to read any existing OBJDIR but we don't care if we can create
40 .MAKEOVERRIDES+= MK_AUTO_OBJ
42 # For top-level we always assume the MAKEOBJDIRPREFIX is writable rather than
43 # falling back to .CURDIR.
44 __objdir_writable= yes
46 .endif # empty(.MAKEOVERRIDES:MMK_AUTO_OBJ)
48 .endif # ${MK_DIRDEPS_BUILD} == "no"