host-bottom.mk 3.0 KB

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