[packages] Add missing libtool fixups
[packages.git] / devel / binutils / Makefile
1 #
2 # Copyright (C) 2006-2009 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:=2
13 PKG_SOURCE_URL:=@GNU/binutils
14 PKG_SOURCE:=binutils-$(PKG_VERSION).tar.bz2
15 PATCH_DIR:=$(TOPDIR)/toolchain/binutils/patches/$(PKG_VERSION)
16
17 PKG_FIXUP:=libtool
18 PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof binutils ld
19 PKG_INSTALL:=1
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/binutils
24   SECTION:=devel
25   CATEGORY:=Development
26   TITLE:=binutils
27   DEPENDS:=+objdump
28 endef
29
30 define Package/objdump
31   SECTION:=devel
32   CATEGORY:=Development
33   TITLE:=objdump
34   DEPENDS:=+zlib
35 endef
36
37 define Package/binutils/description
38   The Binutils package contains a linker, an assembler, and other tools for handling object files
39 endef
40
41 TARGET_CFLAGS += $(FPIC)
42
43 define Build/Configure
44         $(call Build/Configure/Default, \
45                 --disable-werror \
46                 --disable-nls \
47         )
48         $(call Build/Compile/Default, \
49                 configure-bfd \
50                 configure-binutils \
51                 configure-etc \
52                 configure-gas \
53                 configure-gprof \
54                 configure-intl \
55                 configure-ld \
56                 configure-libiberty \
57                 configure-opcodes \
58         )
59         $(MAKE) -C $(PKG_BUILD_DIR)/bfd/po Makefile
60 endef
61
62 define Build/InstallDev
63         $(INSTALL_DIR) $(1)/usr/{lib,include}
64         $(CP) \
65                 $(PKG_INSTALL_DIR)/usr/lib/* \
66                 $(1)/usr/lib/
67         $(CP) \
68                 $(PKG_BUILD_DIR)/include/*.h \
69                 $(1)/usr/include/
70         $(CP) \
71                 $(PKG_INSTALL_DIR)/usr/include/* \
72                 $(1)/usr/include/
73         rm -f $(1)/usr/include/gdbm.h
74 endef
75
76 define Build/Compile
77         $(MAKE) -C $(PKG_BUILD_DIR)/bfd/doc/ CFLAGS="-I$(PKG_BUILD_DIR)/include" chew
78         $(call Build/Compile/Default)
79 endef
80
81 define Package/objdump/install
82         $(INSTALL_DIR) $(1)/usr/bin
83         $(CP) $(PKG_INSTALL_DIR)/usr/*-linux/bin/objdump $(1)/usr/bin/
84 endef
85
86 define Package/binutils/install
87         $(INSTALL_DIR) $(1)/usr
88         $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
89         $(CP) $(PKG_INSTALL_DIR)/usr/*-linux $(1)/usr
90         rm -f $(1)/usr/bin/objdump
91 endef
92
93 $(eval $(call BuildPackage,binutils))
94 $(eval $(call BuildPackage,objdump))