binutils: enable parallel builds
[openwrt/svn-archive/archive.git] / toolchain / binutils / Makefile
1 #
2 # Copyright (C) 2006-2012 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:=$(call qstrip,$(CONFIG_BINUTILS_VERSION))
11 BIN_VERSION:=$(PKG_VERSION)
12
13 PKG_SOURCE_URL:=@GNU/binutils/
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15
16 ifeq ($(PKG_VERSION),2.19.1)
17 PKG_MD5SUM:=09a8c5821a2dfdbb20665bc0bd680791
18 endif
19 ifeq ($(PKG_VERSION),2.20.1)
20 PKG_MD5SUM:=9cdfb9d6ec0578c166d3beae5e15c4e5
21 endif
22 ifeq ($(PKG_VERSION),2.21)
23 PKG_MD5SUM:=c84c5acc9d266f1a7044b51c85a823f5
24 endif
25 ifeq ($(PKG_VERSION),2.21.1)
26 PKG_MD5SUM:=bde820eac53fa3a8d8696667418557ad
27 endif
28 ifeq ($(PKG_VERSION),2.22)
29 PKG_MD5SUM:=ee0f10756c84979622b992a4a61ea3f5
30 endif
31
32 HOST_BUILD_PARALLEL:=1
33
34 PATCH_DIR:=./patches/$(PKG_VERSION)
35
36 REAL_STAGING_DIR_HOST:=$(STAGING_DIR_HOST)
37
38 include $(INCLUDE_DIR)/toolchain-build.mk
39
40 BINUTILS_CONFIGURE:= \
41 ./configure \
42 --prefix=$(TOOLCHAIN_DIR) \
43 --build=$(GNU_HOST_NAME) \
44 --host=$(GNU_HOST_NAME) \
45 --target=$(REAL_GNU_TARGET_NAME) \
46 --with-sysroot=$(TOOLCHAIN_DIR) \
47 --disable-multilib \
48 --disable-werror \
49 --disable-nls \
50 $(GRAPHITE_CONFIGURE) \
51 $(SOFT_FLOAT_CONFIG_OPTION) \
52 $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
53
54 ifneq ($(CONFIG_SSP_SUPPORT),)
55 BINUTILS_CONFIGURE+= \
56 --enable-libssp
57 else
58 BINUTILS_CONFIGURE+= \
59 --disable-libssp
60 endif
61
62 ifneq ($(CONFIG_EXTRA_TARGET_ARCH),)
63 BINUTILS_CONFIGURE+= \
64 --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX)
65 endif
66
67 define Host/Prepare
68 $(call Host/Prepare/Default)
69 ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
70 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
71 endef
72
73 define Host/Configure
74 (cd $(HOST_BUILD_DIR); \
75 $(BINUTILS_CONFIGURE) \
76 );
77 endef
78
79 define Host/Compile
80 $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all
81 endef
82
83 define Host/Install
84 mkdir -p $(TOOLCHAIN_DIR)/initial
85 $(MAKE) -C $(HOST_BUILD_DIR) \
86 prefix=$(TOOLCHAIN_DIR)/initial \
87 install
88 $(call FixupLibdir,$(TOOLCHAIN_DIR)/initial)
89 $(CP) $(TOOLCHAIN_DIR)/initial/. $(TOOLCHAIN_DIR)/
90 $(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(REAL_STAGING_DIR_HOST)/bin/readelf
91 endef
92
93 define Host/Clean
94 rm -rf \
95 $(HOST_BUILD_DIR) \
96 $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
97 endef
98
99 $(eval $(call HostBuild))