Makefile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 Makefile.inc
  5. include ../rules.mk
  6. include ${ADK_TOPDIR}/mk/buildhlp.mk
  7. ifeq ($(ADK_TOOLCHAIN_WITH_SSP),y)
  8. CONFOPTS+= --enable-libssp
  9. else
  10. CONFOPTS+= --disable-libssp
  11. endif
  12. ifeq ($(ADK_TOOLCHAIN_WITH_LTO),y)
  13. CONFOPTS+= --enable-lto --enable-plugins
  14. else
  15. CONFOPTS+= --disable-lto --disable-plugins
  16. endif
  17. ifeq ($(ADK_TOOLCHAIN_WITH_GOLD),y)
  18. ifeq ($(ADK_TARGET_USE_GOLD),y)
  19. CONFOPTS+= --enable-gold=default
  20. else
  21. CONFOPTS+= --enable-gold
  22. endif
  23. else
  24. CONFOPTS+= --disable-gold
  25. endif
  26. ifeq ($(ADK_TARGET_ARCH_X86_64)$(ADK_TARGET_CPU_CF),)
  27. CONFOPTS+= --disable-multilib
  28. else
  29. CONFOPTS+= --enable-multilib
  30. endif
  31. ifeq (${ADK_MAKE_PARALLEL},y)
  32. BINUTILS_MAKEOPTS+= -j${ADK_MAKE_JOBS}
  33. endif
  34. $(WRKBUILD)/.configured:
  35. ifeq ($(ADK_TARGET_ARCH_XTENSA),y)
  36. tar xf $(ADK_TOPDIR)/target/xtensa/overlay/xtensa_$(ADK_TARGET_CPU_TYPE).tar \
  37. --strip-components=1 -C $(WRKSRC) binutils
  38. endif
  39. (cd $(WRKBUILD); PATH='$(HOST_PATH)' \
  40. LDFLAGS=-ldl \
  41. MAKEINFO=true \
  42. M4='${STAGING_HOST_DIR}/usr/bin/m4' \
  43. $(WRKBUILD)/configure \
  44. --prefix=$(TOOLCHAIN_DIR)/usr \
  45. --target=$(GNU_TARGET_NAME) \
  46. --with-sysroot=$(STAGING_TARGET_DIR) \
  47. --disable-dependency-tracking \
  48. --disable-libtool-lock \
  49. --disable-nls \
  50. --disable-sim \
  51. --disable-gdb \
  52. --disable-werror \
  53. --disable-install-libiberty \
  54. ${CONFOPTS} \
  55. );
  56. PATH='$(HOST_PATH)' $(MAKE) ${BINUTILS_MAKEOPTS} MAKEINFO=true -C $(WRKBUILD) configure-host
  57. touch $@
  58. $(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
  59. PATH='$(HOST_PATH)' $(MAKE) ${BINUTILS_MAKEOPTS} MAKEINFO=true -C $(WRKBUILD) all
  60. touch $@
  61. $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
  62. PATH='$(HOST_PATH)' $(MAKE) MAKEINFO=true -C $(WRKBUILD) install
  63. ifeq ($(ADK_TARGET_ARCH_H8300)$(ADK_TARGET_ARCH_NDS32)$(ADK_TARGET_ARCH_SH),y)
  64. $(INSTALL_DIR) $(STAGING_TARGET_DIR)/usr/lib/ldscripts
  65. $(CP) $(WRKBUILD)/ld/ldscripts/* $(STAGING_TARGET_DIR)/usr/lib/ldscripts/
  66. endif
  67. ifeq ($(ADK_TARGET_USE_GOLD),y)
  68. (cd $(TOOLCHAIN_DIR)/usr/bin && \
  69. ln -sf $(GNU_TARGET_NAME)-ld.gold $(GNU_TARGET_NAME)-ld)
  70. else
  71. ifeq (ADK_TOOLCHAIN_BINUTILS_AVR32),)
  72. (cd $(TOOLCHAIN_DIR)/usr/bin && \
  73. ln -sf $(GNU_TARGET_NAME)-ld.bfd $(GNU_TARGET_NAME)-ld)
  74. endif
  75. endif
  76. touch $@
  77. include ${ADK_TOPDIR}/mk/toolchain.mk