You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.9KB

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