db3ea75d444610f6dd90b7ac953c580079e6b420
[openwrt/openwrt.git] / toolchain / binutils / Makefile
1 #
2 # Copyright (C) 2006-2008 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
12 PKG_SOURCE_URL:=@GNU/binutils/
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
14
15 ifeq ($(PKG_VERSION),2.17)
16 PKG_MD5SUM:=e26e2e06b6e4bf3acf1dc8688a94c0d1
17 endif
18 ifeq ($(PKG_VERSION),2.18)
19 PKG_MD5SUM:=9d22ee4dafa3a194457caf4706f9cf01
20 endif
21
22 PATCH_DIR:=./patches/$(PKG_VERSION)
23
24 STAGING_DIR_HOST:=$(TOOLCHAIN_DIR)
25 BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
26
27 override CONFIG_AUTOREBUILD=
28
29 include $(INCLUDE_DIR)/host-build.mk
30
31 EXTRA_TARGET=$(if $(CONFIG_EXTRA_TARGET_ARCH),--enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX))
32
33 define Build/Prepare
34 $(call Build/Prepare/Default)
35 ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
36 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/
37 endef
38
39 define Build/Configure
40 (cd $(PKG_BUILD_DIR); \
41 ./configure \
42 --prefix=$(TOOLCHAIN_DIR)/usr \
43 --build=$(GNU_HOST_NAME) \
44 --host=$(GNU_HOST_NAME) \
45 --target=$(REAL_GNU_TARGET_NAME) \
46 --with-sysroot=$(TOOLCHAIN_DIR) \
47 --disable-multilib \
48 --disable-werror \
49 --disable-nls \
50 $(EXTRA_TARGET) \
51 $(SOFT_FLOAT_CONFIG_OPTION) \
52 $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS)) \
53 );
54 endef
55
56 define Build/Compile
57 $(MAKE) -C $(PKG_BUILD_DIR) all
58 endef
59
60 define Build/Install
61 $(MAKE) -C $(PKG_BUILD_DIR) install
62 endef
63
64 define Build/Clean
65 rm -rf \
66 $(PKG_BUILD_DIR) \
67 $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
68 endef
69
70 $(eval $(call HostBuild))