Makefile 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. --enable-obsolete \
  53. --disable-werror \
  54. --disable-install-libiberty \
  55. ${CONFOPTS} \
  56. );
  57. PATH='$(HOST_PATH)' $(MAKE) ${BINUTILS_MAKEOPTS} MAKEINFO=true -C $(WRKBUILD) configure-host
  58. touch $@
  59. $(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
  60. PATH='$(HOST_PATH)' $(MAKE) ${BINUTILS_MAKEOPTS} MAKEINFO=true -C $(WRKBUILD) all
  61. touch $@
  62. $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
  63. PATH='$(HOST_PATH)' $(MAKE) MAKEINFO=true -C $(WRKBUILD) install
  64. ifeq ($(ADK_TARGET_ARCH_H8300)$(ADK_TARGET_ARCH_NDS32)$(ADK_TARGET_ARCH_SH),y)
  65. $(INSTALL_DIR) $(STAGING_TARGET_DIR)/usr/lib/ldscripts
  66. $(CP) $(WRKBUILD)/ld/ldscripts/* $(STAGING_TARGET_DIR)/usr/lib/ldscripts/
  67. endif
  68. ifeq ($(ADK_TARGET_USE_GOLD),y)
  69. (cd $(TOOLCHAIN_DIR)/usr/bin && \
  70. ln -sf $(GNU_TARGET_NAME)-ld.gold $(GNU_TARGET_NAME)-ld)
  71. else
  72. ifeq (ADK_TOOLCHAIN_BINUTILS_AVR32),)
  73. (cd $(TOOLCHAIN_DIR)/usr/bin && \
  74. ln -sf $(GNU_TARGET_NAME)-ld.bfd $(GNU_TARGET_NAME)-ld)
  75. endif
  76. endif
  77. touch $@
  78. include ${ADK_TOPDIR}/mk/toolchain.mk