]> Git Repo - buildroot-mgba.git/blame - toolchain/binutils/binutils.mk
default to linuxthreads.old Bug 552
[buildroot-mgba.git] / toolchain / binutils / binutils.mk
CommitLineData
9168e838
MNI
1#############################################################
2#
3# build binutils for use on the host system
4#
5#############################################################
dab038a0 6BINUTILS_VERSION:=$(strip $(subst ",, $(BR2_BINUTILS_VERSION)))
3ad3d8a1 7
9168e838 8BINUTILS_SITE:=http://ftp.kernel.org/pub/linux/devel/binutils
42b8eb19
MNI
9ifeq ($(BINUTILS_VERSION),2.16)
10BINUTILS_SITE:=http://ftp.gnu.org/gnu/binutils/
11endif
42ca8b26
MNI
12ifeq ($(BINUTILS_VERSION),2.16.1)
13BINUTILS_SITE:=http://ftp.gnu.org/gnu/binutils/
14endif
3ad3d8a1
MNI
15ifeq ($(BINUTILS_VERSION),2.15)
16BINUTILS_SITE:=http://ftp.gnu.org/gnu/binutils/
17endif
18ifeq ($(BINUTILS_VERSION),2.14)
19BINUTILS_SITE:=http://ftp.gnu.org/gnu/binutils/
20endif
21ifeq ($(BINUTILS_VERSION),2.13)
22BINUTILS_SITE:=http://ftp.gnu.org/gnu/binutils/
23endif
5b72a75f
MNI
24ifeq ($(BINUTILS_VERSION),2.15.97)
25BINUTILS_SITE:=ftp://sources.redhat.com/pub/binutils/snapshots/
26endif
3ad3d8a1
MNI
27
28BINUTILS_SOURCE:=binutils-$(BINUTILS_VERSION).tar.bz2
29BINUTILS_DIR:=$(TOOL_BUILD_DIR)/binutils-$(BINUTILS_VERSION)
9168e838
MNI
30BINUTILS_CAT:=bzcat
31
3ad3d8a1 32BINUTILS_DIR1:=$(TOOL_BUILD_DIR)/binutils-$(BINUTILS_VERSION)-build
9168e838
MNI
33
34$(DL_DIR)/$(BINUTILS_SOURCE):
3ad3d8a1 35 mkdir -p $(DL_DIR)
9168e838
MNI
36 $(WGET) -P $(DL_DIR) $(BINUTILS_SITE)/$(BINUTILS_SOURCE)
37
2d472b23 38$(BINUTILS_DIR)/.unpacked: $(DL_DIR)/$(BINUTILS_SOURCE)
9168e838 39 mkdir -p $(TOOL_BUILD_DIR)
3263c5a6 40 $(BINUTILS_CAT) $(DL_DIR)/$(BINUTILS_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
9168e838
MNI
41 touch $(BINUTILS_DIR)/.unpacked
42
43$(BINUTILS_DIR)/.patched: $(BINUTILS_DIR)/.unpacked
3ad3d8a1 44 # Apply appropriate binutils patches.
44eedc5c 45 toolchain/patch-kernel.sh $(BINUTILS_DIR) toolchain/binutils/$(BINUTILS_VERSION) \*.patch
9168e838
MNI
46 touch $(BINUTILS_DIR)/.patched
47
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) \
23e3dd40 56 $(DISABLE_NLS) \
9168e838 57 $(MULTILIB) \
42b8eb19 58 --disable-werror \
9168e838
MNI
59 $(SOFT_FLOAT_CONFIG_OPTION) );
60 touch $(BINUTILS_DIR1)/.configured
61
62$(BINUTILS_DIR1)/binutils/objdump: $(BINUTILS_DIR1)/.configured
c7bf26e6 63 $(MAKE) -C $(BINUTILS_DIR1) all
9168e838
MNI
64
65# Make install will put gettext data in staging_dir/share/locale.
66# Unfortunatey, it isn't configureable.
2d523c23 67$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin/ld: $(BINUTILS_DIR1)/binutils/objdump
c7bf26e6 68 $(MAKE) -C $(BINUTILS_DIR1) install
9168e838 69
05c5b52e 70binutils-dependancies:
024b4c8e
MF
71 @if ! which which > /dev/null ; then \
72 echo -e "\n\nYou must install 'which' on your build machine\n"; \
73 exit 1; \
74 fi;
74afafce 75 @if ! which bison > /dev/null ; then \
05c5b52e
EA
76 echo -e "\n\nYou must install 'bison' on your build machine\n"; \
77 exit 1; \
78 fi;
74afafce 79 @if ! which flex > /dev/null ; then \
05c5b52e
EA
80 echo -e "\n\nYou must install 'flex' on your build machine\n"; \
81 exit 1; \
82 fi;
74afafce 83 @if ! which msgfmt > /dev/null ; then \
05c5b52e
EA
84 echo -e "\n\nYou must install 'gettext' on your build machine\n"; \
85 exit 1; \
86 fi;
87
88binutils: binutils-dependancies $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME)/bin/ld
9168e838
MNI
89
90binutils-source: $(DL_DIR)/$(BINUTILS_SOURCE)
91
92binutils-clean:
93 rm -f $(STAGING_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
94 -$(MAKE) -C $(BINUTILS_DIR1) clean
95
96binutils-dirclean:
97 rm -rf $(BINUTILS_DIR1)
98
99
100
101#############################################################
102#
103# build binutils for use on the target system
104#
105#############################################################
3ad3d8a1 106BINUTILS_DIR2:=$(BUILD_DIR)/binutils-$(BINUTILS_VERSION)-target
9168e838
MNI
107$(BINUTILS_DIR2)/.configured: $(BINUTILS_DIR)/.patched
108 mkdir -p $(BINUTILS_DIR2)
109 (cd $(BINUTILS_DIR2); \
110 PATH=$(TARGET_PATH) \
111 CFLAGS="$(TARGET_CFLAGS)" \
93703bf4 112 CFLAGS_FOR_BUILD="-O2 -g" \
9168e838
MNI
113 $(BINUTILS_DIR)/configure \
114 --prefix=/usr \
115 --exec-prefix=/usr \
116 --build=$(GNU_HOST_NAME) \
117 --host=$(REAL_GNU_TARGET_NAME) \
118 --target=$(REAL_GNU_TARGET_NAME) \
23e3dd40 119 $(DISABLE_NLS) \
9168e838 120 $(MULTILIB) \
42b8eb19 121 --disable-werror \
9168e838
MNI
122 $(SOFT_FLOAT_CONFIG_OPTION) );
123 touch $(BINUTILS_DIR2)/.configured
124
125$(BINUTILS_DIR2)/binutils/objdump: $(BINUTILS_DIR2)/.configured
126 PATH=$(TARGET_PATH) \
c7bf26e6 127 $(MAKE) -C $(BINUTILS_DIR2) all
9168e838 128
2d523c23 129$(TARGET_DIR)/usr/bin/ld: $(BINUTILS_DIR2)/binutils/objdump
9168e838 130 PATH=$(TARGET_PATH) \
c7bf26e6 131 $(MAKE) DESTDIR=$(TARGET_DIR) \
9168e838
MNI
132 tooldir=/usr build_tooldir=/usr \
133 -C $(BINUTILS_DIR2) install
134 #rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
135 # $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
136 -$(STRIP) $(TARGET_DIR)/usr/$(REAL_GNU_TARGET_NAME)/bin/* > /dev/null 2>&1
2d523c23 137 -$(STRIP) $(TARGET_DIR)/usr/bin/* > /dev/null 2>&1
9168e838
MNI
138
139binutils_target: $(GCC_DEPENDANCY) $(TARGET_DIR)/usr/bin/ld
140
141binutils_target-clean:
8500fcd5
MF
142 (cd $(TARGET_DIR)/usr/bin; \
143 rm -f addr2line ar as gprof ld nm objcopy \
144 objdump ranlib readelf size strings strip)
9168e838
MNI
145 rm -f $(TARGET_DIR)/bin/$(REAL_GNU_TARGET_NAME)*
146 -$(MAKE) -C $(BINUTILS_DIR2) clean
147
148binutils_target-dirclean:
149 rm -rf $(BINUTILS_DIR2)
This page took 0.076654 seconds and 4 git commands to generate.