1 #############################################################
3 # build binutils for use on the host system
5 #############################################################
6 BINUTILS_SITE
:=http
://ftp.kernel.org
/pub
/linux
/devel
/binutils
7 BINUTILS_SOURCE
:=binutils-2.14
.90.0.7.
tar.bz2
8 BINUTILS_DIR
:=$(TOOL_BUILD_DIR
)/binutils-2.14
.90.0.7
11 BINUTILS_DIR1
:=$(TOOL_BUILD_DIR
)/binutils-build
13 $(DL_DIR
)/$(BINUTILS_SOURCE
):
14 $(WGET
) -P
$(DL_DIR
) $(BINUTILS_SITE
)/$(BINUTILS_SOURCE
)
16 $(BINUTILS_DIR
)/.unpacked
: $(DL_DIR
)/$(BINUTILS_SOURCE
)
17 mkdir
-p
$(TOOL_BUILD_DIR
)
19 $(BINUTILS_CAT
) $(DL_DIR
)/$(BINUTILS_SOURCE
) |
tar -C
$(TOOL_BUILD_DIR
) -xvf
-
20 touch
$(BINUTILS_DIR
)/.unpacked
22 $(BINUTILS_DIR
)/.patched
: $(BINUTILS_DIR
)/.unpacked
23 # Apply any files named binutils-*.patch from the source directory to binutils
24 $(SOURCE_DIR
)/patch-kernel.sh
$(BINUTILS_DIR
) $(SOURCE_DIR
) binutils-uclibc
*.patch
25 touch
$(BINUTILS_DIR
)/.patched
27 $(BINUTILS_DIR1
)/.configured
: $(BINUTILS_DIR
)/.patched
28 mkdir
-p
$(BINUTILS_DIR1
)
29 (cd
$(BINUTILS_DIR1
); \
30 $(BINUTILS_DIR
)/configure \
31 --prefix=$(STAGING_DIR
) \
32 --build
=$(GNU_HOST_NAME
) \
33 --host
=$(GNU_HOST_NAME
) \
34 --target
=$(REAL_GNU_TARGET_NAME
) \
37 $(SOFT_FLOAT_CONFIG_OPTION
) );
38 touch
$(BINUTILS_DIR1
)/.configured
40 $(BINUTILS_DIR1
)/binutils
/objdump
: $(BINUTILS_DIR1
)/.configured
41 $(MAKE
) $(JLEVEL
) -C
$(BINUTILS_DIR1
) all
43 # Make install will put gettext data in staging_dir/share/locale.
44 # Unfortunatey, it isn't configureable.
45 $(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
)/bin
/ld: $(BINUTILS_DIR1
)/binutils
/objdump
46 $(MAKE
) $(JLEVEL
) -C
$(BINUTILS_DIR1
) install
48 binutils-dependancies
:
49 @if
[ ! -x
/usr
/bin
/bison
] ; then \
50 echo
-e
"\n\nYou must install 'bison' on your build machine\n"; \
53 @if
[ ! -x
/usr
/bin
/flex
] ; then \
54 echo
-e
"\n\nYou must install 'flex' on your build machine\n"; \
57 @if
[ ! -x
/usr
/bin
/msgfmt
] ; then \
58 echo
-e
"\n\nYou must install 'gettext' on your build machine\n"; \
62 binutils
: binutils-dependancies
$(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
)/bin
/ld
64 binutils-source
: $(DL_DIR
)/$(BINUTILS_SOURCE
)
67 rm -f
$(STAGING_DIR
)/bin
/$(REAL_GNU_TARGET_NAME
)*
68 -$(MAKE
) -C
$(BINUTILS_DIR1
) clean
71 rm -rf
$(BINUTILS_DIR1
)
75 #############################################################
77 # build binutils for use on the target system
79 #############################################################
80 BINUTILS_DIR2
:=$(BUILD_DIR
)/binutils-target
81 $(BINUTILS_DIR2
)/.configured
: $(BINUTILS_DIR
)/.patched
82 mkdir
-p
$(BINUTILS_DIR2
)
83 (cd
$(BINUTILS_DIR2
); \
85 CFLAGS
="$(TARGET_CFLAGS)" \
86 CFLAGS_FOR_BUILD
="-O2 -g" \
87 $(BINUTILS_DIR
)/configure \
90 --build
=$(GNU_HOST_NAME
) \
91 --host
=$(REAL_GNU_TARGET_NAME
) \
92 --target
=$(REAL_GNU_TARGET_NAME
) \
95 $(SOFT_FLOAT_CONFIG_OPTION
) );
96 touch
$(BINUTILS_DIR2
)/.configured
98 $(BINUTILS_DIR2
)/binutils
/objdump
: $(BINUTILS_DIR2
)/.configured
100 $(MAKE
) $(JLEVEL
) -C
$(BINUTILS_DIR2
) all
102 $(TARGET_DIR
)/usr
/bin
/ld: $(BINUTILS_DIR2
)/binutils
/objdump
103 PATH
=$(TARGET_PATH
) \
104 $(MAKE
) $(JLEVEL
) DESTDIR
=$(TARGET_DIR
) \
105 tooldir
=/usr build_tooldir
=/usr \
106 -C
$(BINUTILS_DIR2
) install
107 #rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
108 # $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
109 -$(STRIP
) $(TARGET_DIR
)/usr
/$(REAL_GNU_TARGET_NAME
)/bin
/* > /dev
/null
2>&1
110 -$(STRIP
) $(TARGET_DIR
)/usr
/bin
/* > /dev
/null
2>&1
112 binutils_target
: $(GCC_DEPENDANCY
) $(TARGET_DIR
)/usr
/bin
/ld
114 binutils_target-clean
:
115 rm -f
$(TARGET_DIR
)/bin
/$(REAL_GNU_TARGET_NAME
)*
116 -$(MAKE
) -C
$(BINUTILS_DIR2
) clean
118 binutils_target-dirclean
:
119 rm -rf
$(BINUTILS_DIR2
)
This page took 0.046621 seconds and 5 git commands to generate.