binutils: update to version 2.34
[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.34
12 PKG_RELEASE:=1
13
14 PKG_SOURCE_URL:=@GNU/binutils
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
16 PKG_VERSION:=$(PKG_VERSION)
17 PKG_HASH:=f00b0e8803dc9bab1e2165bd568528135be734df3fabf8d0161828cd56028952
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@nbd.name>
25 PKG_LICENSE:=GPL-3.0+
26 PKG_CPE_ID:=cpe:/a:gnu:binutils
27 PKG_BUILD_PARALLEL:=1
28 PKG_USE_MIPS16:=0
29
30 include $(INCLUDE_DIR)/nls.mk
31 include $(INCLUDE_DIR)/package.mk
32
33 define Package/libbfd
34 SECTION:=libs
35 CATEGORY:=Libraries
36 TITLE:=libbfd
37 DEPENDS:=+zlib $(ICONV_DEPENDS) $(INTL_DEPENDS)
38 endef
39
40 define Package/libctf
41 SECTION:=libs
42 CATEGORY:=Libraries
43 TITLE:=libctf
44 DEPENDS:=+libbfd
45 endef
46
47 define Package/libopcodes
48 SECTION:=libs
49 CATEGORY:=Libraries
50 TITLE:=libopcodes
51 DEPENDS:=+libbfd
52 endef
53
54 define Package/binutils
55 SECTION:=devel
56 CATEGORY:=Development
57 TITLE:=binutils
58 DEPENDS:=+objdump +ar
59 ALTERNATIVES:=200:/usr/bin/strings:/usr/bin/binutils-strings
60 endef
61
62 define Package/objdump
63 SECTION:=devel
64 CATEGORY:=Development
65 TITLE:=objdump
66 DEPENDS:=+libopcodes +libctf
67 endef
68
69 define Package/ar
70 SECTION:=devel
71 CATEGORY:=Development
72 TITLE:=ar
73 DEPENDS:=+zlib +libbfd
74 endef
75
76 define Package/binutils/description
77 The Binutils package contains a linker, an assembler, and other tools for handling object files
78 endef
79
80 TARGET_CFLAGS += $(FPIC) -Wno-unused-value
81
82 CONFIGURE_ARGS += \
83 --host=$(REAL_GNU_TARGET_NAME) \
84 --target=$(REAL_GNU_TARGET_NAME) \
85 --enable-shared \
86 --enable-install-libiberty \
87 --enable-install-libbfd
88
89 define Build/Install
90 $(call Build/Install/Default)
91 $(MAKE) -C $(PKG_BUILD_DIR)/libiberty \
92 target_header_dir=libiberty \
93 DESTDIR="$(PKG_INSTALL_DIR)" \
94 MULTIOSDIR="" \
95 install
96 endef
97
98 define Build/InstallDev
99 $(CP) $(PKG_INSTALL_DIR)/* $(1)/
100 endef
101
102 define Package/libbfd/install
103 $(INSTALL_DIR) $(1)/usr/lib
104 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbfd*.so* $(1)/usr/lib/
105 endef
106
107 define Package/libctf/install
108 $(INSTALL_DIR) $(1)/usr/lib
109 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libctf.so* $(1)/usr/lib/
110 endef
111
112 define Package/libopcodes/install
113 $(INSTALL_DIR) $(1)/usr/lib
114 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopcodes*.so $(1)/usr/lib/
115 endef
116
117 define Package/objdump/install
118 $(INSTALL_DIR) $(1)/usr/bin
119 $(CP) $(PKG_INSTALL_DIR)/usr/bin/objdump $(1)/usr/bin/
120 endef
121
122 define Package/ar/install
123 $(INSTALL_DIR) $(1)/usr/bin
124 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ar $(1)/usr/bin/
125 endef
126
127 define Package/binutils/install
128 $(INSTALL_DIR) $(1)/usr $(1)/bin
129 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
130 mv $(1)/usr/bin/strings $(1)/usr/bin/binutils-strings
131 rm -f $(1)/usr/bin/objdump
132 rm -f $(1)/usr/bin/ar
133 endef
134
135 $(eval $(call BuildPackage,libbfd))
136 $(eval $(call BuildPackage,libctf))
137 $(eval $(call BuildPackage,libopcodes))
138 $(eval $(call BuildPackage,binutils))
139 $(eval $(call BuildPackage,objdump))
140 $(eval $(call BuildPackage,ar))