don't pass build cflags to fuse kernel module
[openwrt.git] / openwrt / toolchain / binutils / Makefile
1 include $(TOPDIR)/rules.mk
2
3 #############################################################
4 #
5 # build binutils for use on the host system
6 #
7 #############################################################
8 BINUTILS_VERSION:=$(strip $(subst ",, $(BR2_BINUTILS_VERSION)))
9 #"
10
11 BINUTILS_SITE:=http://www.fr.kernel.org/pub/linux/devel/binutils \
12 http://www.fi.kernel.org/pub/linux/devel/binutils \
13 http://ftp.kernel.org/pub/linux/devel/binutils \
14 http://www.de.kernel.org/pub/linux/devel/binutils
15
16 BINUTILS_STABLE_SITE:=http://ftp.gnu.org/gnu/binutils/ \
17 ftp://gatekeeper.dec.com/pub/GNU/ \
18 ftp://ftp.uu.net/archive/systems/gnu/ \
19 ftp://ftp.eu.uu.net/pub/gnu/ \
20 ftp://ftp.funet.fi/pub/gnu/prep/ \
21 ftp://ftp.leo.org/pub/comp/os/unix/gnu/
22
23 ifeq ($(BINUTILS_VERSION),2.16.1)
24 BINUTILS_SITE:=$(BINUTILS_STABLE_SITE)
25 endif
26 ifeq ($(BINUTILS_VERSION),2.16)
27 BINUTILS_SITE:=$(BINUTILS_STABLE_SITE)
28 endif
29 ifeq ($(BINUTILS_VERSION),2.15)
30 BINUTILS_SITE:=$(BINUTILS_STABLE_SITE)
31 endif
32 ifeq ($(BINUTILS_VERSION),2.14)
33 BINUTILS_SITE:=$(BINUTILS_STABLE_SITE)
34 endif
35 ifeq ($(BINUTILS_VERSION),2.13)
36 BINUTILS_SITE:=$(BINUTILS_STABLE_SITE)
37 endif
38
39 BINUTILS_SOURCE:=binutils-$(BINUTILS_VERSION).tar.bz2
40 BINUTILS_DIR:=$(TOOL_BUILD_DIR)/binutils-$(BINUTILS_VERSION)
41 BINUTILS_CAT:=bzcat
42
43 BINUTILS_DIR1:=$(TOOL_BUILD_DIR)/binutils-$(BINUTILS_VERSION)-build
44
45 $(DL_DIR)/$(BINUTILS_SOURCE):
46 mkdir -p $(DL_DIR)
47 $(SCRIPT_DIR)/download.pl $(DL_DIR) $(BINUTILS_SOURCE) x $(BINUTILS_SITE)
48
49 $(BINUTILS_DIR)/.unpacked: $(DL_DIR)/$(BINUTILS_SOURCE)
50 mkdir -p $(TOOL_BUILD_DIR)
51 $(BINUTILS_CAT) $(DL_DIR)/$(BINUTILS_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
52 touch $(BINUTILS_DIR)/.unpacked
53
54 $(BINUTILS_DIR)/.patched: $(BINUTILS_DIR)/.unpacked
55 # Apply appropriate binutils patches.
56 $(SCRIPT_DIR)/patch-kernel.sh $(BINUTILS_DIR) ./all \*.patch
57 $(SCRIPT_DIR)/patch-kernel.sh $(BINUTILS_DIR) ./$(BINUTILS_VERSION) \*.patch
58 touch $(BINUTILS_DIR)/.patched
59
60 $(BINUTILS_DIR1)/.configured: $(BINUTILS_DIR)/.patched
61 mkdir -p $(BINUTILS_DIR1)
62 (cd $(BINUTILS_DIR1); \
63 $(BINUTILS_DIR)/configure \
64 --prefix=$(STAGING_DIR) \
65 --build=$(GNU_HOST_NAME) \
66 --host=$(GNU_HOST_NAME) \
67 --target=$(REAL_GNU_TARGET_NAME) \
68 --disable-werror \
69 $(DISABLE_NLS) \
70 $(MULTILIB) \
71 $(SOFT_FLOAT_CONFIG_OPTION) );
72 touch $(BINUTILS_DIR1)/.configured
73
74 $(BINUTILS_DIR1)/binutils/objdump: $(BINUTILS_DIR1)/.configured
75 $(MAKE) -C $(BINUTILS_DIR1) all
76
77 # Make install will put gettext data in staging_dir/share/locale.
78 # Unfortunatey, it isn't configureable.
79 $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-ld: $(BINUTILS_DIR1)/binutils/objdump
80 $(MAKE) -C $(BINUTILS_DIR1) install
81
82
83 #############################################################
84 #
85 # build binutils for use on the target system
86 #
87 #############################################################
88 BINUTILS_DIR2:=$(BUILD_DIR)/binutils-$(BINUTILS_VERSION)-target
89 $(BINUTILS_DIR2)/.configured: $(BINUTILS_DIR)/.patched
90 mkdir -p $(BINUTILS_DIR2)
91 (cd $(BINUTILS_DIR2); \
92 PATH=$(TARGET_PATH) \
93 CFLAGS="$(TARGET_CFLAGS)" \
94 CFLAGS_FOR_BUILD="-O2 -g" \
95 $(BINUTILS_DIR)/configure \
96 --prefix=/usr \
97 --exec-prefix=/usr \
98 --build=$(GNU_HOST_NAME) \
99 --host=$(REAL_GNU_TARGET_NAME) \
100 --target=$(REAL_GNU_TARGET_NAME) \
101 $(DISABLE_NLS) \
102 $(MULTILIB) \
103 $(SOFT_FLOAT_CONFIG_OPTION) );
104 touch $(BINUTILS_DIR2)/.configured
105
106 $(BINUTILS_DIR2)/binutils/objdump: $(BINUTILS_DIR2)/.configured
107 PATH=$(TARGET_PATH) \
108 $(MAKE) -C $(BINUTILS_DIR2) all
109
110 source: $(DL_DIR)/$(BINUTILS_SOURCE)
111 prepare: $(BINUTILS_DIR)/.patched
112 compile: $(BINUTILS_DIR1)/binutils/objdump
113 install: $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)-ld
114 clean:
115 rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
116 rm -rf $(BINUTILS_DIR) $(BINUTILS_DIR1)
117
118
This page took 0.042071 seconds and 5 git commands to generate.