1 ###############################################################################
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007-2013 IPFire Team <info@ipfire.org> #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
19 ###############################################################################
21 ###############################################################################
23 ###############################################################################
29 THISAPP = binutils-$(VER)
30 DL_FILE = $(THISAPP).tar.bz2
31 DL_FROM = $(URL_IPFIRE)
32 DIR_APP = $(DIR_SRC)/$(THISAPP)
34 # Normal build or /tools build.
37 TARGET = $(DIR_INFO)/$(THISAPP)
42 EXTRA_MAKE = tooldir=/usr
43 EXTRA_INSTALL = tooldir=/usr
46 CFLAGS := $(patsubst -march=%,,$(CFLAGS))
47 CFLAGS := $(patsubst -mfloat-abi=%,,$(CFLAGS))
48 TARGET = $(DIR_INFO)/$(THISAPP)-tools1
50 --target=$(CROSSTARGET) \
57 TARGET = $(DIR_INFO)/$(THISAPP)-tools2
59 CC="$(CROSSTARGET)-gcc -B/tools/lib/" \
60 AR="$(CROSSTARGET)-ar" \
61 RANLIB="$(CROSSTARGET)-ranlib"
63 --host=$(BUILDTARGET) \
64 --build=$(BUILDTARGET) \
66 --with-lib-path=/tools/lib \
73 ifeq "$(MACHINE_TYPE)" "arm"
75 --with-abi=aapcs-linux \
79 ###############################################################################
81 ###############################################################################
85 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
87 $(DL_FILE)_MD5 = ee0f10756c84979622b992a4a61ea3f5
91 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
93 download :$(patsubst %,$(DIR_DL)/%,$(objects))
95 md5 : $(subst %,%_MD5,$(objects))
97 ###############################################################################
98 # Downloading, checking, md5sum
99 ###############################################################################
101 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
104 $(patsubst %,$(DIR_DL)/%,$(objects)) :
107 $(subst %,%_MD5,$(objects)) :
110 ###############################################################################
111 # Installation Details
112 ###############################################################################
114 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
116 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
117 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/binutils-2.22-pt-pax-flags-20111121.patch
119 # texinfo 5 syntax-fix.
120 cd $(DIR_APP) && sed -i -e "s/@colophon/@@colophon/" \
121 -e "s/doc@cygnus/doc@@cygnus/" bfd/doc/bfd.texinfo
123 @mkdir $(DIR_SRC)/binutils-build
125 # Prevent installing libiberty to lib64.
126 cd $(DIR_APP) && sed -i 's%\(^MULTIOSDIR = \).*%\1 ../lib%' libiberty/Makefile.in
128 cd $(DIR_SRC)/binutils-build && $(EXTRA_ENV) MACHINE= $(DIR_APP)/configure $(EXTRA_CONFIG)
129 cd $(DIR_SRC)/binutils-build && make $(EXTRA_MAKE) $(MAKETUNING) MACHINE=
130 cd $(DIR_SRC)/binutils-build && make $(EXTRA_INSTALL) install MACHINE=
132 cp -v $(DIR_APP)/include/libiberty.h /usr/include
135 cd $(DIR_SRC)/binutils-build && make -C ld clean MACHINE=
136 cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/usr/lib:/lib MACHINE=
137 cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin
140 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build