Makefile 2.4 KB

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