[packages] devel/binutils: Removed libbfd as it is no longer generated/used
[packages.git] / devel / binutils / Makefile
1 #
2 # Copyright (C) 2006-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=binutils
10 PKG_VERSION:=$(strip $(subst ",, $(CONFIG_BINUTILS_VERSION)))
11 #"))
12 PKG_RELEASE:=3
13
14 PKG_SOURCE_URL:=@GNU/binutils
15 PKG_SOURCE:=binutils-$(PKG_VERSION).tar.bz2
16 PKG_MD5SUM:=
17
18 PATCH_DIR:=$(TOPDIR)/toolchain/binutils/patches/$(PKG_VERSION)
19
20 PKG_FIXUP:=libtool
21 PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof binutils ld
22 PKG_INSTALL:=1
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/binutils
27   SECTION:=devel
28   CATEGORY:=Development
29   TITLE:=binutils
30   DEPENDS:=+objdump
31 endef
32
33 define Package/objdump
34   SECTION:=devel
35   CATEGORY:=Development
36   TITLE:=objdump
37   DEPENDS:=+zlib 
38 endef
39
40 define Package/binutils/description
41   The Binutils package contains a linker, an assembler, and other tools for handling object files
42 endef
43
44 CONFIGURE_ARGS = \
45                 --target=$(REAL_GNU_TARGET_NAME) \
46                 --host=$(REAL_GNU_TARGET_NAME) \
47                 --build=$(GNU_HOST_NAME) \
48                 --with-sysroot=$(PKG_INSTALL_DIR) \
49                 --prefix=/usr \
50                 --disable-multilib \
51                 --disable-werror \
52                 --disable-nls \
53                 $(SOFT_FLOAT_CONFIG_OPTION) \
54                 $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
55
56 TARGET_CFLAGS += $(FPIC)
57
58 define Build/Configure
59         $(call Build/Configure/Default)
60         $(call Build/Compile/Default, \
61                 configure-bfd \
62                 configure-binutils \
63                 configure-etc \
64                 configure-gas \
65                 configure-gprof \
66                 configure-intl \
67                 configure-ld \
68                 configure-libiberty \
69                 configure-opcodes \
70         )
71         $(MAKE) CFLAGS="$(TARGET_CFLAGS)"-C $(PKG_BUILD_DIR)/bfd/po Makefile
72 endef
73
74 define Build/InstallDev
75         $(INSTALL_DIR) $(1)/usr/{lib,include}
76         $(CP) \
77                 $(PKG_INSTALL_DIR)/usr/lib/* \
78                 $(1)/usr/lib/
79         $(CP) \
80                 $(PKG_BUILD_DIR)/include/*.h \
81                 $(1)/usr/include/
82         $(CP) \
83                 $(PKG_INSTALL_DIR)/usr/include/* \
84                 $(1)/usr/include/
85         rm -f $(1)/usr/include/gdbm.h
86 endef
87
88 define Build/Compile
89         $(MAKE) -C $(PKG_BUILD_DIR)/bfd/doc/ CFLAGS="-I$(PKG_BUILD_DIR)/include" chew
90         $(call Build/Compile/Default)
91 endef
92
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/
96 endef
97
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
103 endef
104
105 $(eval $(call BuildPackage,binutils))
106 $(eval $(call BuildPackage,objdump))