1
0

Makefile 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. CONFOPTS+= --enable-gold=default
  19. else
  20. CONFOPTS+= --disable-gold
  21. endif
  22. ifeq ($(ADK_TARGET_ARCH_X86_64)$(ADK_CPU_CF),)
  23. CONFOPTS+= --disable-multilib
  24. else
  25. CONFOPTS+= --enable-multilib
  26. endif
  27. ifeq (${ADK_MAKE_PARALLEL},y)
  28. BINUTILS_MAKEOPTS+= -j${ADK_MAKE_JOBS}
  29. endif
  30. ifeq (${ADK_STATIC_TOOLCHAIN},y)
  31. BINUTILS_STATIC_MAKEOPTS+=LDFLAGS='$(HOST_STATIC_LLDFLAGS)'
  32. endif
  33. $(WRKBUILD)/.headers:
  34. $(WRKBUILD)/.configured:
  35. ifeq ($(ADK_TARGET_ARCH_XTENSA),y)
  36. tar xf $(ADK_TOPDIR)/target/xtensa/overlay/xtensa_$(ADK_TARGET_XTENSA).tar \
  37. --strip-components=1 -C $(WRKSRC) binutils
  38. endif
  39. (cd $(WRKBUILD); \
  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. $(MAKE) ${BINUTILS_MAKEOPTS} -C $(WRKBUILD) configure-host
  54. @touch $@
  55. $(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
  56. $(MAKE) ${BINUTILS_MAKEOPTS} ${BINUTILS_STATIC_MAKEOPTS} -C $(WRKBUILD) all
  57. @touch $@
  58. $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
  59. $(MAKE) -C $(WRKBUILD) install
  60. ifeq ($(ADK_TOOLCHAIN_BINUTILS_GIT),y)
  61. $(INSTALL_DIR) $(TOOLCHAIN_DIR)/usr/lib/ldscripts
  62. $(CP) $(WRKBUILD)/ld/ldscripts/* $(TOOLCHAIN_DIR)/usr/lib/ldscripts/
  63. endif
  64. @touch $@
  65. include ${ADK_TOPDIR}/mk/toolchain.mk