prepare target for use with EABI
[openwrt.git] / toolchain / 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:=$(call qstrip,$(CONFIG_BINUTILS_VERSION))
11
12 PKG_SOURCE_URL:=@GNU/binutils/
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
14
15 ifeq ($(PKG_VERSION),2.17)
16 PKG_MD5SUM:=e26e2e06b6e4bf3acf1dc8688a94c0d1
17 endif
18 ifeq ($(PKG_VERSION),2.18)
19 PKG_MD5SUM:=9d22ee4dafa3a194457caf4706f9cf01
20 endif
21 ifeq ($(PKG_VERSION),2.19)
22 PKG_MD5SUM:=17a52219dee5a76c1a9d9b0bfd337d66
23 endif
24 ifeq ($(PKG_VERSION),2.19.1)
25 PKG_MD5SUM:=09a8c5821a2dfdbb20665bc0bd680791
26 endif
27
28 PATCH_DIR:=./patches/$(PKG_VERSION)
29
30 REAL_STAGING_DIR_HOST:=$(STAGING_DIR_HOST)
31
32 include $(INCLUDE_DIR)/toolchain-build.mk
33
34 BINUTILS_CONFIGURE:= \
35 ./configure \
36 --prefix=$(TOOLCHAIN_DIR)/usr \
37 --build=$(GNU_HOST_NAME) \
38 --host=$(GNU_HOST_NAME) \
39 --target=$(REAL_GNU_TARGET_NAME) \
40 --with-sysroot=$(TOOLCHAIN_DIR) \
41 --disable-multilib \
42 --disable-werror \
43 --disable-nls \
44 $(SOFT_FLOAT_CONFIG_OPTION) \
45 $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS)) \
46
47 ifneq ($(CONFIG_SSP_SUPPORT),)
48 BINUTILS_CONFIGURE+= \
49 --enable-libssp
50 else
51 BINUTILS_CONFIGURE+= \
52 --disable-libssp
53 endif
54
55 ifneq ($(CONFIG_EXTRA_TARGET_ARCH),)
56 BINUTILS_CONFIGURE+= \
57 --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX)
58 endif
59
60 define Host/Prepare
61 $(call Host/Prepare/Default)
62 ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
63 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
64 endef
65
66 define Host/Configure
67 (cd $(HOST_BUILD_DIR); \
68 $(BINUTILS_CONFIGURE) \
69 );
70 endef
71
72 define Host/Compile
73 $(MAKE) -C $(HOST_BUILD_DIR) all
74 endef
75
76 define Host/Install
77 $(MAKE) -C $(HOST_BUILD_DIR) install
78 $(CP) $(TOOLCHAIN_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-readelf $(REAL_STAGING_DIR_HOST)/bin/readelf
79 endef
80
81 define Host/Clean
82 rm -rf \
83 $(HOST_BUILD_DIR) \
84 $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
85 endef
86
87 $(eval $(call HostBuild))
This page took 0.048484 seconds and 5 git commands to generate.