Makefile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #
  2. # Copyright (C) 2006-2013 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=binutils
  9. PKG_VERSION:=$(call qstrip,$(CONFIG_BINUTILS_VERSION))
  10. BIN_VERSION:=$(PKG_VERSION)
  11. PKG_SOURCE_URL:=@GNU/binutils/
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  13. TAR_OPTIONS += --exclude='*.rej'
  14. ifeq ($(PKG_VERSION),2.37)
  15. PKG_HASH:=820d9724f020a3e69cb337893a0b63c2db161dadcb0e06fc11dc29eb1e84a32c
  16. endif
  17. ifeq ($(PKG_VERSION),2.38)
  18. PKG_HASH:=e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024
  19. endif
  20. ifeq ($(PKG_VERSION),2.39)
  21. PKG_HASH:=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  22. endif
  23. ifeq ($(PKG_VERSION),2.40)
  24. PKG_HASH:=0f8a4c272d7f17f369ded10a4aca28b8e304828e95526da482b0ccc4dfc9d8e1
  25. endif
  26. HOST_BUILD_PARALLEL:=1
  27. PATCH_DIR:=./patches/$(PKG_VERSION)
  28. include $(INCLUDE_DIR)/toolchain-build.mk
  29. ifdef CONFIG_GCC_USE_GRAPHITE
  30. GRAPHITE_CONFIGURE:= --with-isl=$(STAGING_DIR_HOST)
  31. else
  32. GRAPHITE_CONFIGURE:= --without-isl --without-cloog
  33. endif
  34. HOST_CONFIGURE_ARGS = \
  35. --prefix=$(TOOLCHAIN_DIR) \
  36. --build=$(GNU_HOST_NAME) \
  37. --host=$(GNU_HOST_NAME) \
  38. --target=$(REAL_GNU_TARGET_NAME) \
  39. --with-sysroot=$(TOOLCHAIN_DIR) \
  40. --with-system-zlib \
  41. --without-zstd \
  42. --enable-deterministic-archives \
  43. --enable-plugins \
  44. --enable-lto \
  45. --disable-gprofng \
  46. --disable-multilib \
  47. --disable-werror \
  48. --disable-nls \
  49. --disable-sim \
  50. --disable-gdb \
  51. $(GRAPHITE_CONFIGURE) \
  52. $(SOFT_FLOAT_CONFIG_OPTION) \
  53. $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
  54. ifneq ($(CONFIG_SSP_SUPPORT),)
  55. HOST_CONFIGURE_ARGS+= \
  56. --enable-libssp
  57. else
  58. HOST_CONFIGURE_ARGS+= \
  59. --disable-libssp
  60. endif
  61. ifneq ($(CONFIG_EXTRA_TARGET_ARCH),)
  62. HOST_CONFIGURE_ARGS+= \
  63. --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX)
  64. endif
  65. HOST_CONFIGURE_VARS += \
  66. acx_cv_cc_gcc_supports_ada=false
  67. define Host/Prepare
  68. $(call Host/Prepare/Default)
  69. ln -snf $(notdir $(HOST_BUILD_DIR)) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
  70. $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
  71. endef
  72. define Host/Compile
  73. +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all
  74. endef
  75. define Host/Install
  76. $(MAKE) -C $(HOST_BUILD_DIR) \
  77. install
  78. $(call FixupLibdir,$(TOOLCHAIN_DIR))
  79. $(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(HOST_BUILD_PREFIX)/bin/readelf
  80. endef
  81. define Host/Clean
  82. rm -rf \
  83. $(HOST_BUILD_DIR) \
  84. $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
  85. endef
  86. $(eval $(call HostBuild))