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