host-bottom.mk 3.8 KB

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