Makefile 2.8 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 $(ADK_TOPDIR)/rules.mk
  4. include ../rules.mk
  5. include Makefile.inc
  6. include ${ADK_TOPDIR}/mk/buildhlp.mk
  7. TARGET_CFLAGS:= $(filter-out -ffast-math,$(TARGET_CFLAGS))
  8. TARGET_CFLAGS:= $(filter-out -fno-asynchronous-unwind-tables,$(TARGET_CFLAGS))
  9. TARGET_CFLAGS:= $(filter-out -fstack-protector-all,$(TARGET_CFLAGS))
  10. TARGET_LDFLAGS:= $(filter-out -fstack-protector-all,$(TARGET_LDFLAGS))
  11. GLIBC_CONFOPTS:= --build=$(GNU_HOST_NAME) \
  12. --host=$(GNU_TARGET_NAME) \
  13. --with-headers=$(STAGING_TARGET_DIR)/usr/include \
  14. --disable-sanity-checks \
  15. --disable-werror \
  16. --disable-nls \
  17. --disable-werror \
  18. --without-cvs \
  19. --disable-profile \
  20. --disable-debug \
  21. --without-gd \
  22. --disable-nscd \
  23. --with-__thread \
  24. --with-tls \
  25. --enable-kernel="2.6.32" \
  26. --enable-add-ons
  27. ifeq ($(ADK_TARGET_FLOAT),soft)
  28. GLIBC_CONFOPTS+= --without-fp
  29. endif
  30. ifeq ($(ADK_TARGET_FLOAT),hard)
  31. GLIBC_CONFOPTS+= --with-fp
  32. endif
  33. GLIBC_ENV:= PATH='${TARGET_PATH}' \
  34. CONFIG_SHELL='$(strip ${SHELL})' \
  35. BUILD_CC=${CC_FOR_BUILD} \
  36. CFLAGS="$(TARGET_CFLAGS)" \
  37. CC="${TARGET_CC}" \
  38. CXX="${TARGET_CXX}" \
  39. AR="${TARGET_AR}" \
  40. RANLIB="${TARGET_RANLIB}" \
  41. libc_cv_forced_unwind=yes \
  42. libc_cv_cc_with_libunwind=yes \
  43. libc_cv_c_cleanup=yes \
  44. libc_cv_gnu99_inline=yes \
  45. libc_cv_initfini_array=yes \
  46. # glibc does not compile with Os
  47. TARGET_CFLAGS:= $(subst Os,O2,$(TARGET_CFLAGS))
  48. ifneq ($(ADK_DEBUG),)
  49. TARGET_CFLAGS+= -O2
  50. endif
  51. GLIBC_MAKEOPTS+= cross-compiling=yes
  52. ifeq (${ADK_MAKE_PARALLEL},y)
  53. GLIBC_MAKEOPTS+= PARALLELMFLAGS="-j$(ADK_MAKE_JOBS)"
  54. endif
  55. GLIBC_BUILD_DIR_FINAL:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-final
  56. $(WRKBUILD)/.configured:
  57. mkdir -p $(GLIBC_BUILD_DIR_FINAL)
  58. (cd $(GLIBC_BUILD_DIR_FINAL); \
  59. ${GLIBC_ENV} \
  60. $(WRKBUILD)/configure \
  61. --prefix=/usr \
  62. --enable-shared \
  63. --enable-stackguard-randomization \
  64. ${GLIBC_CONFOPTS} \
  65. );
  66. touch $@
  67. $(WRKBUILD)/.compiled:
  68. ${GLIBC_ENV} $(MAKE) ${GLIBC_MAKEOPTS} asm-CPPFLAGS='$${CFLAGS}' -C $(GLIBC_BUILD_DIR_FINAL) all
  69. touch $@
  70. $(WRKBUILD)/.installed:
  71. ${GLIBC_ENV} $(MAKE) -C $(GLIBC_BUILD_DIR_FINAL) install_root=$(STAGING_TARGET_DIR) install
  72. touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs.h
  73. touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs-{32,x32,64,soft,hard}.h
  74. mkdir -p ${STAGING_TARGET_DIR}/etc
  75. ${INSTALL_DATA} ${WRKBUILD}/posix/gai.conf ${STAGING_TARGET_DIR}/etc
  76. ${INSTALL_DATA} ${WRKBUILD}/nss/nsswitch.conf ${STAGING_TARGET_DIR}/etc
  77. touch $@
  78. include ${ADK_TOPDIR}/mk/toolchain.mk