add missing copyright
[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:=$(strip $(subst ",, $(CONFIG_BINUTILS_VERSION)))#"))
11
12 STABLE_SITE:=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 DEVEL_SITE:=http://www.fr.kernel.org/pub/linux/devel/binutils \
20                http://www.fi.kernel.org/pub/linux/devel/binutils \
21                http://ftp.kernel.org/pub/linux/devel/binutils \
22                http://www.de.kernel.org/pub/linux/devel/binutils
23
24 ifeq ($(BINUTILS_VERSION),2.16.1)
25 PKG_SOURCE_URL:=$(STABLE_SITE)
26 else
27 PKG_SOURCE_URL:=$(DEVEL_SITE)
28 endif
29
30 PKG_SOURCE:=binutils-$(PKG_VERSION).tar.bz2
31 PKG_MD5SUM:=unknown
32 PKG_BUILD_DIR:=$(TOOL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
33 PKG_CAT:=bzcat
34
35 include $(INCLUDE_DIR)/host-build.mk
36
37
38 define Build/Prepare
39         $(call Build/Prepare/Default)
40         if [ -d ./patches/$(PKG_VERSION) ]; then \
41                 $(SCRIPT_DIR)/patch-kernel.sh $(PKG_BUILD_DIR) ./patches/$(PKG_VERSION); \
42         fi
43 endef
44
45 define Build/Configure
46         (cd $(PKG_BUILD_DIR); \
47                 ./configure \
48                 --prefix=$(STAGING_DIR) \
49                 --build=$(GNU_HOST_NAME) \
50                 --host=$(GNU_HOST_NAME) \
51                 --target=$(REAL_GNU_TARGET_NAME) \
52                 --disable-werror \
53                 --disable-nls \
54         );
55 endef
56
57 define Build/Compile
58         $(MAKE) -C $(PKG_BUILD_DIR) -j $(CONFIG_JLEVEL) all
59 endef
60
61 define Build/Install
62         $(MAKE) -C $(PKG_BUILD_DIR) -j $(CONFIG_JLEVEL) install
63 endef
64
65 $(eval $(call HostBuild))