use qstrip macro to strip quoted CONFIG_* strings
[openwrt.git] / toolchain / binutils / Makefile
1
2 # Copyright (C) 2006 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:=http://ftp.gnu.org/gnu/binutils/ \
13         ftp://gatekeeper.dec.com/pub/GNU/ \
14         ftp://ftp.uu.net/archive/systems/gnu/ \
15         ftp://ftp.eu.uu.net/pub/gnu/ \
16         ftp://ftp.funet.fi/pub/gnu/prep/ \
17         ftp://ftp.leo.org/pub/comp/os/unix/gnu/ 
18
19 PKG_SOURCE:=binutils-$(PKG_VERSION).tar.bz2
20 PATCH_DIR:=./patches/$(PKG_VERSION)
21 STAGING_DIR_HOST:=$(TOOLCHAIN_DIR)
22 BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
23
24 include $(INCLUDE_DIR)/host-build.mk
25
26 EXTRA_TARGET=$(if $(CONFIG_EXTRA_TARGET_ARCH),--enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-uclibc)
27
28 define Build/Configure
29         $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/
30         (cd $(PKG_BUILD_DIR); \
31                 ./configure \
32                 --prefix=$(STAGING_DIR_HOST) \
33                 --build=$(GNU_HOST_NAME) \
34                 --host=$(GNU_HOST_NAME) \
35                 --target=$(REAL_GNU_TARGET_NAME) \
36                 --disable-werror \
37                 --disable-nls \
38                 $(EXTRA_TARGET) \
39                 $(SOFT_FLOAT_CONFIG_OPTION) \
40                 $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS)) \
41         );
42 endef
43
44 define Build/Compile
45         $(MAKE) -C $(PKG_BUILD_DIR) all
46 endef
47
48 define Build/Install
49         $(MAKE) -C $(PKG_BUILD_DIR) install
50 endef
51
52 $(eval $(call HostBuild))