Makefile 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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_ARC),y)
  27. CONFOPTS+= --enable-lto --enable-plugins
  28. endif
  29. ifeq ($(ADK_TARGET_ARCH_X86_64)$(ADK_TARGET_CPU_CF),)
  30. CONFOPTS+= --disable-multilib
  31. else
  32. CONFOPTS+= --enable-multilib
  33. endif
  34. ifeq (${ADK_MAKE_PARALLEL},y)
  35. BINUTILS_MAKEOPTS+= -j${ADK_MAKE_JOBS}
  36. endif
  37. $(WRKBUILD)/.configured:
  38. ifeq ($(ADK_TARGET_ARCH_XTENSA),y)
  39. tar xf $(ADK_TOPDIR)/target/xtensa/overlay/xtensa_$(ADK_TARGET_CPU_TYPE).tar \
  40. --strip-components=1 -C $(WRKSRC) binutils
  41. endif
  42. (cd $(WRKBUILD); PATH='$(HOST_PATH)' \
  43. MAKEINFO=true \
  44. M4='${STAGING_HOST_DIR}/usr/bin/m4' \
  45. $(WRKBUILD)/configure \
  46. --prefix=$(TOOLCHAIN_DIR)/usr \
  47. --target=$(GNU_TARGET_NAME) \
  48. --with-sysroot=$(STAGING_TARGET_DIR) \
  49. --disable-dependency-tracking \
  50. --disable-libtool-lock \
  51. --disable-nls \
  52. --disable-sim \
  53. --disable-gdb \
  54. --enable-obsolete \
  55. --disable-werror \
  56. --disable-gprof \
  57. --disable-install-libiberty \
  58. ${CONFOPTS} \
  59. );
  60. PATH='$(HOST_PATH)' $(MAKE) ${BINUTILS_MAKEOPTS} MAKEINFO=true -C $(WRKBUILD) configure-host
  61. touch $@
  62. $(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
  63. PATH='$(HOST_PATH)' $(MAKE) ${BINUTILS_MAKEOPTS} MAKEINFO=true -C $(WRKBUILD) all
  64. touch $@
  65. $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
  66. PATH='$(HOST_PATH)' $(MAKE) MAKEINFO=true -C $(WRKBUILD) install
  67. ifeq ($(ADK_TARGET_ARCH_KVX)$(ADK_TARGET_ARCH_H8300)$(ADK_TARGET_ARCH_NDS32)$(ADK_TARGET_ARCH_SH),y)
  68. $(INSTALL_DIR) $(STAGING_TARGET_DIR)/usr/lib/ldscripts
  69. $(CP) $(WRKBUILD)/ld/ldscripts/* $(STAGING_TARGET_DIR)/usr/lib/ldscripts/
  70. endif
  71. ifeq ($(ADK_TARGET_USE_GOLD),y)
  72. (cd $(TOOLCHAIN_DIR)/usr/bin && \
  73. ln -sf $(GNU_TARGET_NAME)-ld.gold $(GNU_TARGET_NAME)-ld)
  74. else
  75. ifeq (ADK_TOOLCHAIN_BINUTILS_AVR32),)
  76. (cd $(TOOLCHAIN_DIR)/usr/bin && \
  77. ln -sf $(GNU_TARGET_NAME)-ld.bfd $(GNU_TARGET_NAME)-ld)
  78. endif
  79. endif
  80. touch $@
  81. include ${ADK_TOPDIR}/mk/toolchain.mk