Makefile 2.6 KB

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