Makefile.inc 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. .if !target(__${_this}__)
  2. __${_this}__:
  3. _CURDIR ?= ${.CURDIR}
  4. _OBJDIR ?= ${.OBJDIR}
  5. .if ${RELDIR:Mtargets/*} != "" || ${RELDIR} == "."
  6. .if ${.MAKE.LEVEL} == 0 && ${RELDIR:Mtargets/*} != ""
  7. .if make(bootstrap*) || !exists(${_CURDIR}/${.MAKE.DEPENDFILE:T})
  8. _bootstrap_dirdeps = yes
  9. .else
  10. # BUILD_AT_LEVEL0=no tells dirdeps.mk to use a sub-make for .CURDIR
  11. # This is useful if we need to leverage DIRDEPS
  12. BUILD_AT_LEVEL0 = no
  13. # this renders the rest harmless
  14. PKG_METHOD = no
  15. .endif
  16. .endif
  17. .MAIN: all
  18. # The makefile in subdirs should set this to something useful
  19. # the default should do nothing.
  20. PKG_METHOD ?= none
  21. none:
  22. .if ${build-*:${M_L_TARGETS}} != ""
  23. # just build the bits, skip packaging
  24. all:
  25. SHIPDIR = no
  26. .if ${RELDIR} != "."
  27. PKG_METHOD = no
  28. .endif
  29. .endif
  30. .if ${PKG_METHOD:Mno*} != ""
  31. all: ${PKG_METHOD}
  32. # set this to "no" for manual control
  33. UPDATE_DEPENDFILE ?= yes
  34. .endif
  35. .if ${UPDATE_DEPENDFILE:Uno} == "yes"
  36. .include <meta.autodep.mk>
  37. .endif
  38. # all the clever packaging methods go here....
  39. .endif # level 0
  40. .endif # _this