Makefile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. PKG_CPE_ID:=cpe:/a:gnu:binutils
  14. TAR_OPTIONS += --exclude='*.rej'
  15. ifeq ($(PKG_VERSION),2.37)
  16. PKG_HASH:=820d9724f020a3e69cb337893a0b63c2db161dadcb0e06fc11dc29eb1e84a32c
  17. endif
  18. ifeq ($(PKG_VERSION),2.38)
  19. PKG_HASH:=e316477a914f567eccc34d5d29785b8b0f5a10208d36bbacedcc39048ecfe024
  20. endif
  21. ifeq ($(PKG_VERSION),2.39)
  22. PKG_HASH:=645c25f563b8adc0a81dbd6a41cffbf4d37083a382e02d5d3df4f65c09516d00
  23. endif
  24. ifeq ($(PKG_VERSION),2.40)
  25. PKG_HASH:=0f8a4c272d7f17f369ded10a4aca28b8e304828e95526da482b0ccc4dfc9d8e1
  26. endif
  27. HOST_BUILD_PARALLEL:=1
  28. PATCH_DIR:=./patches/$(PKG_VERSION)
  29. include $(INCLUDE_DIR)/toolchain-build.mk
  30. ifdef CONFIG_GCC_USE_GRAPHITE
  31. GRAPHITE_CONFIGURE:= --with-isl=$(STAGING_DIR_HOST)
  32. else
  33. GRAPHITE_CONFIGURE:= --without-isl --without-cloog
  34. endif
  35. HOST_CONFIGURE_ARGS = \
  36. --prefix=$(TOOLCHAIN_DIR) \
  37. --build=$(GNU_HOST_NAME) \
  38. --host=$(GNU_HOST_NAME) \
  39. --target=$(REAL_GNU_TARGET_NAME) \
  40. --with-sysroot=$(TOOLCHAIN_DIR) \
  41. --with-system-zlib \
  42. --with-zstd \
  43. --enable-deterministic-archives \
  44. --enable-plugins \
  45. --enable-lto \
  46. --disable-gprofng \
  47. --disable-multilib \
  48. --disable-werror \
  49. --disable-nls \
  50. --disable-sim \
  51. --disable-gdb \
  52. $(GRAPHITE_CONFIGURE) \
  53. $(SOFT_FLOAT_CONFIG_OPTION) \
  54. $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
  55. ifneq ($(CONFIG_SSP_SUPPORT),)
  56. HOST_CONFIGURE_ARGS+= \
  57. --enable-libssp
  58. else
  59. HOST_CONFIGURE_ARGS+= \
  60. --disable-libssp
  61. endif
  62. ifneq ($(CONFIG_EXTRA_TARGET_ARCH),)
  63. HOST_CONFIGURE_ARGS+= \
  64. --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX)
  65. endif
  66. HOST_CONFIGURE_VARS += \
  67. acx_cv_cc_gcc_supports_ada=false
  68. define Host/Prepare
  69. $(call Host/Prepare/Default)
  70. ln -snf $(notdir $(HOST_BUILD_DIR)) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
  71. $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
  72. endef
  73. define Host/Compile
  74. +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all
  75. endef
  76. define Host/Install
  77. $(MAKE) -C $(HOST_BUILD_DIR) \
  78. install
  79. $(call FixupLibdir,$(TOOLCHAIN_DIR))
  80. $(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(HOST_BUILD_PREFIX)/bin/readelf
  81. endef
  82. define Host/Clean
  83. rm -rf \
  84. $(HOST_BUILD_DIR) \
  85. $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
  86. endef
  87. $(eval $(call HostBuild))