package/apex: fix a compile issue
[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.19.1)
17 PKG_MD5SUM:=09a8c5821a2dfdbb20665bc0bd680791
18 endif
19 ifeq ($(PKG_VERSION),2.19.1+cs)
20 BIN_VERSION:=20090205
21 PKG_SOURCE:=$(PKG_NAME)-$(BIN_VERSION).tar.bz2
22 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
23 PKG_MD5SUM:=040740e8c864dd1a15886753f9c0bc0b
24 HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/binutils-$(BIN_VERSION)
25 endif
26 ifeq ($(PKG_VERSION),2.20.1)
27 PKG_MD5SUM:=9cdfb9d6ec0578c166d3beae5e15c4e5
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) \
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 $(GRAPHITE_CONFIGURE) \
47 $(SOFT_FLOAT_CONFIG_OPTION) \
48 $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
49
50 ifneq ($(CONFIG_SSP_SUPPORT),)
51 BINUTILS_CONFIGURE+= \
52 --enable-libssp
53 else
54 BINUTILS_CONFIGURE+= \
55 --disable-libssp
56 endif
57
58 ifneq ($(CONFIG_EXTRA_TARGET_ARCH),)
59 BINUTILS_CONFIGURE+= \
60 --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX)
61 endif
62
63 define Host/Prepare
64 $(call Host/Prepare/Default)
65 ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
66 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
67 endef
68
69 define Host/Configure
70 (cd $(HOST_BUILD_DIR); \
71 $(BINUTILS_CONFIGURE) \
72 );
73 endef
74
75 define Host/Compile
76 $(MAKE) $(TOOLCHAIN_JOBS) -C $(HOST_BUILD_DIR) all
77 endef
78
79 define Host/Install
80 $(MAKE) -C $(HOST_BUILD_DIR) install
81 $(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(REAL_STAGING_DIR_HOST)/bin/readelf
82 endef
83
84 define Host/Clean
85 rm -rf \
86 $(HOST_BUILD_DIR) \
87 $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
88 endef
89
90 $(eval $(call HostBuild))
This page took 0.040592 seconds and 5 git commands to generate.