Makefile 2.7 KB

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