9491d7f3d78ca51b06b8c718c8e902f866794ae5
[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 PKG_SOURCE_URL:=@GNU/binutils
14 PKG_SOURCE:=binutils-$(PKG_VERSION).tar.bz2
15 PATCH_DIR:=$(TOPDIR)/toolchain/binutils/patches/$(PKG_VERSION)
16 PKG_INSTALL:=1
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/binutils
21 SECTION:=devel
22 CATEGORY:=Development
23 TITLE:=binutils
24 DEPENDS:=+objdump
25 endef
26
27 define Package/objdump
28 SECTION:=devel
29 CATEGORY:=Development
30 TITLE:=objdump
31 DEPENDS:=+zlib
32 endef
33
34 define Package/binutils/description
35 The Binutils package contains a linker, an assembler, and other tools for handling object files
36 endef
37
38 TARGET_CFLAGS += $(FPIC)
39
40 define Build/Configure
41 $(call Build/Configure/Default, \
42 --disable-werror \
43 --disable-nls \
44 )
45 endef
46
47 define Build/InstallDev
48 $(INSTALL_DIR) $(1)/usr/{lib,include}
49 $(CP) \
50 $(PKG_INSTALL_DIR)/usr/lib/* \
51 $(1)/usr/lib/
52 $(CP) \
53 $(PKG_BUILD_DIR)/include/*.h \
54 $(1)/usr/include/
55 $(CP) \
56 $(PKG_INSTALL_DIR)/usr/include/* \
57 $(1)/usr/include/
58 rm -f $(1)/usr/include/gdbm.h
59 endef
60
61 define Build/Compile
62 $(MAKE) -C $(PKG_BUILD_DIR)/bfd/doc/ CFLAGS="-I$(PKG_BUILD_DIR)/include" chew
63 $(call Build/Compile/Default)
64 endef
65
66 define Package/objdump/install
67 $(INSTALL_DIR) $(1)/usr/bin
68 $(CP) $(PKG_INSTALL_DIR)/usr/*-linux/bin/objdump $(1)/usr/bin/
69 endef
70
71 define Package/binutils/install
72 $(INSTALL_DIR) $(1)/usr
73 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
74 $(CP) $(PKG_INSTALL_DIR)/usr/*-linux $(1)/usr
75 rm -f $(1)/usr/bin/objdump
76 endef
77
78 $(eval $(call BuildPackage,binutils))
79 $(eval $(call BuildPackage,objdump))