adds native toolchain
[packages.git] / devel / 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 PKG_RELEASE:=1
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/
19
20 PKG_SOURCE:=binutils-$(PKG_VERSION).tar.bz2
21 PATCH_DIR:=$(TOPDIR)/toolchain/binutils/patches/$(PKG_VERSION)
22
23 include $(INCLUDE_DIR)/package.mk
24
25 CONFIGURE_ARGS_XTRA+=--disable-werror \
26                 --disable-nls
27
28 define Package/binutils
29   SECTION:=devel
30   CATEGORY:=Development
31   TITLE:=binutils
32   DEPENDS:=@TARGET_x86
33 endef
34
35 define Package/binutils/description
36   The Binutils package contains a linker, an assembler, and other tools for handling object files
37 endef
38
39 define Build/Configure
40         (cd  $(PKG_BUILD_DIR)/; \
41                 $(TARGET_CONFIGURE_OPTS) \
42                 $(CONFIGURE_VARS) \
43                 $(CONFIGURE_CMD) \
44                 $(CONFIGURE_ARGS_XTRA) \
45                 $(CONFIGURE_ARGS) \
46         );
47 endef
48
49 define Build/Compile
50         make -C $(PKG_BUILD_DIR)/bfd/doc/ CFLAGS="-I$(PKG_BUILD_DIR)/include" chew
51         $(MAKE) -C $(PKG_BUILD_DIR) all
52         $(MAKE) -C $(PKG_BUILD_DIR) install DESTDIR=$(PKG_INSTALL_DIR)
53 endef
54
55 define Package/binutils/install
56         $(INSTALL_DIR) $(1)/usr
57         $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
58         $(CP) $(PKG_INSTALL_DIR)/usr/*-linux $(1)/usr
59 endef
60
61 $(eval $(call BuildPackage,binutils))