Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. # ssp partially supported
  11. TARGET_CFLAGS:= $(filter-out -fstack-protector,$(TARGET_CFLAGS))
  12. EGLIBC_CONFOPTS:= --build=$(GNU_HOST_NAME) \
  13. --host=$(REAL_GNU_TARGET_NAME) \
  14. --without-cvs \
  15. --disable-profile \
  16. --disable-debug \
  17. --enable-kernel=2.6.0 \
  18. --without-gd \
  19. --with-__thread \
  20. --with-tls \
  21. --enable-add-ons \
  22. $(NLS)
  23. EGLIBC_ENV:= PATH='${TARGET_PATH}' \
  24. BUILD_CC=${CC_FOR_BUILD} \
  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)/option-groups.config
  45. (cd $(EGLIBC_BUILD_DIR_INITIAL); \
  46. ${EGLIBC_ENV} \
  47. $(WRKBUILD)/libc/configure \
  48. --prefix=$(STAGING_TARGET_DIR)/usr \
  49. --with-headers=$(STAGING_TARGET_DIR)/usr/include \
  50. ${EGLIBC_CONFOPTS} \
  51. );
  52. touch $@
  53. $(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure
  54. (cd $(EGLIBC_BUILD_DIR_INITIAL); \
  55. PATH='${TARGET_PATH}' \
  56. $(MAKE) install-headers install-bootstrap-headers=yes \
  57. );
  58. touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs.h
  59. touch $@
  60. ifeq ($(ADK_TOOLCHAIN_GCC_USE_SSP),y)
  61. EGLIBC_ENV+= libc_cv_ssp=yes
  62. else
  63. EGLIBC_ENV+= libc_cv_ssp=no
  64. endif
  65. $(WRKBUILD)/.configured:
  66. mkdir -p $(EGLIBC_BUILD_DIR_FINAL)
  67. $(CP) ${TOPDIR}/toolchain/eglibc/eglibc.config \
  68. $(EGLIBC_BUILD_DIR_FINAL)/option-groups.config
  69. (cd $(EGLIBC_BUILD_DIR_FINAL); \
  70. ${EGLIBC_ENV} \
  71. $(WRKBUILD)/libc/configure \
  72. --prefix=/usr \
  73. --enable-shared \
  74. --enable-stackguard-randomization \
  75. ${EGLIBC_CONFOPTS} \
  76. );
  77. touch $@
  78. $(EGLIBC_BUILD_DIR_FINAL)/libc.so:
  79. $(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
  80. ${EGLIBC_ENV} $(MAKE) -C $(EGLIBC_BUILD_DIR_FINAL) all
  81. touch $@
  82. $(WRKBUILD)/.installed: $(EGLIBC_BUILD_DIR_FINAL)/libc.so
  83. ${EGLIBC_ENV} $(MAKE) -C $(EGLIBC_BUILD_DIR_FINAL) install_root=$(STAGING_TARGET_DIR) install
  84. ${INSTALL_DATA} ${WRKBUILD}/libc/posix/gai.conf ${STAGING_TARGET_DIR}/etc/
  85. ${INSTALL_DATA} ${WRKBUILD}/libc/nscd/nscd.conf ${STAGING_TARGET_DIR}/etc/
  86. ${INSTALL_DATA} ${WRKBUILD}/libc/nss/nsswitch.conf ${STAGING_TARGET_DIR}/etc/
  87. touch $@
  88. include ${TOPDIR}/mk/toolchain.mk