Makefile 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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:=https://releases.linaro.org/14.09/components/toolchain/binutils-linaro/
  12. PKG_REV:=2.24.0-2014.09
  13. PKG_SOURCE:=$(PKG_NAME)-linaro-$(PKG_REV).tar.xz
  14. PKG_MD5SUM:=8f9b2b2e049d59b1b86ce9657802a353
  15. BINUTILS_DIR:=$(PKG_NAME)-linaro-$(PKG_REV)
  16. HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(BINUTILS_DIR)
  17. HOST_BUILD_PARALLEL:=1
  18. PATCH_DIR:=./patches/$(PKG_VERSION)
  19. REAL_STAGING_DIR_HOST:=$(STAGING_DIR_HOST)
  20. include $(INCLUDE_DIR)/toolchain-build.mk
  21. BINUTILS_CONFIGURE:= \
  22. ./configure \
  23. --prefix=$(TOOLCHAIN_DIR) \
  24. --build=$(GNU_HOST_NAME) \
  25. --host=$(GNU_HOST_NAME) \
  26. --target=$(REAL_GNU_TARGET_NAME) \
  27. --with-sysroot=$(TOOLCHAIN_DIR) \
  28. --enable-plugins \
  29. --disable-multilib \
  30. --disable-werror \
  31. --disable-nls \
  32. $(GRAPHITE_CONFIGURE) \
  33. $(SOFT_FLOAT_CONFIG_OPTION) \
  34. $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
  35. ifneq ($(CONFIG_SSP_SUPPORT),)
  36. BINUTILS_CONFIGURE+= \
  37. --enable-libssp
  38. else
  39. BINUTILS_CONFIGURE+= \
  40. --disable-libssp
  41. endif
  42. ifneq ($(CONFIG_EXTRA_TARGET_ARCH),)
  43. BINUTILS_CONFIGURE+= \
  44. --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX)
  45. endif
  46. define Host/Prepare
  47. $(call Host/Prepare/Default)
  48. ln -snf $(notdir $(HOST_BUILD_DIR)) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
  49. $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
  50. $(SED) 's, " Linaro.*,,' $(HOST_BUILD_DIR)/bfd/version.h
  51. endef
  52. define Host/Configure
  53. (cd $(HOST_BUILD_DIR); \
  54. $(BINUTILS_CONFIGURE) \
  55. );
  56. endef
  57. define Host/Compile
  58. +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all
  59. endef
  60. define Host/Install
  61. mkdir -p $(TOOLCHAIN_DIR)/initial
  62. $(MAKE) -C $(HOST_BUILD_DIR) \
  63. prefix=$(TOOLCHAIN_DIR)/initial \
  64. install
  65. $(MAKE) -C $(HOST_BUILD_DIR) \
  66. prefix=$(TOOLCHAIN_DIR) \
  67. install
  68. $(call FixupLibdir,$(TOOLCHAIN_DIR)/initial)
  69. $(RM) $(TOOLCHAIN_DIR)/initial/lib/libiberty.a
  70. $(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(REAL_STAGING_DIR_HOST)/bin/readelf
  71. endef
  72. define Host/Clean
  73. rm -rf \
  74. $(HOST_BUILD_DIR) \
  75. $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
  76. endef
  77. $(eval $(call HostBuild))