Merge branch 'master' of ../OpenWRT.svn
[openwrt_comio.git] / toolchain / binutils / Makefile
blob2cac51dd89ec653ba29dc54d91d3718f4fe27858
1 #
2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR)/rules.mk
9 PKG_NAME:=binutils
10 PKG_VERSION:=$(strip $(subst ",, $(CONFIG_BINUTILS_VERSION)))
11 #"))
13 PKG_SOURCE_URL:=http://ftp.gnu.org/gnu/binutils/ \
14 ftp://gatekeeper.dec.com/pub/GNU/ \
15 ftp://ftp.uu.net/archive/systems/gnu/ \
16 ftp://ftp.eu.uu.net/pub/gnu/ \
17 ftp://ftp.funet.fi/pub/gnu/prep/ \
18 ftp://ftp.leo.org/pub/comp/os/unix/gnu/
20 PKG_SOURCE:=binutils-$(PKG_VERSION).tar.bz2
21 PATCH_DIR:=./patches/$(PKG_VERSION)
22 STAGING_DIR_HOST:=$(TOOLCHAIN_DIR)
23 BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
25 include $(INCLUDE_DIR)/host-build.mk
27 EXTRA_TARGET=$(if $(CONFIG_EXTRA_TARGET_ARCH),--enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(CONFIG_TARGET_SUFFIX))
29 ifeq ($(CONFIG_USE_EGLIBC),y)
30 BINUTILS_USESYSROOT:=--with-sysroot=$(TOOLCHAIN_DIR)
31 else
32 BINUTILS_USESYSROOT:=
33 endif
35 define Build/Configure
36 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/
37 (cd $(PKG_BUILD_DIR); \
38 ./configure \
39 --prefix=$(STAGING_DIR_HOST) \
40 --build=$(GNU_HOST_NAME) \
41 --host=$(GNU_HOST_NAME) \
42 --target=$(REAL_GNU_TARGET_NAME) \
43 --disable-werror \
44 --disable-nls \
45 $(BINUTILS_USESYSROOT) \
46 $(EXTRA_TARGET) \
47 $(SOFT_FLOAT_CONFIG_OPTION) \
48 $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS)) \
50 endef
52 define Build/Compile
53 $(MAKE) -C $(PKG_BUILD_DIR) all
54 endef
56 define Build/Install
57 $(MAKE) -C $(PKG_BUILD_DIR) install
58 endef
60 $(eval $(call HostBuild))