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