ath79: add support for D-Link DIR-842 C2
[openwrt/openwrt.git] / toolchain / binutils / Makefile
1 #
2 # Copyright (C) 2006-2013 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.xz
15
16 TAR_OPTIONS += --exclude='*.rej'
17
18 ifeq ($(PKG_VERSION),2.29.1)
19 PKG_HASH:=e7010a46969f9d3e53b650a518663f98a5dde3c3ae21b7d71e5e6803bc36b577
20 endif
21
22 ifeq ($(PKG_VERSION),2.31.1)
23 PKG_HASH:=5d20086ecf5752cc7d9134246e9588fa201740d540f7eb84d795b1f7a93bca86
24 endif
25
26 ifeq ($(PKG_VERSION),2.32)
27 PKG_HASH:=0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
28 endif
29
30 HOST_BUILD_PARALLEL:=1
31
32 PATCH_DIR:=./patches/$(PKG_VERSION)
33
34 include $(INCLUDE_DIR)/toolchain-build.mk
35
36 HOST_CONFIGURE_ARGS = \
37 --prefix=$(TOOLCHAIN_DIR) \
38 --build=$(GNU_HOST_NAME) \
39 --host=$(GNU_HOST_NAME) \
40 --target=$(REAL_GNU_TARGET_NAME) \
41 --with-sysroot=$(TOOLCHAIN_DIR) \
42 --enable-deterministic-archives \
43 --enable-plugins \
44 --disable-multilib \
45 --disable-werror \
46 --disable-nls \
47 --disable-sim \
48 --disable-gdb \
49 $(GRAPHITE_CONFIGURE) \
50 $(SOFT_FLOAT_CONFIG_OPTION) \
51 $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
52
53 ifneq ($(CONFIG_SSP_SUPPORT),)
54 HOST_CONFIGURE_ARGS+= \
55 --enable-libssp
56 else
57 HOST_CONFIGURE_ARGS+= \
58 --disable-libssp
59 endif
60
61 ifneq ($(CONFIG_EXTRA_TARGET_ARCH),)
62 HOST_CONFIGURE_ARGS+= \
63 --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX)
64 endif
65
66 define Host/Prepare
67 $(call Host/Prepare/Default)
68 ln -snf $(notdir $(HOST_BUILD_DIR)) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
69 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
70 $(SED) 's, " Linaro.*,,' $(HOST_BUILD_DIR)/bfd/version.h
71 endef
72
73 define Host/Compile
74 +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all
75 endef
76
77 define Host/Install
78 mkdir -p $(TOOLCHAIN_DIR)/initial
79 $(MAKE) -C $(HOST_BUILD_DIR) \
80 prefix=$(TOOLCHAIN_DIR)/initial \
81 install
82 $(MAKE) -C $(HOST_BUILD_DIR) \
83 prefix=$(TOOLCHAIN_DIR) \
84 install
85 $(call FixupLibdir,$(TOOLCHAIN_DIR)/initial)
86 $(RM) $(TOOLCHAIN_DIR)/initial/lib/libiberty.a
87 $(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(HOST_BUILD_PREFIX)/bin/readelf
88 # ARC gcc requires extlib.
89 # If extlib is not available in "initial" folder
90 # initial gcc will fail to build libc.
91 if [ -d $(TOOLCHAIN_DIR)/extlib ]; then \
92 $(CP) -r $(TOOLCHAIN_DIR)/extlib $(TOOLCHAIN_DIR)/initial/; \
93 fi
94 endef
95
96 define Host/Clean
97 rm -rf \
98 $(HOST_BUILD_DIR) \
99 $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
100 endef
101
102 $(eval $(call HostBuild))