1
0

host-bottom.mk 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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=/usr \
  57. ${HOST_CMAKE_FLAGS} ${WRKSRC} $(MAKE_TRACE)
  58. endif
  59. ifeq (${HOST_CONFIG_STYLE},perl)
  60. @$(CMD_TRACE) "configuring perl module.. "
  61. cd ${WRKBUILD}; \
  62. PATH='${HOST_PATH}' \
  63. PERL_MM_USE_DEFAULT=1 \
  64. PERL_AUTOINSTALL=--skipdeps \
  65. $(HOST_PERL_ENV) \
  66. perl-host Makefile.PL ${HOST_CONFIGURE_ARGS}
  67. endif
  68. ifeq (${HOST_CONFIG_STYLE},manual)
  69. @$(CMD_TRACE) "configuring.. "
  70. ${MAKE} host-configure $(MAKE_TRACE)
  71. endif
  72. touch $@
  73. host-build:
  74. ${_HOST_BUILD_COOKIE}: ${_HOST_CONFIGURE_COOKIE}
  75. @$(CMD_TRACE) "compiling.. "
  76. ifneq (${HOST_STYLE},manual)
  77. cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -j${ADK_MAKE_JOBS} -f ${MAKE_FILE} \
  78. ${HOST_MAKE_FLAGS} ${HOST_ALL_TARGET} $(MAKE_TRACE)
  79. endif
  80. ${MAKE} host-build $(MAKE_TRACE)
  81. touch $@
  82. HOST_INSTALL_STYLE?= ${HOST_STYLE}
  83. hostpost-install:
  84. host-install: ${ALL_HOSTINST}
  85. ${_HOST_FAKE_COOKIE}: ${_HOST_BUILD_COOKIE}
  86. @$(CMD_TRACE) "installing.. "
  87. @mkdir -p ${HOST_WRKINST}
  88. ifeq (${HOST_INSTALL_STYLE},)
  89. cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
  90. DESTDIR='' ${HOST_FAKE_FLAGS} ${HOST_INSTALL_TARGET} $(MAKE_TRACE)
  91. endif
  92. ifeq (${HOST_INSTALL_STYLE},auto)
  93. cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
  94. DESTDIR='${STAGING_HOST_DIR}' ${HOST_FAKE_FLAGS} ${HOST_INSTALL_TARGET} $(MAKE_TRACE)
  95. endif
  96. ifeq (${HOST_INSTALL_STYLE},manual)
  97. env ${HOST_MAKE_ENV} ${MAKE} host-install $(MAKE_TRACE)
  98. endif
  99. env ${HOST_MAKE_ENV} ${MAKE} hostpost-install $(MAKE_TRACE)
  100. @find $(STAGING_HOST_DIR) -name \*.la -exec rm {} \;
  101. @for a in $(STAGING_HOST_DIR)/usr/bin/*-config; do \
  102. [[ -e $$a ]] || continue; \
  103. $(SED) "s,^prefix=.*,prefix=$(STAGING_HOST_DIR)/usr," $$a; \
  104. chmod u+x $(STAGING_HOST_DIR)/usr/bin/$$(basename $$a); \
  105. done
  106. touch $@
  107. ${_HOST_COOKIE}:
  108. exec ${MAKE} hostpackage
  109. ifeq ($(HOST_LINUX_ONLY),)
  110. hostpackage: ${ALL_HOSTDIRS}
  111. @touch ${_HOST_COOKIE}
  112. endif
  113. hostclean:
  114. @printf " ---> cleaning host package build directories and files.. "
  115. -rm -rf ${STAGING_PKG_DIR}/stamps/${PKG_NAME}*-host ${WRKDIR}
  116. @printf " done\n"