modules.port.mk 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # $OpenBSD: modules.port.mk,v 1.13 2017/06/03 15:02:26 espie Exp $
  2. #
  3. # Copyright (c) 2001 Marc Espie
  4. #
  5. # Redistribution and use in source and binary forms, with or without
  6. # modification, are permitted provided that the following conditions
  7. # are met:
  8. # 1. Redistributions of source code must retain the above copyright
  9. # notice, this list of conditions and the following disclaimer.
  10. # 2. Redistributions in binary form must reproduce the above copyright
  11. # notice, this list of conditions and the following disclaimer in the
  12. # documentation and/or other materials provided with the distribution.
  13. #
  14. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
  15. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  16. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  17. # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
  18. # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  19. # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  20. # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  21. # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  22. # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  23. # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  24. # SUCH DAMAGE.
  25. #
  26. # Recursive module support
  27. #
  28. .undef _MODULES_KEEP_GOING
  29. _COMPILER=
  30. .if defined(COMPILER) && !defined(CHOSEN_COMPILER)
  31. . if defined(_MODULES_DONE) && ${_MODULES_DONE:Mgcc4}
  32. ERRORS += "Fatal: COMPILER coming from a file included *after* the gcc module"
  33. . endif
  34. COMPILER_LANGS ?= c c++
  35. ONLY_FOR_ARCHS ?= ${CXX11_ARCHS}
  36. . if ${PROPERTIES:Mclang} && !${COMPILER:Mgcc-only}
  37. # XXX just ignore clang in base then, compiler will grab gcc4
  38. CHOSEN_COMPILER = base
  39. . else
  40. _COMPILER=compiler
  41. . endif
  42. .endif
  43. .for _m in ${_COMPILER} ${MODULES:L}
  44. . if "${_m:M*/*}" != ""
  45. . for _d in ${PORTSDIR_PATH:S/:/ /g}
  46. . if empty(_MODULES_DONE:M${_m}) && exists(${_d}/${_m}/${_m:T}.port.mk)
  47. . include "${_d}/${_m}/${_m:T}.port.mk"
  48. _MODULES_DONE += ${_m}
  49. _MODULES_KEEP_GOING = Yep
  50. . endif
  51. . endfor
  52. . endif
  53. . if empty(_MODULES_DONE:M${_m})
  54. . if exists(${PORTSDIR}/infrastructure/mk/${_m}.port.mk)
  55. . include "${PORTSDIR}/infrastructure/mk/${_m}.port.mk"
  56. _MODULES_DONE += ${_m}
  57. _MODULES_KEEP_GOING = Yep
  58. . else
  59. ERRORS += "Fatal: Missing support for module ${_m}."
  60. . endif
  61. . endif
  62. .endfor
  63. # Tail recursion
  64. .if defined(_MODULES_KEEP_GOING)
  65. . include "${PORTSDIR}/infrastructure/mk/modules.port.mk"
  66. .endif