binutils: the shared variant of libbfd/libopcodes is being generated and used again...
[openwrt/svn-archive/archive.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
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/libbfd
27 SECTION:=devel
28 CATEGORY:=Development
29 TITLE:=libbfd
30 endef
31
32 define Package/binutils
33 SECTION:=devel
34 CATEGORY:=Development
35 TITLE:=binutils
36 DEPENDS:=+objdump
37 endef
38
39 define Package/objdump
40 SECTION:=devel
41 CATEGORY:=Development
42 TITLE:=objdump
43 DEPENDS:=+zlib +libbfd
44 endef
45
46 define Package/binutils/description
47 The Binutils package contains a linker, an assembler, and other tools for handling object files
48 endef
49
50 TARGET_CFLAGS += $(FPIC)
51
52 define Build/Configure
53 $(call Build/Configure/Default, \
54 --disable-werror \
55 --disable-nls \
56 )
57 $(call Build/Compile/Default, \
58 configure-bfd \
59 configure-binutils \
60 configure-etc \
61 configure-gas \
62 configure-gprof \
63 configure-intl \
64 configure-ld \
65 configure-libiberty \
66 configure-opcodes \
67 )
68 $(MAKE) -C $(PKG_BUILD_DIR)/bfd/po Makefile
69 endef
70
71 define Build/InstallDev
72 $(INSTALL_DIR) $(1)/usr/{lib,include}
73 $(CP) \
74 $(PKG_INSTALL_DIR)/usr/lib/* \
75 $(1)/usr/lib/
76 $(CP) \
77 $(PKG_BUILD_DIR)/include/*.h \
78 $(1)/usr/include/
79 $(CP) \
80 $(PKG_INSTALL_DIR)/usr/include/* \
81 $(1)/usr/include/
82 rm -f $(1)/usr/include/gdbm.h
83 endef
84
85 define Build/Compile
86 $(MAKE) -C $(PKG_BUILD_DIR)/bfd/doc/ CFLAGS="-I$(PKG_BUILD_DIR)/include" chew
87 $(call Build/Compile/Default)
88 endef
89
90 define Package/libbfd/install
91 $(INSTALL_DIR) $(1)/usr/lib
92 $(CP) \
93 $(PKG_INSTALL_DIR)/usr/lib/libopcodes-$(PKG_VERSION).so \
94 $(PKG_INSTALL_DIR)/usr/lib/libbfd-$(PKG_VERSION).so \
95 $(1)/usr/lib/
96 endef
97
98 define Package/objdump/install
99 $(INSTALL_DIR) $(1)/usr/bin
100 $(CP) $(PKG_INSTALL_DIR)/usr/*-linux/bin/objdump $(1)/usr/bin/
101 endef
102
103 define Package/binutils/install
104 $(INSTALL_DIR) $(1)/usr
105 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
106 $(CP) $(PKG_INSTALL_DIR)/usr/*-linux $(1)/usr
107 rm -f $(1)/usr/bin/objdump
108 endef
109
110 $(eval $(call BuildPackage,libbfd))
111 $(eval $(call BuildPackage,binutils))
112 $(eval $(call BuildPackage,objdump))