Makefile 2.5 KB

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