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