Makefile 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. $(MAKE) -C $(GLIBC_BUILD_DIR_INITIAL) \
  52. cross-compiling=yes \
  53. install_root=$(TOOLCHAIN_SYSROOT) \
  54. install-headers
  55. touch $(TOOLCHAIN_SYSROOT)/usr/include/gnu/stubs.h
  56. touch $@
  57. $(WRKBUILD)/.configured:
  58. mkdir -p $(GLIBC_BUILD_DIR_FINAL)
  59. (cd $(GLIBC_BUILD_DIR_FINAL); \
  60. ${GLIBC_ENV} \
  61. $(WRKBUILD)/configure \
  62. --prefix=/usr \
  63. --enable-shared \
  64. --enable-stackguard-randomization \
  65. ${GLIBC_CONFOPTS} \
  66. );
  67. touch $@
  68. $(WRKBUILD)/.compiled:
  69. ${GLIBC_ENV} $(MAKE) -C $(GLIBC_BUILD_DIR_FINAL) all
  70. touch $@
  71. $(WRKBUILD)/.installed:
  72. ${GLIBC_ENV} $(MAKE) -C $(GLIBC_BUILD_DIR_FINAL) install_root=$(STAGING_DIR) install
  73. touch $(STAGING_DIR)/usr/include/gnu/stubs.h
  74. touch $@
  75. include ${TOPDIR}/mk/toolchain.mk