Makefile 2.0 KB

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