1
0

Makefile 2.3 KB

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