23f1ea9c258c98073952078ea8cc00aec07ac46f
[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.35.1
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:=3ced91db9bf01182b7e420eab68039f2083aed0a214c0424e257eae3ddee8607
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 --enable-install-libctf
89
90 define Build/Install
91 $(call Build/Install/Default)
92 $(MAKE) -C $(PKG_BUILD_DIR)/libiberty \
93 target_header_dir=libiberty \
94 DESTDIR="$(PKG_INSTALL_DIR)" \
95 MULTIOSDIR="" \
96 install
97 endef
98
99 define Build/InstallDev
100 $(CP) $(PKG_INSTALL_DIR)/* $(1)/
101 endef
102
103 define Package/libbfd/install
104 $(INSTALL_DIR) $(1)/usr/lib
105 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbfd*.so* $(1)/usr/lib/
106 endef
107
108 define Package/libctf/install
109 $(INSTALL_DIR) $(1)/usr/lib
110 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libctf*.so* $(1)/usr/lib/
111 endef
112
113 define Package/libopcodes/install
114 $(INSTALL_DIR) $(1)/usr/lib
115 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopcodes*.so $(1)/usr/lib/
116 endef
117
118 define Package/objdump/install
119 $(INSTALL_DIR) $(1)/usr/bin
120 $(CP) $(PKG_INSTALL_DIR)/usr/bin/objdump $(1)/usr/bin/
121 endef
122
123 define Package/ar/install
124 $(INSTALL_DIR) $(1)/usr/bin
125 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ar $(1)/usr/bin/
126 endef
127
128 define Package/binutils/install
129 $(INSTALL_DIR) $(1)/usr $(1)/bin
130 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
131 mv $(1)/usr/bin/strings $(1)/usr/bin/binutils-strings
132 rm -f $(1)/usr/bin/objdump
133 rm -f $(1)/usr/bin/ar
134 endef
135
136 $(eval $(call BuildPackage,libbfd))
137 $(eval $(call BuildPackage,libctf))
138 $(eval $(call BuildPackage,libopcodes))
139 $(eval $(call BuildPackage,binutils))
140 $(eval $(call BuildPackage,objdump))
141 $(eval $(call BuildPackage,ar))