package/binutils: actually support the target toolchain
[openwrt/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:=3
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 PKG_LICENSE:=GPL-3.0+
26 PKG_BUILD_PARALLEL:=1
27
28 include $(INCLUDE_DIR)/package.mk
29
30 define Package/libbfd
31 SECTION:=libs
32 CATEGORY:=Libraries
33 TITLE:=libbfd
34 DEPENDS:=+zlib
35 endef
36
37 define Package/libopcodes
38 SECTION:=libs
39 CATEGORY:=Libraries
40 TITLE:=libbfd
41 DEPENDS:=+libbfd
42 endef
43
44 define Package/binutils
45 SECTION:=devel
46 CATEGORY:=Development
47 TITLE:=binutils
48 DEPENDS:=+objdump +ar
49 endef
50
51 define Package/objdump
52 SECTION:=devel
53 CATEGORY:=Development
54 TITLE:=objdump
55 DEPENDS:=+libopcodes
56 endef
57
58 define Package/ar
59 SECTION:=devel
60 CATEGORY:=Development
61 TITLE:=ar
62 DEPENDS:=+zlib +libbfd
63 endef
64
65 define Package/binutils/description
66 The Binutils package contains a linker, an assembler, and other tools for handling object files
67 endef
68
69 TARGET_CFLAGS += $(FPIC) -Wno-unused-value
70
71 CONFIGURE_ARGS += \
72 --host=$(REAL_GNU_TARGET_NAME) \
73 --target=$(REAL_GNU_TARGET_NAME) \
74 --enable-shared \
75 --enable-install-libiberty \
76 --enable-install-libbfd
77
78 define Build/Install
79 $(call Build/Install/Default)
80 $(MAKE) -C $(PKG_BUILD_DIR)/libiberty \
81 target_header_dir=libiberty \
82 DESTDIR="$(PKG_INSTALL_DIR)" \
83 MULTIOSDIR="" \
84 install
85 endef
86
87 define Build/InstallDev
88 $(CP) $(PKG_INSTALL_DIR)/* $(1)/
89 endef
90
91 define Package/libbfd/install
92 $(INSTALL_DIR) $(1)/usr/lib
93 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbfd*.so $(1)/usr/lib/
94 endef
95
96 define Package/libopcodes/install
97 $(INSTALL_DIR) $(1)/usr/lib
98 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopcodes*.so $(1)/usr/lib/
99 endef
100
101 define Package/objdump/install
102 $(INSTALL_DIR) $(1)/usr/bin
103 $(CP) $(PKG_INSTALL_DIR)/usr/bin/objdump $(1)/usr/bin/
104 endef
105
106 define Package/ar/install
107 $(INSTALL_DIR) $(1)/usr/bin
108 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ar $(1)/usr/bin/
109 endef
110
111 define Package/binutils/install
112 $(INSTALL_DIR) $(1)/usr $(1)/bin
113 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
114 mv $(1)/usr/bin/strings $(1)/bin/strings
115 rm -f $(1)/usr/bin/objdump
116 rm -f $(1)/usr/bin/ar
117 endef
118
119 $(eval $(call BuildPackage,libbfd))
120 $(eval $(call BuildPackage,libopcodes))
121 $(eval $(call BuildPackage,binutils))
122 $(eval $(call BuildPackage,objdump))
123 $(eval $(call BuildPackage,ar))