Makefile 2.4 KB

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