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