Makefile 1.4 KB

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