1 include $(TOPDIR
)/rules.mk
3 #############################################################
5 # build binutils for use on the host system
7 #############################################################
8 BINUTILS_VERSION
:=$(strip $(subst ",, $(CONFIG_BINUTILS_VERSION)))#"))
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
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
/
22 ifeq ($(BINUTILS_VERSION
),2.16.1)
23 BINUTILS_SITE
:=$(BINUTILS_STABLE_SITE
)
26 BINUTILS_SOURCE
:=binutils-
$(BINUTILS_VERSION
).
tar.bz2
27 BINUTILS_DIR
:=$(TOOL_BUILD_DIR
)/binutils-
$(BINUTILS_VERSION
)
30 BINUTILS_DIR1
:=$(TOOL_BUILD_DIR
)/binutils-
$(BINUTILS_VERSION
)-build
32 $(DL_DIR
)/$(BINUTILS_SOURCE
):
34 $(SCRIPT_DIR
)/download.pl
$(DL_DIR
) $(BINUTILS_SOURCE
) x
$(BINUTILS_SITE
)
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
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
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
) \
58 $(SOFT_FLOAT_CONFIG_OPTION
) );
59 touch
$(BINUTILS_DIR1
)/.configured
61 $(BINUTILS_DIR1
)/binutils
/objdump
: $(BINUTILS_DIR1
)/.configured
62 $(MAKE
) -C
$(BINUTILS_DIR1
) -j
$(CONFIG_JLEVEL
) all
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
70 #############################################################
72 # build binutils for use on the target system
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
); \
80 CFLAGS
="$(TARGET_CFLAGS)" \
81 CFLAGS_FOR_BUILD
="-O2 -g" \
82 $(BINUTILS_DIR
)/configure \
85 --build
=$(GNU_HOST_NAME
) \
86 --host
=$(REAL_GNU_TARGET_NAME
) \
87 --target
=$(REAL_GNU_TARGET_NAME
) \
90 $(SOFT_FLOAT_CONFIG_OPTION
) );
91 touch
$(BINUTILS_DIR2
)/.configured
93 $(BINUTILS_DIR2
)/binutils
/objdump
: $(BINUTILS_DIR2
)/.configured
95 $(MAKE
) -C
$(BINUTILS_DIR2
) -j
$(CONFIG_JLEVEL
) all
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
102 rm -f
$(STAGING_DIR
)/bin
/$(REAL_GNU_TARGET_NAME
)*
103 rm -rf
$(BINUTILS_DIR
) $(BINUTILS_DIR1
)
This page took 0.050403 seconds and 5 git commands to generate.