Makefile 2.3 KB

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