Makefile 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. include $(TOPDIR)/rules.mk
  4. include ../rules.mk
  5. include Makefile.inc
  6. include ${TOPDIR}/mk/buildhlp.mk
  7. ifneq ($(ADK_DEBUG),)
  8. TARGET_CFLAGS+= -O2
  9. endif
  10. EGLIBC_CONFOPTS:= \
  11. --build=$(GNU_HOST_NAME) \
  12. --host=$(REAL_GNU_TARGET_NAME) \
  13. --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \
  14. --disable-nls \
  15. --without-cvs \
  16. --disable-profile \
  17. --disable-debug \
  18. --enable-kernel=2.6.0 \
  19. --without-gd \
  20. --with-__thread \
  21. --with-tls \
  22. --enable-add-ons
  23. EGLIBC_ENV:= PATH='${TARGET_PATH}' \
  24. BUILD_CC=${HOSTCC} \
  25. CFLAGS="$(TARGET_CFLAGS)" \
  26. CC=${REAL_GNU_TARGET_NAME}-gcc \
  27. CXX=${REAL_GNU_TARGET_NAME}-g++ \
  28. AR=${REAL_GNU_TARGET_NAME}-ar \
  29. RANLIB=${REAL_GNU_TARGET_NAME}-ranlib \
  30. libc_cv_forced_unwind=yes \
  31. libc_cv_c_cleanup=yes \
  32. libc_cv_gnu99_inline=yes \
  33. libc_cv_slibdir="/lib"
  34. ifeq ($(ADK_TARGET_NO_FPU),y)
  35. EGLIBC_CONFOPTS+= --without-fp
  36. endif
  37. EGLIBC_BUILD_DIR_INITIAL:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-headers
  38. EGLIBC_BUILD_DIR_FINAL:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-final
  39. $(WRKBUILD)/.headers_configure:
  40. mkdir -p $(EGLIBC_BUILD_DIR_INITIAL)
  41. (cd ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION); \
  42. ln -sf ../ports ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)/libc);
  43. $(CP) ${TOPDIR}/toolchain/eglibc/eglibc.config \
  44. $(EGLIBC_BUILD_DIR_INITIAL)
  45. (cd $(EGLIBC_BUILD_DIR_INITIAL); \
  46. ${EGLIBC_ENV} \
  47. $(WRKBUILD)/libc/configure \
  48. --prefix=$(TOOLCHAIN_SYSROOT)/usr \
  49. --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \
  50. ${EGLIBC_CONFOPTS} \
  51. );
  52. touch $@
  53. $(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure
  54. mkdir -p $(TOOLCHAIN_SYSROOT)/usr/lib
  55. PATH='${TARGET_PATH}' \
  56. $(MAKE) -C $(EGLIBC_BUILD_DIR_INITIAL) \
  57. install-headers install-bootstrap-headers=yes
  58. touch $@
  59. $(WRKBUILD)/.configured:
  60. mkdir -p $(EGLIBC_BUILD_DIR_FINAL)
  61. $(CP) ${TOPDIR}/toolchain/eglibc/eglibc.config \
  62. $(EGLIBC_BUILD_DIR_FINAL)
  63. (cd $(EGLIBC_BUILD_DIR_FINAL); \
  64. ${EGLIBC_ENV} \
  65. $(WRKBUILD)/libc/configure \
  66. --prefix=/usr \
  67. --enable-shared \
  68. --enable-stackguard-randomization \
  69. ${EGLIBC_CONFOPTS} \
  70. );
  71. touch $@
  72. $(WRKBUILD)/.compiled:
  73. ${EGLIBC_ENV} $(MAKE) -C $(EGLIBC_BUILD_DIR_FINAL) all
  74. touch $@
  75. $(WRKBUILD)/.installed:
  76. ${EGLIBC_ENV} $(MAKE) -C $(EGLIBC_BUILD_DIR_FINAL) install_root=$(STAGING_DIR) install
  77. touch $@
  78. include ${TOPDIR}/mk/toolchain.mk