host-bottom.mk 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. --libdir=${STAGING_HOST_DIR}/usr/lib \
  41. --libexecdir=${STAGING_HOST_DIR}/usr/libexec \
  42. --sysconfdir=${STAGING_HOST_DIR}/etc \
  43. --disable-dependency-tracking \
  44. --disable-libtool-lock \
  45. --disable-nls \
  46. ${HOST_CONFIGURE_ARGS} $(MAKE_TRACE)
  47. endif
  48. ifeq (${HOST_STYLE},auto)
  49. cd ${WRKBUILD}; \
  50. env ${HOST_CONFIGURE_ENV} \
  51. ${BASH} ${WRKSRC}/${CONFIGURE_PROG} \
  52. --program-prefix= \
  53. --program-suffix= \
  54. --prefix=/usr \
  55. --bindir=/usr/bin \
  56. --datadir=/usr/share \
  57. --mandir=/usr/share/man \
  58. --libdir=/usr/lib \
  59. --libexecdir=/usr/libexec \
  60. --localstatedir=/var \
  61. --sysconfdir=/etc \
  62. --disable-dependency-tracking \
  63. --disable-libtool-lock \
  64. --disable-nls \
  65. ${HOST_CONFIGURE_ARGS} $(MAKE_TRACE)
  66. endif
  67. ifeq (${HOST_STYLE},manual)
  68. ${MAKE} host-configure $(MAKE_TRACE)
  69. endif
  70. ifeq (${HOST_STYLE},perl)
  71. @$(CMD_TRACE) "configuring perl module... "
  72. cd ${WRKBUILD}; \
  73. PATH='${HOST_PATH}' \
  74. PERL_MM_USE_DEFAULT=1 \
  75. PERL_AUTOINSTALL=--skipdeps \
  76. $(HOST_PERL_ENV) \
  77. perl-host Makefile.PL ${HOST_CONFIGURE_ARGS}
  78. endif
  79. touch $@
  80. host-build:
  81. ${_HOST_BUILD_COOKIE}: ${_HOST_CONFIGURE_COOKIE}
  82. ifneq (${HOST_STYLE},manual)
  83. @$(CMD_TRACE) "host compiling... "
  84. cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
  85. ${HOST_MAKE_FLAGS} ${HOST_ALL_TARGET} $(MAKE_TRACE)
  86. endif
  87. ${MAKE} host-build $(MAKE_TRACE)
  88. touch $@
  89. hostpost-install:
  90. host-install: ${ALL_HOSTINST}
  91. ${_HOST_FAKE_COOKIE}: ${_HOST_BUILD_COOKIE}
  92. @$(CMD_TRACE) "host installing... "
  93. @mkdir -p ${HOST_WRKINST}
  94. ifeq (${HOST_STYLE},)
  95. cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
  96. DESTDIR='' ${HOST_FAKE_FLAGS} ${HOST_INSTALL_TARGET} $(MAKE_TRACE)
  97. endif
  98. ifeq (${HOST_STYLE},auto)
  99. cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
  100. DESTDIR='${STAGING_HOST_DIR}' ${HOST_FAKE_FLAGS} ${HOST_INSTALL_TARGET} $(MAKE_TRACE)
  101. endif
  102. ifeq (${HOST_STYLE},manual)
  103. env ${HOST_MAKE_ENV} ${MAKE} host-install $(MAKE_TRACE)
  104. endif
  105. env ${HOST_MAKE_ENV} ${MAKE} hostpost-install $(MAKE_TRACE)
  106. @find $(STAGING_HOST_DIR) -name \*.la -exec rm {} \;
  107. @for a in $(STAGING_HOST_DIR)/usr/bin/*-config; do \
  108. [[ -e $$a ]] || continue; \
  109. $(SED) "s,^prefix=.*,prefix=$(STAGING_HOST_DIR)/usr," $$a; \
  110. chmod u+x $(STAGING_HOST_DIR)/usr/bin/$$(basename $$a); \
  111. done
  112. @touch $@
  113. ${_HOST_COOKIE}:
  114. exec ${MAKE} hostpackage
  115. ifeq ($(HOST_LINUX_ONLY),)
  116. hostpackage: ${ALL_HOSTDIRS}
  117. @touch ${_HOST_COOKIE}
  118. endif
  119. hostclean:
  120. @$(CMD_TRACE) "cleaning... "
  121. rm -rf ${WRKDIR} ${STAGING_PKG_DIR}/stamps/${PKG_NAME}*-host