2 # Copyright (C) 2006-2011 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 PKG_SOURCE_URL:=@GNU/binutils
16 PKG_SOURCE:=binutils-$(PKG_VERSION).tar.bz2
19 PATCH_DIR:=$(TOPDIR)/toolchain/binutils/patches/$(PKG_VERSION)
22 PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof binutils ld libiberty gold intl
23 PKG_REMOVE_FILES:=libtool.m4
26 PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
30 include $(INCLUDE_DIR)/package.mk
32 define Package/binutils
39 define Package/objdump
46 define Package/binutils/description
47 The Binutils package contains a linker, an assembler, and other tools for handling object files
51 --target=$(REAL_GNU_TARGET_NAME) \
52 --host=$(REAL_GNU_TARGET_NAME) \
53 --build=$(GNU_HOST_NAME) \
59 $(SOFT_FLOAT_CONFIG_OPTION) \
60 $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
62 TARGET_CFLAGS += $(FPIC)
63 TARGET_LDFLAGS := -L$(PKG_BUILD_DIR)/libiberty $(TARGET_LDFLAGS)
65 define Build/Configure
66 $(call Build/Configure/Default)
67 $(call Build/Compile/Default, \
78 $(MAKE) CFLAGS="$(TARGET_CFLAGS)" -C $(PKG_BUILD_DIR)/bfd/po Makefile
81 define Build/InstallDev
82 $(INSTALL_DIR) $(1)/usr/{lib,include}
84 $(PKG_INSTALL_DIR)/usr/lib/* \
87 $(PKG_BUILD_DIR)/include/*.h \
90 $(PKG_INSTALL_DIR)/usr/include/* \
92 rm -f $(1)/usr/include/gdbm.h
96 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/bfd/doc/ CFLAGS="-I$(PKG_BUILD_DIR)/include" chew
97 $(call Build/Compile/Default)
100 define Package/objdump/install
101 $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib
102 $(CP) $(PKG_INSTALL_DIR)/usr/bin/objdump $(1)/usr/bin/
103 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopcodes*.so $(1)/usr/lib/
104 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbfd*.so $(1)/usr/lib/
107 define Package/binutils/install
108 $(INSTALL_DIR) $(1)/usr $(1)/bin
109 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
110 mv $(1)/usr/bin/strings $(1)/bin/strings
111 rm -f $(1)/usr/bin/objdump
114 $(eval $(call BuildPackage,binutils))
115 $(eval $(call BuildPackage,objdump))