host-bottom.mk 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. host-extract: ${_HOST_PATCH_COOKIE}
  4. HOST_CONFIG_STYLE?= ${HOST_STYLE}
  5. hostpre-configure:
  6. host-configure:
  7. ${_HOST_CONFIGURE_COOKIE}: ${_HOST_PATCH_COOKIE}
  8. mkdir -p ${WRKBUILD}
  9. ifneq (,$(filter autogen,${AUTOTOOL_STYLE}))
  10. @$(CMD_TRACE) "autotooling.. "
  11. @cd ${WRKSRC}; env ${HOST_AUTOTOOL_ENV} $(BASH) autogen.sh $(MAKE_TRACE)
  12. endif
  13. ifneq (,$(filter autoreconf,${AUTOTOOL_STYLE}))
  14. cd ${WRKSRC}; env ${HOST_AUTOTOOL_ENV} autoreconf -vif $(MAKE_TRACE)
  15. @rm -rf ${WRKSRC}/autom4te.cache
  16. @touch ${WRKDIR}/.autoreconf_done
  17. endif
  18. @${MAKE} hostpre-configure $(MAKE_TRACE)
  19. ifeq (${HOST_CONFIG_STYLE},)
  20. @$(CMD_TRACE) "configuring.. "
  21. cd ${WRKBUILD}; \
  22. env ${HOST_CONFIGURE_ENV} \
  23. ${BASH} ${WRKSRC}/${CONFIGURE_PROG} \
  24. --prefix=${STAGING_HOST_DIR}/usr \
  25. --bindir=${STAGING_HOST_DIR}/usr/bin \
  26. --datadir=${STAGING_HOST_DIR}/usr/share \
  27. --mandir=${STAGING_HOST_DIR}/usr/share/man \
  28. --libdir=${STAGING_HOST_DIR}/usr/lib \
  29. --libexecdir=${STAGING_HOST_DIR}/usr/libexec \
  30. --sysconfdir=${STAGING_HOST_DIR}/etc \
  31. ${HOST_CONFIGURE_ARGS} $(MAKE_TRACE)
  32. endif
  33. ifeq (${HOST_CONFIG_STYLE},auto)
  34. @$(CMD_TRACE) "configuring.. "
  35. cd ${WRKBUILD}; \
  36. env ${HOST_CONFIGURE_ENV} \
  37. ${BASH} ${WRKSRC}/${CONFIGURE_PROG} \
  38. --program-prefix= \
  39. --program-suffix= \
  40. --prefix=/usr \
  41. --bindir=/usr/bin \
  42. --datadir=/usr/share \
  43. --mandir=/usr/share/man \
  44. --libdir=/usr/lib \
  45. --libexecdir=/usr/libexec \
  46. --localstatedir=/var \
  47. --sysconfdir=/etc \
  48. --disable-dependency-tracking \
  49. --disable-libtool-lock \
  50. --disable-nls \
  51. ${HOST_CONFIGURE_ARGS} $(MAKE_TRACE)
  52. endif
  53. ifeq (${HOST_CONFIG_STYLE},cmake)
  54. @$(CMD_TRACE) "configuring cmake.. "
  55. cd ${WRKBUILD}; PATH='${HOST_PATH}' \
  56. cmake -Wno-dev -DCMAKE_INSTALL_PREFIX:PATH=$(STAGING_HOST_DIR)/usr \
  57. ${HOST_CMAKE_FLAGS} ${WRKSRC} $(MAKE_TRACE)
  58. endif
  59. ifeq (${HOST_CONFIG_STYLE},meson)
  60. @$(CMD_TRACE) "configuring meson.. "
  61. cd ${WRKSRC}; PATH='${HOST_PATH}' \
  62. meson --prefix $(STAGING_HOST_DIR)/usr \
  63. --pkg-config-path $(STAGING_HOST_DIR)/usr/lib/pkgconfig \
  64. --buildtype release $(MESON_FLAGS) \
  65. $(WRKSRC) $(WRKBUILD)
  66. endif
  67. ifeq (${HOST_CONFIG_STYLE},perl)
  68. @$(CMD_TRACE) "configuring perl module.. "
  69. cd ${WRKBUILD}; \
  70. PATH='${HOST_PATH}' \
  71. PERL_MM_USE_DEFAULT=1 \
  72. PERL_AUTOINSTALL=--skipdeps \
  73. $(HOST_PERL_ENV) \
  74. perl-host Makefile.PL ${HOST_CONFIGURE_ARGS}
  75. endif
  76. ifeq (${HOST_CONFIG_STYLE},manual)
  77. @$(CMD_TRACE) "configuring.. "
  78. ${MAKE} host-configure $(MAKE_TRACE)
  79. endif
  80. touch $@
  81. host-build:
  82. ${_HOST_BUILD_COOKIE}: ${_HOST_CONFIGURE_COOKIE}
  83. @$(CMD_TRACE) "compiling.. "
  84. ifneq ($(filter meson,${HOST_STYLE}),)
  85. PATH='$(HOST_PATH)' ninja -v -C $(WRKBUILD)
  86. else ifneq (${HOST_STYLE},manual)
  87. cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -j${ADK_MAKE_JOBS} -f ${MAKE_FILE} \
  88. ${HOST_MAKE_FLAGS} ${HOST_ALL_TARGET} $(MAKE_TRACE)
  89. endif
  90. ${MAKE} host-build $(MAKE_TRACE)
  91. touch $@
  92. HOST_INSTALL_STYLE?= ${HOST_STYLE}
  93. hostpost-install:
  94. host-install: ${ALL_HOSTINST}
  95. ${_HOST_FAKE_COOKIE}: ${_HOST_BUILD_COOKIE}
  96. @$(CMD_TRACE) "installing.. "
  97. @mkdir -p ${HOST_WRKINST}
  98. ifeq (${HOST_INSTALL_STYLE},)
  99. cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
  100. DESTDIR='' ${HOST_FAKE_FLAGS} ${HOST_INSTALL_TARGET} $(MAKE_TRACE)
  101. endif
  102. ifeq (${HOST_INSTALL_STYLE},auto)
  103. cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
  104. DESTDIR='${STAGING_HOST_DIR}' ${HOST_FAKE_FLAGS} ${HOST_INSTALL_TARGET} $(MAKE_TRACE)
  105. endif
  106. ifeq (${HOST_INSTALL_STYLE},manual)
  107. env ${HOST_MAKE_ENV} ${MAKE} host-install $(MAKE_TRACE)
  108. endif
  109. env ${HOST_MAKE_ENV} ${MAKE} hostpost-install $(MAKE_TRACE)
  110. @find $(STAGING_HOST_DIR) -name \*.la -exec rm {} \;
  111. @for a in $(STAGING_HOST_DIR)/usr/bin/*-config; do \
  112. [[ -e $$a ]] || continue; \
  113. $(SED) "s,^prefix=.*,prefix=$(STAGING_HOST_DIR)/usr," $$a; \
  114. chmod u+x $(STAGING_HOST_DIR)/usr/bin/$$(basename $$a); \
  115. done
  116. touch $@
  117. ${_HOST_COOKIE}:
  118. exec ${MAKE} hostpackage
  119. ifeq ($(HOST_LINUX_ONLY),)
  120. hostpackage: ${ALL_HOSTDIRS}
  121. @touch ${_HOST_COOKIE}
  122. endif
  123. hostclean:
  124. @printf " ---> cleaning host package build directories and files.. "
  125. -rm -rf ${STAGING_PKG_DIR}/stamps/${PKG_NAME}*-host ${WRKDIR}
  126. @printf " done\n"