bsd.port.arch.mk 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # $OpenBSD: bsd.port.arch.mk,v 1.13 2016/03/15 21:45:16 naddy Exp $
  2. #
  3. # ex:ts=4 sw=4 filetype=make:
  4. #
  5. # derived from bsd.port.mk in 2011
  6. # This file is in the public domain.
  7. # It is actually a part of bsd.port.mk that can be included early
  8. # for complicated MULTI_PACKAGES and ARCH-dependent cases.
  9. # _guard against multiple inclusion for bsd.port.mk
  10. _BSD_PORT_ARCH_MK_INCLUDED = Done
  11. .if !defined(_ARCH_DEFINES_INCLUDED)
  12. _ARCH_DEFINES_INCLUDED = Done
  13. . include "${PORTSDIR}/infrastructure/mk/arch-defines.mk"
  14. .endif
  15. # early include of Makefile.inc
  16. .if !defined(_MAKEFILE_INC_DONE)
  17. . if exists(${.CURDIR}/../Makefile.inc)
  18. _MAKEFILE_INC_DONE = Yes
  19. . include "${.CURDIR}/../Makefile.inc"
  20. . endif
  21. .endif
  22. # needs multi-packages (and default subpackage) for the rest
  23. .if !defined(MULTI_PACKAGES) || empty(MULTI_PACKAGES)
  24. # XXX let's cheat so we always have MULTI_PACKAGES
  25. MULTI_PACKAGES = -
  26. SUBPACKAGE ?= -
  27. .else
  28. SUBPACKAGE ?= -main
  29. .endif
  30. # allow pseudo-flavors to make subpackages vanish.
  31. .if defined(FLAVOR)
  32. # XXX remove all extra pseudo flavors that remove stuff
  33. BUILD_ONCE ?= No
  34. . if ${BUILD_ONCE:L} == "yes" && defined(PSEUDO_FLAVORS) && !${FLAVOR:Mbootstrap}
  35. . for f in ${FLAVOR:Mno_*}
  36. . if ${PSEUDO_FLAVORS:M$f}
  37. FLAVOR := ${FLAVOR:N$f}
  38. . endif
  39. . endfor
  40. . endif
  41. .endif
  42. # build the actual list of subpackages we want
  43. BUILD_PACKAGES =
  44. .for _s in ${MULTI_PACKAGES}
  45. # ONLY_FOR_ARCHS/NOT_FOR_ARCHS are special:
  46. # being undefined is different from being empty
  47. . if defined(ONLY_FOR_ARCHS)
  48. ONLY_FOR_ARCHS${_s} ?= ${ONLY_FOR_ARCHS}
  49. . endif
  50. . if defined(NOT_FOR_ARCHS)
  51. NOT_FOR_ARCHS${_s} ?= ${NOT_FOR_ARCHS}
  52. . endif
  53. IGNORE${_s} ?=
  54. IGNORE${_s} += ${IGNORE}
  55. . for _T in ${_s:S/^-/no_/}
  56. . if defined(FLAVOR) && ${FLAVOR:M${_T}}
  57. IGNORE${_s} += "Ignored as FLAVOR contains ${FLAVOR:M${_T}}"
  58. . endif
  59. . endfor
  60. # compute _ARCH_OK for ignore
  61. . if defined(ONLY_FOR_ARCHS${_s})
  62. . for A B in ${MACHINE_ARCH} ${ARCH}
  63. . if empty(ONLY_FOR_ARCHS${_s}:M$A) && empty(ONLY_FOR_ARCHS${_s}:M$B)
  64. . if ${MACHINE_ARCH} == "${ARCH}"
  65. IGNORE${_s} += "is only for ${ONLY_FOR_ARCHS${_s}}, not ${MACHINE_ARCH}"
  66. . else
  67. IGNORE${_s} += "is only for ${ONLY_FOR_ARCHS${_s}}, not ${MACHINE_ARCH} \(${ARCH}\)"
  68. . endif
  69. . endif
  70. . endfor
  71. . endif
  72. . if defined(NOT_FOR_ARCHS${_s})
  73. . for A B in ${MACHINE_ARCH} ${ARCH}
  74. . if !empty(NOT_FOR_ARCHS${_s}:M$A) || !empty(NOT_FOR_ARCHS${_s}:M$B)
  75. IGNORE${_s} += "is not for ${NOT_FOR_ARCHS${_s}}"
  76. . endif
  77. . endfor
  78. . endif
  79. # allow subpackages to vanish on architectures that don't
  80. # support them
  81. . if empty(IGNORE${_s})
  82. BUILD_PACKAGES += ${_s}
  83. . endif
  84. .endfor