2 # Copyright (C) 2006-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR)/rules.mk
10 PKG_VERSION:=$(strip $(subst ",, $(CONFIG_BINUTILS_VERSION)))
14 PKG_SOURCE_URL:=@GNU/binutils
15 PKG_SOURCE:=binutils-$(PKG_VERSION).tar.bz2
18 PATCH_DIR:=$(TOPDIR)/toolchain/binutils/patches/$(PKG_VERSION)
21 PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof binutils ld
24 include $(INCLUDE_DIR)/package.mk
26 define Package/binutils
33 define Package/objdump
40 define Package/binutils/description
41 The Binutils package contains a linker, an assembler, and other tools for handling object files
45 --target=$(REAL_GNU_TARGET_NAME) \
46 --host=$(REAL_GNU_TARGET_NAME) \
47 --build=$(GNU_HOST_NAME) \
48 --with-sysroot=$(PKG_INSTALL_DIR) \
53 $(SOFT_FLOAT_CONFIG_OPTION) \
54 $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
56 TARGET_CFLAGS += $(FPIC)
58 define Build/Configure
59 $(call Build/Configure/Default)
60 $(call Build/Compile/Default, \
71 $(MAKE) CFLAGS="$(TARGET_CFLAGS)"-C $(PKG_BUILD_DIR)/bfd/po Makefile
74 define Build/InstallDev
75 $(INSTALL_DIR) $(1)/usr/{lib,include}
77 $(PKG_INSTALL_DIR)/usr/lib/* \
80 $(PKG_BUILD_DIR)/include/*.h \
83 $(PKG_INSTALL_DIR)/usr/include/* \
85 rm -f $(1)/usr/include/gdbm.h
89 $(MAKE) -C $(PKG_BUILD_DIR)/bfd/doc/ CFLAGS="-I$(PKG_BUILD_DIR)/include" chew
90 $(call Build/Compile/Default)
93 define Package/objdump/install
94 $(INSTALL_DIR) $(1)/usr/bin
95 $(CP) $(PKG_INSTALL_DIR)/usr/$(REAL_GNU_TARGET_NAME)/bin/objdump $(1)/usr/bin/
98 define Package/binutils/install
99 $(INSTALL_DIR) $(1)/usr
100 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
101 $(CP) $(PKG_INSTALL_DIR)/usr/$(REAL_GNU_TARGET_NAME) $(1)/usr
102 rm -f $(1)/usr/bin/objdump
105 $(eval $(call BuildPackage,binutils))
106 $(eval $(call BuildPackage,objdump))