98525cb85cb1221301745505a0eccb0586470eb7
[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
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/binutils
27   SECTION:=devel
28   CATEGORY:=Development
29   TITLE:=binutils
30   DEPENDS:=+objdump
31 endef
32
33 define Package/objdump
34   SECTION:=devel
35   CATEGORY:=Development
36   TITLE:=objdump
37   DEPENDS:=+zlib
38 endef
39
40 define Package/binutils/description
41   The Binutils package contains a linker, an assembler, and other tools for handling object files
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         $(call Build/Compile/Default, \
52                 configure-bfd \
53                 configure-binutils \
54                 configure-etc \
55                 configure-gas \
56                 configure-gprof \
57                 configure-intl \
58                 configure-ld \
59                 configure-libiberty \
60                 configure-opcodes \
61         )
62         $(MAKE) -C $(PKG_BUILD_DIR)/bfd/po Makefile
63 endef
64
65 define Build/InstallDev
66         $(INSTALL_DIR) $(1)/usr/{lib,include}
67         $(CP) \
68                 $(PKG_INSTALL_DIR)/usr/lib/* \
69                 $(1)/usr/lib/
70         $(CP) \
71                 $(PKG_BUILD_DIR)/include/*.h \
72                 $(1)/usr/include/
73         $(CP) \
74                 $(PKG_INSTALL_DIR)/usr/include/* \
75                 $(1)/usr/include/
76         rm -f $(1)/usr/include/gdbm.h
77 endef
78
79 define Build/Compile
80         $(MAKE) -C $(PKG_BUILD_DIR)/bfd/doc/ CFLAGS="-I$(PKG_BUILD_DIR)/include" chew
81         $(call Build/Compile/Default)
82 endef
83
84 define Package/objdump/install
85         $(INSTALL_DIR) $(1)/usr/bin
86         $(CP) $(PKG_INSTALL_DIR)/usr/*-linux/bin/objdump $(1)/usr/bin/
87 endef
88
89 define Package/binutils/install
90         $(INSTALL_DIR) $(1)/usr
91         $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
92         $(CP) $(PKG_INSTALL_DIR)/usr/*-linux $(1)/usr
93         rm -f $(1)/usr/bin/objdump
94 endef
95
96 $(eval $(call BuildPackage,binutils))
97 $(eval $(call BuildPackage,objdump))