Makefile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 $(TOPDIR)/rules.mk
  4. include Makefile.inc
  5. include ../rules.mk
  6. include ${TOPDIR}/mk/buildhlp.mk
  7. ifeq ($(ADK_TOOLCHAIN_SSP),y)
  8. CONFOPTS+= --enable-libssp
  9. else
  10. CONFOPTS+= --disable-libssp
  11. endif
  12. ifeq ($(ADK_TOOLCHAIN_LTO),y)
  13. CONFOPTS+= --enable-lto
  14. else
  15. CONFOPTS+= --disable-lto
  16. endif
  17. ifeq ($(ADK_TOOLCHAIN_GOLD),y)
  18. CONFOPTS+= --enable-gold
  19. else
  20. CONFOPTS+= --disable-gold
  21. endif
  22. ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI),y)
  23. CONFOPTS+= --with-arch=armv6
  24. endif
  25. ifneq ($(ADK_LINUX_64),)
  26. CONFOPTS+= --enable-64-bit-bfd
  27. endif
  28. ifeq ($(ADK_LINUX_SH)$(ADK_LINUX_X86_64),)
  29. CONFOPTS+= --disable-multilib
  30. else
  31. CONFOPTS+= --enable-multilib
  32. endif
  33. ifeq (${ADK_MAKE_PARALLEL},y)
  34. BINUTILS_MAKEOPTS+= -j${ADK_MAKE_JOBS}
  35. endif
  36. $(WRKBUILD)/.headers:
  37. $(WRKBUILD)/.configured:
  38. (cd $(WRKBUILD); \
  39. $(WRKBUILD)/configure \
  40. --prefix=$(TOOLCHAIN_DIR)/usr \
  41. --target=$(GNU_TARGET_NAME) \
  42. --with-sysroot=$(STAGING_TARGET_DIR) \
  43. --disable-dependency-tracking \
  44. --disable-libtool-lock \
  45. --disable-nls \
  46. --disable-werror \
  47. --disable-plugins \
  48. ${CONFOPTS} \
  49. );
  50. touch $@
  51. $(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
  52. $(MAKE) ${BINUTILS_MAKEOPTS} -C $(WRKBUILD) all
  53. touch $@
  54. $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
  55. $(MAKE) -C $(WRKBUILD) install
  56. # needed on hosts without readelf, but strange things happen on Cygwin.
  57. ifeq (${OStype},Darwin)
  58. $(CP) $(WRKBUILD)/binutils/readelf $(TOOLCHAIN_DIR)/usr/bin
  59. endif
  60. touch $@
  61. include ${TOPDIR}/mk/toolchain.mk