6d4f96f9143aa306b08c74ceff20f9c1226b4298
[openwrt.git] / toolchain / binutils / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=binutils
4 PKG_VERSION:=$(strip $(subst ",, $(CONFIG_BINUTILS_VERSION)))#"))
5
6 STABLE_SITE:=http://ftp.gnu.org/gnu/binutils/ \
7         ftp://gatekeeper.dec.com/pub/GNU/ \
8         ftp://ftp.uu.net/archive/systems/gnu/ \
9         ftp://ftp.eu.uu.net/pub/gnu/ \
10         ftp://ftp.funet.fi/pub/gnu/prep/ \
11         ftp://ftp.leo.org/pub/comp/os/unix/gnu/ 
12
13 DEVEL_SITE:=http://www.fr.kernel.org/pub/linux/devel/binutils \
14                http://www.fi.kernel.org/pub/linux/devel/binutils \
15                http://ftp.kernel.org/pub/linux/devel/binutils \
16                http://www.de.kernel.org/pub/linux/devel/binutils
17
18 ifeq ($(BINUTILS_VERSION),2.16.1)
19 PKG_SOURCE_URL:=$(STABLE_SITE)
20 else
21 PKG_SOURCE_URL:=$(DEVEL_SITE)
22 endif
23
24 PKG_SOURCE:=binutils-$(PKG_VERSION).tar.bz2
25 PKG_MD5SUM:=unknown
26 PKG_BUILD_DIR:=$(TOOL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
27 PKG_CAT:=bzcat
28
29 include $(INCLUDE_DIR)/host-build.mk
30
31
32 define Build/Prepare
33         $(call Build/Prepare/Default)
34         if [ -d ./patches/$(PKG_VERSION) ]; then \
35                 $(SCRIPT_DIR)/patch-kernel.sh $(PKG_BUILD_DIR) ./patches/$(PKG_VERSION); \
36         fi
37 endef
38
39 define Build/Configure
40         (cd $(PKG_BUILD_DIR); \
41                 ./configure \
42                 --prefix=$(STAGING_DIR) \
43                 --build=$(GNU_HOST_NAME) \
44                 --host=$(GNU_HOST_NAME) \
45                 --target=$(REAL_GNU_TARGET_NAME) \
46                 --disable-werror \
47                 --disable-nls \
48         );
49 endef
50
51 define Build/Compile
52         $(MAKE) -C $(PKG_BUILD_DIR) -j $(CONFIG_JLEVEL) all
53 endef
54
55 define Build/Install
56         $(MAKE) -C $(PKG_BUILD_DIR) -j $(CONFIG_JLEVEL) install
57 endef
58
59 $(eval $(call HostBuild))