Makefile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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)' MAKEINFO=true \
  40. $(WRKBUILD)/configure \
  41. --prefix=$(TOOLCHAIN_DIR)/usr \
  42. --target=$(GNU_TARGET_NAME) \
  43. --with-sysroot=$(STAGING_TARGET_DIR) \
  44. --disable-dependency-tracking \
  45. --disable-libtool-lock \
  46. --disable-nls \
  47. --disable-sim \
  48. --disable-gdb \
  49. --disable-werror \
  50. --disable-install-libiberty \
  51. ${CONFOPTS} \
  52. );
  53. PATH='$(HOST_PATH)' $(MAKE) ${BINUTILS_MAKEOPTS} MAKEINFO=true -C $(WRKBUILD) configure-host
  54. touch $@
  55. $(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
  56. PATH='$(HOST_PATH)' $(MAKE) ${BINUTILS_MAKEOPTS} MAKEINFO=true -C $(WRKBUILD) all
  57. touch $@
  58. $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
  59. PATH='$(HOST_PATH)' $(MAKE) MAKEINFO=true -C $(WRKBUILD) install
  60. ifeq ($(ADK_TARGET_ARCH_H8300)$(ADK_TARGET_ARCH_NDS32)$(ADK_TARGET_CPU_SH_J2),y)
  61. $(INSTALL_DIR) $(STAGING_TARGET_DIR)/usr/lib/ldscripts
  62. $(CP) $(WRKBUILD)/ld/ldscripts/* $(STAGING_TARGET_DIR)/usr/lib/ldscripts/
  63. endif
  64. ifeq ($(ADK_TARGET_USE_GOLD),y)
  65. (cd $(TOOLCHAIN_DIR)/usr/bin && \
  66. ln -sf $(GNU_TARGET_NAME)-ld.gold $(GNU_TARGET_NAME)-ld)
  67. else
  68. ifeq (ADK_TOOLCHAIN_BINUTILS_2_20_1),)
  69. (cd $(TOOLCHAIN_DIR)/usr/bin && \
  70. ln -sf $(GNU_TARGET_NAME)-ld.bfd $(GNU_TARGET_NAME)-ld)
  71. endif
  72. endif
  73. touch $@
  74. include ${ADK_TOPDIR}/mk/toolchain.mk