Merge libbfd and binutils Makefile.
[packages.git] / devel / binutils / Makefile
1 #
2 # Copyright (C) 2006 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:=1
13 PKG_SOURCE_URL:=http://ftp.gnu.org/gnu/binutils/ \
14         ftp://gatekeeper.dec.com/pub/GNU/ \
15                 ftp://ftp.uu.net/archive/systems/gnu/ \
16                 ftp://ftp.eu.uu.net/pub/gnu/ \
17                 ftp://ftp.funet.fi/pub/gnu/prep/ \
18                 ftp://ftp.leo.org/pub/comp/os/unix/gnu/
19
20 PKG_SOURCE:=binutils-$(PKG_VERSION).tar.bz2
21 PATCH_DIR:=$(TOPDIR)/toolchain/binutils/patches/$(PKG_VERSION)
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:=@TARGET_x86
31 endef
32
33 define Package/binutils/description
34   The Binutils package contains a linker, an assembler, and other tools for handling object files
35 endef
36
37 define Package/libbfd
38   SECTION:=libs
39   CATEGORY:=Libraries
40   TITLE:=libbfd
41 endef
42
43 define Build/Configure
44         $(call Build/Configure/Default, \
45                 --disable-werror \
46                 --disable-nls \
47         )
48 endef
49
50 define Build/InstallDev
51         $(INSTALL_DIR) $(1)/usr/{lib,include}
52         $(INSTALL_DATA) \
53                 $(PKG_INSTALL_DIR)/usr/lib/libbfd.a \
54                 $(1)/usr/lib/
55         $(INSTALL_DATA) \
56                 $(PKG_INSTALL_DIR)/usr/include/{symcat,ansidecl,bfd,bfdlink}.h \
57                 $(1)/usr/include/
58 endef
59
60 define Build/Compile
61         make -C $(PKG_BUILD_DIR)/bfd/doc/ CFLAGS="-I$(PKG_BUILD_DIR)/include" chew
62         $(call Build/Compile/Default)
63 endef
64
65 define Package/binutils/install
66         $(INSTALL_DIR) $(1)/usr
67         $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
68         $(CP) $(PKG_INSTALL_DIR)/usr/*-linux $(1)/usr
69 endef
70
71 define Package/libbdf/install
72     true
73 endef
74
75 $(eval $(call BuildPackage,binutils))
76 $(eval $(call BuildPackage,libbfd))