1
0

host-bottom.mk 3.7 KB

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