source: packages/devel/binutils/Makefile @ 28640

Last change on this file since 28640 was 28640, checked in by jow, 5 years ago

[packages] binutils: move /usr/bin/strings to /bin/strings, avoids clash with busybox applet

File size: 2.6 KB
Line 
1#
2# Copyright (C) 2006-2011 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=binutils
11PKG_VERSION:=$(strip $(subst ",, $(CONFIG_BINUTILS_VERSION)))
12#"))
13PKG_RELEASE:=5
14
15PKG_SOURCE_URL:=@GNU/binutils
16PKG_SOURCE:=binutils-$(PKG_VERSION).tar.bz2
17PKG_MD5SUM:=
18
19PATCH_DIR:=$(TOPDIR)/toolchain/binutils/patches/$(PKG_VERSION)
20
21PKG_FIXUP:=autoreconf
22PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof binutils ld libiberty gold intl
23PKG_REMOVE_FILES:=libtool.m4
24PKG_INSTALL:=1
25
26include $(INCLUDE_DIR)/package.mk
27
28define Package/binutils
29  SECTION:=devel
30  CATEGORY:=Development
31  TITLE:=binutils
32  DEPENDS:=+objdump
33endef
34
35define Package/objdump
36  SECTION:=devel
37  CATEGORY:=Development
38  TITLE:=objdump
39  DEPENDS:=+zlib
40endef
41
42define Package/binutils/description
43  The Binutils package contains a linker, an assembler, and other tools for handling object files
44endef
45
46CONFIGURE_ARGS = \
47                --target=$(REAL_GNU_TARGET_NAME) \
48                --host=$(REAL_GNU_TARGET_NAME) \
49                --build=$(GNU_HOST_NAME) \
50                --prefix=/usr \
51                --disable-multilib \
52                --disable-werror \
53                --disable-nls \
54                --enable-shared \
55                $(SOFT_FLOAT_CONFIG_OPTION) \
56                $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
57
58TARGET_CFLAGS += $(FPIC)
59TARGET_LDFLAGS := -L$(PKG_BUILD_DIR)/libiberty $(TARGET_LDFLAGS)
60
61define Build/Configure
62        $(call Build/Configure/Default)
63        $(call Build/Compile/Default, \
64                configure-bfd \
65                configure-binutils \
66                configure-etc \
67                configure-gas \
68                configure-gprof \
69                configure-intl \
70                configure-ld \
71                configure-libiberty \
72                configure-opcodes \
73        )
74        $(MAKE) CFLAGS="$(TARGET_CFLAGS)" -C $(PKG_BUILD_DIR)/bfd/po Makefile
75endef
76
77define Build/InstallDev
78        $(INSTALL_DIR) $(1)/usr/{lib,include}
79        $(CP) \
80                $(PKG_INSTALL_DIR)/usr/lib/* \
81                $(1)/usr/lib/
82        $(CP) \
83                $(PKG_BUILD_DIR)/include/*.h \
84                $(1)/usr/include/
85        $(CP) \
86                $(PKG_INSTALL_DIR)/usr/include/* \
87                $(1)/usr/include/
88        rm -f $(1)/usr/include/gdbm.h
89endef
90
91define Build/Compile
92        $(MAKE) -C $(PKG_BUILD_DIR)/bfd/doc/ CFLAGS="-I$(PKG_BUILD_DIR)/include" chew
93        $(call Build/Compile/Default)
94endef
95
96define Package/objdump/install
97        $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib
98        $(CP) $(PKG_INSTALL_DIR)/usr/bin/objdump $(1)/usr/bin/
99        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopcodes*.so $(1)/usr/lib/
100        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbfd*.so $(1)/usr/lib/
101endef
102
103define Package/binutils/install
104        $(INSTALL_DIR) $(1)/usr $(1)/bin
105        $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
106        mv $(1)/usr/bin/strings $(1)/bin/strings
107        rm -f $(1)/usr/bin/objdump
108endef
109
110$(eval $(call BuildPackage,binutils))
111$(eval $(call BuildPackage,objdump))
Note: See TracBrowser for help on using the repository browser.