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