add binutils 2.21
[openwrt/openwrt.git] / toolchain / binutils / Makefile
1 #
2 # Copyright (C) 2006-2009 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:=@GNU/binutils/
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15
16 ifeq ($(PKG_VERSION),2.19.1)
17 PKG_MD5SUM:=09a8c5821a2dfdbb20665bc0bd680791
18 endif
19 ifeq ($(PKG_VERSION),2.19.1+cs)
20 BIN_VERSION:=20090205
21 PKG_SOURCE:=$(PKG_NAME)-$(BIN_VERSION).tar.bz2
22 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
23 PKG_MD5SUM:=040740e8c864dd1a15886753f9c0bc0b
24 HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/binutils-$(BIN_VERSION)
25 endif
26 ifeq ($(PKG_VERSION),2.20.1)
27 PKG_MD5SUM:=9cdfb9d6ec0578c166d3beae5e15c4e5
28 endif
29 ifeq ($(PKG_VERSION),2.21)
30 PKG_MD5SUM:=c84c5acc9d266f1a7044b51c85a823f5
31 endif
32
33 PATCH_DIR:=./patches/$(PKG_VERSION)
34
35 REAL_STAGING_DIR_HOST:=$(STAGING_DIR_HOST)
36
37 include $(INCLUDE_DIR)/toolchain-build.mk
38
39 BINUTILS_CONFIGURE:= \
40 ./configure \
41 --prefix=$(TOOLCHAIN_DIR) \
42 --build=$(GNU_HOST_NAME) \
43 --host=$(GNU_HOST_NAME) \
44 --target=$(REAL_GNU_TARGET_NAME) \
45 --with-sysroot=$(TOOLCHAIN_DIR) \
46 --disable-multilib \
47 --disable-werror \
48 --disable-nls \
49 $(GRAPHITE_CONFIGURE) \
50 $(SOFT_FLOAT_CONFIG_OPTION) \
51 $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
52
53 ifneq ($(CONFIG_SSP_SUPPORT),)
54 BINUTILS_CONFIGURE+= \
55 --enable-libssp
56 else
57 BINUTILS_CONFIGURE+= \
58 --disable-libssp
59 endif
60
61 ifneq ($(CONFIG_EXTRA_TARGET_ARCH),)
62 BINUTILS_CONFIGURE+= \
63 --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX)
64 endif
65
66 define Host/Prepare
67 $(call Host/Prepare/Default)
68 ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
69 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
70 endef
71
72 define Host/Configure
73 (cd $(HOST_BUILD_DIR); \
74 $(BINUTILS_CONFIGURE) \
75 );
76 endef
77
78 define Host/Compile
79 $(MAKE) $(TOOLCHAIN_JOBS) -C $(HOST_BUILD_DIR) all
80 endef
81
82 define Host/Install
83 $(MAKE) -C $(HOST_BUILD_DIR) install
84 $(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(REAL_STAGING_DIR_HOST)/bin/readelf
85 endef
86
87 define Host/Clean
88 rm -rf \
89 $(HOST_BUILD_DIR) \
90 $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
91 endef
92
93 $(eval $(call HostBuild))