1 include $(TOPDIR
)/rules.mk
3 #############################################################
5 # build binutils for use on the host system
7 #############################################################
8 BINUTILS_VERSION
:=$(strip $(subst ",, $(BR2_BINUTILS_VERSION)))
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
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
/
23 ifeq ($(BINUTILS_VERSION
),2.16.1)
24 BINUTILS_SITE
:=$(BINUTILS_STABLE_SITE
)
27 BINUTILS_SOURCE
:=binutils-
$(BINUTILS_VERSION
).
tar.bz2
28 BINUTILS_DIR
:=$(TOOL_BUILD_DIR
)/binutils-
$(BINUTILS_VERSION
)
31 BINUTILS_DIR1
:=$(TOOL_BUILD_DIR
)/binutils-
$(BINUTILS_VERSION
)-build
33 $(DL_DIR
)/$(BINUTILS_SOURCE
):
35 $(SCRIPT_DIR
)/download.pl
$(DL_DIR
) $(BINUTILS_SOURCE
) x
$(BINUTILS_SITE
)
37 $(BINUTILS_DIR
)/.unpacked
: $(DL_DIR
)/$(BINUTILS_SOURCE
)
38 mkdir
-p
$(TOOL_BUILD_DIR
)
39 $(BINUTILS_CAT
) $(DL_DIR
)/$(BINUTILS_SOURCE
) |
tar -C
$(TOOL_BUILD_DIR
) $(TAR_OPTIONS
) -
40 touch
$(BINUTILS_DIR
)/.unpacked
42 $(BINUTILS_DIR
)/.patched
: $(BINUTILS_DIR
)/.unpacked
43 # Apply appropriate binutils patches.
44 $(SCRIPT_DIR
)/patch-kernel.sh
$(BINUTILS_DIR
) .
/all \
*.patch
45 $(SCRIPT_DIR
)/patch-kernel.sh
$(BINUTILS_DIR
) .
/$(BINUTILS_VERSION
) \
*.patch
46 touch
$(BINUTILS_DIR
)/.patched
48 $(BINUTILS_DIR1
)/.configured
: $(BINUTILS_DIR
)/.patched
49 mkdir
-p
$(BINUTILS_DIR1
)
50 (cd
$(BINUTILS_DIR1
); \
51 $(BINUTILS_DIR
)/configure \
52 --prefix=$(STAGING_DIR
) \
53 --build
=$(GNU_HOST_NAME
) \
54 --host
=$(GNU_HOST_NAME
) \
55 --target
=$(REAL_GNU_TARGET_NAME
) \
59 $(SOFT_FLOAT_CONFIG_OPTION
) );
60 touch
$(BINUTILS_DIR1
)/.configured
62 $(BINUTILS_DIR1
)/binutils
/objdump
: $(BINUTILS_DIR1
)/.configured
63 $(MAKE
) -C
$(BINUTILS_DIR1
) all
65 # Make install will put gettext data in staging_dir/share/locale.
66 # Unfortunatey, it isn't configureable.
67 $(STAGING_DIR
)/bin
/$(REAL_GNU_TARGET_NAME
)-ld: $(BINUTILS_DIR1
)/binutils
/objdump
68 $(MAKE
) -C
$(BINUTILS_DIR1
) install
71 #############################################################
73 # build binutils for use on the target system
75 #############################################################
76 BINUTILS_DIR2
:=$(BUILD_DIR
)/binutils-
$(BINUTILS_VERSION
)-target
77 $(BINUTILS_DIR2
)/.configured
: $(BINUTILS_DIR
)/.patched
78 mkdir
-p
$(BINUTILS_DIR2
)
79 (cd
$(BINUTILS_DIR2
); \
81 CFLAGS
="$(TARGET_CFLAGS)" \
82 CFLAGS_FOR_BUILD
="-O2 -g" \
83 $(BINUTILS_DIR
)/configure \
86 --build
=$(GNU_HOST_NAME
) \
87 --host
=$(REAL_GNU_TARGET_NAME
) \
88 --target
=$(REAL_GNU_TARGET_NAME
) \
91 $(SOFT_FLOAT_CONFIG_OPTION
) );
92 touch
$(BINUTILS_DIR2
)/.configured
94 $(BINUTILS_DIR2
)/binutils
/objdump
: $(BINUTILS_DIR2
)/.configured
96 $(MAKE
) -C
$(BINUTILS_DIR2
) all
98 source
: $(DL_DIR
)/$(BINUTILS_SOURCE
)
99 prepare
: $(BINUTILS_DIR
)/.patched
100 compile
: $(BINUTILS_DIR1
)/binutils
/objdump
101 install: $(STAGING_DIR
)/bin
/$(REAL_GNU_TARGET_NAME
)-ld
103 rm -f
$(STAGING_DIR
)/bin
/$(REAL_GNU_TARGET_NAME
)*
104 rm -rf
$(BINUTILS_DIR
) $(BINUTILS_DIR1
)
This page took 0.045107 seconds and 5 git commands to generate.