Makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. _IN_CVTC= 1
  4. include $(TOPDIR)/rules.mk
  5. include ../rules.mk
  6. include Makefile.inc
  7. include ${TOPDIR}/mk/buildhlp.mk
  8. ifeq ($(ADK_NO_FPU),y)
  9. GLIBC_CONFOPTS:= --without-fp
  10. endif
  11. GLIBC_BUILD_DIR:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-headers
  12. GLIBC_BUILD_DIR2:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-final
  13. $(WRKBUILD)/.headers_configure:
  14. mkdir -p $(GLIBC_BUILD_DIR)
  15. (cd $(GLIBC_BUILD_DIR); \
  16. $(WRKBUILD)/configure \
  17. --prefix=/usr \
  18. --build=$(GNU_HOST_NAME) \
  19. --host=$(REAL_GNU_TARGET_NAME) \
  20. --disable-nls \
  21. --without-cvs \
  22. --with-__thread \
  23. --with-tls \
  24. --enable-add-ons \
  25. --enable-kernel="2.6.0" \
  26. --disable-sanity-checks \
  27. --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \
  28. --with-sysroot=$(TOOLCHAIN_SYSROOT) \
  29. ${GLIBC_CONFOPTS} \
  30. );
  31. touch $@
  32. $(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure
  33. $(MAKE) -C $(GLIBC_BUILD_DIR) \
  34. cross-compiling=yes \
  35. install_root=$(TOOLCHAIN_SYSROOT) \
  36. CFLAGS="-DBOOTSTRAP_GCC" install-headers
  37. touch $(TOOLCHAIN_SYSROOT)/usr/include/gnu/stubs.h
  38. touch $(TOOLCHAIN_SYSROOT)/usr/include/bits/stdio_lim.h
  39. touch $@
  40. $(WRKBUILD)/.configure_done:
  41. mkdir -p $(GLIBC_BUILD_DIR2)
  42. (cd $(GLIBC_BUILD_DIR2); \
  43. PATH='${TARGET_PATH}' \
  44. BUILD_CC=gcc \
  45. CFLAGS="$(TARGET_CFLAGS_ARCH) -O2 -pipe" \
  46. CC=${REAL_GNU_TARGET_NAME}-gcc \
  47. AR=${REAL_GNU_TARGET_NAME}-ar \
  48. RANLIB=${REAL_GNU_TARGET_NAME}-ranlib \
  49. LD=${REAL_GNU_TARGET_NAME}-ld \
  50. libc_cv_forced_unwind=yes \
  51. libc_cv_c_cleanup=yes \
  52. libc_cv_gnu99_inline=yes \
  53. $(WRKBUILD)/configure \
  54. --prefix=/usr \
  55. --build=$(GNU_HOST_NAME) \
  56. --host=$(REAL_GNU_TARGET_NAME) \
  57. --disable-nls \
  58. --without-cvs \
  59. --disable-profile \
  60. --disable-debug \
  61. --without-gd \
  62. --enable-shared \
  63. --enable-stackguard-randomization \
  64. --with-__thread \
  65. --with-tls \
  66. --enable-add-ons \
  67. --enable-kernel=2.6.0 \
  68. --with-headers=$(TOOLCHAIN_SYSROOT)/usr/include \
  69. ${GLIBC_CONFOPTS} \
  70. );
  71. touch $@
  72. $(WRKBUILD)/.compiled:
  73. PATH='${TARGET_PATH}' \
  74. CFLAGS="$(TARGET_CFLAGS_ARCH) -O2 -pipe" \
  75. CC=${REAL_GNU_TARGET_NAME}-gcc \
  76. LD=${REAL_GNU_TARGET_NAME}-ld \
  77. RANLIB=${REAL_GNU_TARGET_NAME}-ranlib \
  78. $(MAKE) -C $(GLIBC_BUILD_DIR2) lib \
  79. cross-compiling=yes
  80. touch $@
  81. $(WRKBUILD)/.installed:
  82. PATH='${TARGET_PATH}' \
  83. $(MAKE) -C $(GLIBC_BUILD_DIR2) \
  84. install_root=$(STAGING_DIR) \
  85. install-lib-all install-headers \
  86. install-others cross-compiling=yes
  87. touch $(STAGING_DIR)/usr/include/gnu/stubs.h
  88. touch $@
  89. include ${TOPDIR}/mk/toolchain.mk