1
0

Makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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.29.1)
  15. PKG_HASH:=e7010a46969f9d3e53b650a518663f98a5dde3c3ae21b7d71e5e6803bc36b577
  16. endif
  17. ifeq ($(PKG_VERSION),2.31.1)
  18. PKG_HASH:=5d20086ecf5752cc7d9134246e9588fa201740d540f7eb84d795b1f7a93bca86
  19. endif
  20. ifeq ($(PKG_VERSION),2.32)
  21. PKG_HASH:=0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
  22. endif
  23. HOST_BUILD_PARALLEL:=1
  24. PATCH_DIR:=./patches/$(PKG_VERSION)
  25. include $(INCLUDE_DIR)/toolchain-build.mk
  26. HOST_CONFIGURE_ARGS = \
  27. --prefix=$(TOOLCHAIN_DIR) \
  28. --build=$(GNU_HOST_NAME) \
  29. --host=$(GNU_HOST_NAME) \
  30. --target=$(REAL_GNU_TARGET_NAME) \
  31. --with-sysroot=$(TOOLCHAIN_DIR) \
  32. --enable-deterministic-archives \
  33. --enable-plugins \
  34. --disable-multilib \
  35. --disable-werror \
  36. --disable-nls \
  37. --disable-sim \
  38. --disable-gdb \
  39. $(GRAPHITE_CONFIGURE) \
  40. $(SOFT_FLOAT_CONFIG_OPTION) \
  41. $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
  42. ifneq ($(CONFIG_SSP_SUPPORT),)
  43. HOST_CONFIGURE_ARGS+= \
  44. --enable-libssp
  45. else
  46. HOST_CONFIGURE_ARGS+= \
  47. --disable-libssp
  48. endif
  49. ifneq ($(CONFIG_EXTRA_TARGET_ARCH),)
  50. HOST_CONFIGURE_ARGS+= \
  51. --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX)
  52. endif
  53. define Host/Prepare
  54. $(call Host/Prepare/Default)
  55. ln -snf $(notdir $(HOST_BUILD_DIR)) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
  56. $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
  57. $(SED) 's, " Linaro.*,,' $(HOST_BUILD_DIR)/bfd/version.h
  58. endef
  59. define Host/Compile
  60. +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all
  61. endef
  62. define Host/Install
  63. mkdir -p $(TOOLCHAIN_DIR)/initial
  64. $(MAKE) -C $(HOST_BUILD_DIR) \
  65. prefix=$(TOOLCHAIN_DIR)/initial \
  66. install
  67. $(MAKE) -C $(HOST_BUILD_DIR) \
  68. prefix=$(TOOLCHAIN_DIR) \
  69. install
  70. $(call FixupLibdir,$(TOOLCHAIN_DIR)/initial)
  71. $(RM) $(TOOLCHAIN_DIR)/initial/lib/libiberty.a
  72. $(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(HOST_BUILD_PREFIX)/bin/readelf
  73. # ARC gcc requires extlib.
  74. # If extlib is not available in "initial" folder
  75. # initial gcc will fail to build libc.
  76. if [ -d $(TOOLCHAIN_DIR)/extlib ]; then \
  77. $(CP) -r $(TOOLCHAIN_DIR)/extlib $(TOOLCHAIN_DIR)/initial/; \
  78. fi
  79. endef
  80. define Host/Clean
  81. rm -rf \
  82. $(HOST_BUILD_DIR) \
  83. $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
  84. endef
  85. $(eval $(call HostBuild))