host-bottom.mk 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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-configure:
  5. ${_HOST_CONFIGURE_COOKIE}: ${_HOST_PATCH_COOKIE}
  6. @mkdir -p ${WRKBUILD}
  7. @$(CMD_TRACE) "host configuring... "
  8. ifneq (,$(filter autoreconf,${AUTOTOOL_STYLE}))
  9. cd ${WRKSRC}; env ${AUTOTOOL_ENV} autoreconf -if $(MAKE_TRACE)
  10. @rm -rf ${WRKSRC}/autom4te.cache
  11. @touch ${WRKDIR}/.autoreconf_done
  12. endif
  13. @cd ${WRKBUILD}; \
  14. for i in $$(find . -name config.sub);do \
  15. if [ -f $$i ]; then \
  16. ${CP} $$i $$i.bak; \
  17. ${CP} ${SCRIPT_DIR}/config.sub $$i; \
  18. fi; \
  19. done; \
  20. for i in $$(find . -name config.guess);do \
  21. if [ -f $$i ]; then \
  22. ${CP} $$i $$i.bak; \
  23. ${CP} ${SCRIPT_DIR}/config.guess $$i; \
  24. fi; \
  25. done;
  26. ifneq (${HOST_STYLE},manual)
  27. ifeq ($(strip ${HOST_STYLE}),)
  28. cd ${WRKBUILD}; rm -f config.{cache,status}; \
  29. env ${HOST_CONFIGURE_ENV} \
  30. ${BASH} ${WRKSRC}/${CONFIGURE_PROG} \
  31. --program-prefix= \
  32. --program-suffix= \
  33. --prefix=/usr \
  34. --bindir=/usr/bin \
  35. --datadir=/usr/share \
  36. --mandir=/usr/share/man \
  37. --libexecdir=/usr/libexec \
  38. --localstatedir=/var \
  39. --sysconfdir=/etc \
  40. --disable-dependency-tracking \
  41. --disable-libtool-lock \
  42. --disable-nls \
  43. ${HOST_CONFIGURE_ARGS} $(MAKE_TRACE)
  44. else
  45. cd ${WRKBUILD}; rm -f config.{cache,status}; \
  46. env ${HOST_CONFIGURE_ENV} \
  47. ${BASH} ${WRKSRC}/${CONFIGURE_PROG} \
  48. --program-prefix= \
  49. --program-suffix= \
  50. --prefix=${STAGING_HOST_DIR}/usr \
  51. --bindir=${STAGING_HOST_DIR}/usr/bin \
  52. --datadir=${STAGING_HOST_DIR}/usr/share \
  53. --mandir=${STAGING_HOST_DIR}/usr/share/man \
  54. --libexecdir=${STAGING_HOST_DIR}/usr/libexec \
  55. --sysconfdir=${STAGING_HOST_DIR}/etc \
  56. --disable-dependency-tracking \
  57. --disable-libtool-lock \
  58. --disable-nls \
  59. ${HOST_CONFIGURE_ARGS} $(MAKE_TRACE)
  60. endif
  61. endif
  62. ${MAKE} host-configure $(MAKE_TRACE)
  63. touch $@
  64. host-build:
  65. ${_HOST_BUILD_COOKIE}: ${_HOST_CONFIGURE_COOKIE}
  66. ifneq (${HOST_STYLE},manual)
  67. @$(CMD_TRACE) "host compiling... "
  68. cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
  69. ${HOST_MAKE_FLAGS} ${HOST_ALL_TARGET} $(MAKE_TRACE)
  70. endif
  71. ${MAKE} host-build $(MAKE_TRACE)
  72. touch $@
  73. hostpost-install:
  74. hpkg-install: ${ALL_HOSTINST}
  75. host-install:
  76. ${_HOST_FAKE_COOKIE}: ${_HOST_BUILD_COOKIE}
  77. @$(CMD_TRACE) "host installing... "
  78. ifneq (${HOST_STYLE},manual)
  79. ifeq ($(strip ${HOST_STYLE}),)
  80. cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
  81. DESTDIR='${HOST_WRKINST}' ${HOST_FAKE_FLAGS} ${HOST_INSTALL_TARGET} $(MAKE_TRACE)
  82. env ${HOST_MAKE_ENV} ${MAKE} hpkg-install $(MAKE_TRACE)
  83. else
  84. cd ${WRKBUILD} && env ${HOST_MAKE_ENV} ${MAKE} -f ${MAKE_FILE} \
  85. DESTDIR='' ${HOST_FAKE_FLAGS} ${HOST_INSTALL_TARGET} $(MAKE_TRACE)
  86. endif
  87. else
  88. env ${HOST_MAKE_ENV} ${MAKE} hpkg-install $(MAKE_TRACE)
  89. endif
  90. env ${HOST_MAKE_ENV} ${MAKE} hostpost-install $(MAKE_TRACE)
  91. rm -rf ${WRKBUILD} ${WRKDIST} ${WRKSRC}
  92. exec ${MAKE} host-extract $(MAKE_TRACE)
  93. mkdir -p ${HOST_WRKINST}
  94. # avoid rebuild
  95. @touch ${_HOST_CONFIGURE_COOKIE}
  96. @touch ${_HOST_BUILD_COOKIE}
  97. @touch $@
  98. ${_HOST_COOKIE}:
  99. exec ${MAKE} hostpackage
  100. ifeq ($(HOST_LINUX_ONLY),)
  101. hostpackage: ${ALL_HOSTDIRS}
  102. @touch ${_HOST_COOKIE}
  103. endif