binutils: decouple from toolchain selection, use version 2.24, fix libiberty installation
[15.05/openwrt.git] / package / devel / binutils / Makefile
1 #
2 # Copyright (C) 2006-2013 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=binutils
11 PKG_VERSION:=2.24
12 PKG_RELEASE:=1
13
14 PKG_SOURCE_URL:=@GNU/binutils
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_VERSION:=$(PKG_VERSION)
17 PKG_MD5SUM:=e0f71a7b2ddab0f8612336ac81d9636b
18
19 PKG_FIXUP:=autoreconf
20 PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof binutils ld libiberty gold intl
21 PKG_REMOVE_FILES:=libtool.m4
22 PKG_INSTALL:=1
23
24 PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
25
26 PKG_BUILD_PARALLEL:=1
27
28 include $(INCLUDE_DIR)/package.mk
29
30 define Package/binutils
31   SECTION:=devel
32   CATEGORY:=Development
33   TITLE:=binutils
34   DEPENDS:=+objdump
35 endef
36
37 define Package/objdump
38   SECTION:=devel
39   CATEGORY:=Development
40   TITLE:=objdump
41   DEPENDS:=+zlib 
42 endef
43
44 define Package/binutils/description
45   The Binutils package contains a linker, an assembler, and other tools for handling object files
46 endef
47
48 TARGET_CFLAGS += $(FPIC)
49
50 CONFIGURE_ARGS += \
51         --enable-install-libiberty \
52         --enable-install-libbfd
53
54 define Build/Install
55         $(call Build/Install/Default)
56         $(MAKE) -C $(PKG_BUILD_DIR)/libiberty \
57                 target_header_dir=libiberty \
58                 DESTDIR="$(PKG_INSTALL_DIR)" \
59                 MULTIOSDIR="" \
60                 install
61 endef
62
63 define Build/InstallDev
64         $(CP) $(PKG_INSTALL_DIR)/* $(1)/
65 endef
66
67 define Package/objdump/install
68         $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib
69         $(CP) $(PKG_INSTALL_DIR)/usr/bin/objdump $(1)/usr/bin/
70 endef
71
72 define Package/binutils/install
73         $(INSTALL_DIR) $(1)/usr $(1)/bin
74         $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
75         mv $(1)/usr/bin/strings $(1)/bin/strings
76         rm -f $(1)/usr/bin/objdump
77 endef
78
79 $(eval $(call BuildPackage,binutils))
80 $(eval $(call BuildPackage,objdump))