2 # Copyright (C) 2006-2013 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
11 PKG_VERSION:=$(strip $(subst ",, $(CONFIG_BINUTILS_VERSION)))
15 ifeq ($(findstring linaro, $(CONFIG_BINUTILS_VERSION)),linaro)
16 PKG_SOURCE_URL:=https://releases.linaro.org/13.06/components/toolchain/binutils-linaro/
17 PKG_REV:=2.23.2-2013.06
18 PKG_SOURCE:=$(PKG_NAME)-linaro-$(PKG_REV).tar.bz2
19 BINUTILS_DIR:=$(PKG_NAME)-2.23.2
20 PKG_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(BINUTILS_DIR)
21 PKG_VERSION:=$(PKG_REV)
23 PKG_SOURCE_URL:=@GNU/binutils
24 PKG_SOURCE:=binutils-$(PKG_VERSION).tar.bz2
28 PATCH_DIR:=$(TOPDIR)/toolchain/binutils/patches/$(PKG_VERSION)
31 PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof binutils ld libiberty gold intl
32 PKG_REMOVE_FILES:=libtool.m4
35 PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
39 include $(INCLUDE_DIR)/package.mk
41 define Package/binutils
48 define Package/objdump
55 define Package/binutils/description
56 The Binutils package contains a linker, an assembler, and other tools for handling object files
60 --target=$(REAL_GNU_TARGET_NAME) \
61 --host=$(REAL_GNU_TARGET_NAME) \
62 --build=$(GNU_HOST_NAME) \
68 $(SOFT_FLOAT_CONFIG_OPTION) \
69 $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
71 TARGET_CFLAGS += $(FPIC)
72 TARGET_LDFLAGS := -L$(PKG_BUILD_DIR)/libiberty $(TARGET_LDFLAGS)
74 define Build/Configure
75 $(call Build/Configure/Default)
76 $(call Build/Compile/Default, \
87 $(MAKE) CFLAGS="$(TARGET_CFLAGS)" -C $(PKG_BUILD_DIR)/bfd/po Makefile
90 define Build/InstallDev
91 $(INSTALL_DIR) $(1)/usr/{lib,include}
93 $(PKG_INSTALL_DIR)/usr/lib/* \
96 $(PKG_BUILD_DIR)/include/*.h \
99 $(PKG_INSTALL_DIR)/usr/include/* \
101 rm -f $(1)/usr/include/gdbm.h
105 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/bfd/doc/ CFLAGS="-I$(PKG_BUILD_DIR)/include" chew
106 $(call Build/Compile/Default)
109 define Package/objdump/install
110 $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib
111 $(CP) $(PKG_INSTALL_DIR)/usr/bin/objdump $(1)/usr/bin/
112 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopcodes*.so $(1)/usr/lib/
113 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbfd*.so $(1)/usr/lib/
116 define Package/binutils/install
117 $(INSTALL_DIR) $(1)/usr $(1)/bin
118 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
119 mv $(1)/usr/bin/strings $(1)/bin/strings
120 rm -f $(1)/usr/bin/objdump
123 $(eval $(call BuildPackage,binutils))
124 $(eval $(call BuildPackage,objdump))