16b39bcf684248238502e1f91085a89ff2070489
[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 define Package/libbfd
39 SECTION:=libs
40 CATEGORY:=Libraries
41 TITLE:=libbfd
42 endef
43
44 TARGET_CFLAGS += $(FPIC)
45
46 define Build/Configure
47 $(call Build/Configure/Default, \
48 --disable-werror \
49 --disable-nls \
50 )
51 endef
52
53 define Build/InstallDev
54 $(INSTALL_DIR) $(1)/usr/{lib,include}
55 $(CP) \
56 $(PKG_INSTALL_DIR)/usr/lib/* \
57 $(1)/usr/lib/
58 $(CP) \
59 $(PKG_BUILD_DIR)/include/*.h \
60 $(1)/usr/include/
61 $(CP) \
62 $(PKG_INSTALL_DIR)/usr/include/* \
63 $(1)/usr/include/
64 endef
65
66 define Build/Compile
67 $(MAKE) -C $(PKG_BUILD_DIR)/bfd/doc/ CFLAGS="-I$(PKG_BUILD_DIR)/include" chew
68 $(call Build/Compile/Default)
69 endef
70
71 define Package/objdump/install
72 $(INSTALL_DIR) $(1)/usr/bin
73 $(CP) $(PKG_INSTALL_DIR)/usr/*-linux/bin/objdump $(1)/usr/bin/
74 endef
75
76 define Package/binutils/install
77 $(INSTALL_DIR) $(1)/usr
78 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
79 $(CP) $(PKG_INSTALL_DIR)/usr/*-linux $(1)/usr
80 rm -f $(1)/usr/bin/objdump
81 endef
82
83 define Package/libbfd/install
84 true
85 endef
86
87 $(eval $(call BuildPackage,binutils))
88 $(eval $(call BuildPackage,objdump))
89 $(eval $(call BuildPackage,libbfd))