Makefile 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. ifeq (${ADK_MAKE_PARALLEL},y)
  40. GLIBC_MAKEOPTS+= PARALLELMFLAGS="-j${ADK_MAKE_JOBS}"
  41. endif
  42. GLIBC_BUILD_DIR_INITIAL:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-headers
  43. GLIBC_BUILD_DIR_FINAL:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-final
  44. $(WRKBUILD)/.headers_configure:
  45. mkdir -p $(GLIBC_BUILD_DIR_INITIAL)
  46. (cd $(GLIBC_BUILD_DIR_INITIAL); \
  47. $(WRKBUILD)/configure \
  48. --prefix=/usr \
  49. --with-sysroot=$(TOOLCHAIN_SYSROOT) \
  50. ${GLIBC_CONFOPTS} \
  51. );
  52. touch $@
  53. $(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure
  54. mkdir -p $(TOOLCHAIN_SYSROOT)/usr/lib
  55. $(MAKE) ${GLIBC_MAKEOPTS} -C $(GLIBC_BUILD_DIR_INITIAL) \
  56. cross-compiling=yes \
  57. install_root=$(TOOLCHAIN_SYSROOT) \
  58. install-headers
  59. touch $(TOOLCHAIN_SYSROOT)/usr/include/gnu/stubs.h
  60. touch $@
  61. $(WRKBUILD)/.configured:
  62. mkdir -p $(GLIBC_BUILD_DIR_FINAL)
  63. (cd $(GLIBC_BUILD_DIR_FINAL); \
  64. ${GLIBC_ENV} \
  65. $(WRKBUILD)/configure \
  66. --prefix=/usr \
  67. --enable-shared \
  68. --enable-stackguard-randomization \
  69. ${GLIBC_CONFOPTS} \
  70. );
  71. touch $@
  72. $(WRKBUILD)/.compiled:
  73. ${GLIBC_ENV} $(MAKE) ${GLIBC_MAKEOPTS} -C $(GLIBC_BUILD_DIR_FINAL) all
  74. touch $@
  75. $(WRKBUILD)/.installed:
  76. ${GLIBC_ENV} $(MAKE) -C $(GLIBC_BUILD_DIR_FINAL) \
  77. install_root=$(STAGING_DIR) install
  78. touch $(STAGING_DIR)/usr/include/gnu/stubs.h
  79. touch $@
  80. include ${TOPDIR}/mk/toolchain.mk