1 ###############################################################################
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007-2016 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)
43 EXTRA_MAKE = tooldir=/usr
44 EXTRA_INSTALL = tooldir=/usr
47 CFLAGS := $(patsubst -march=%,,$(CFLAGS))
48 CFLAGS := $(patsubst -mfloat-abi=%,,$(CFLAGS))
49 CFLAGS := $(patsubst -fstack-protector-strong,-fstack-protector-all,$(CFLAGS))
50 TARGET = $(DIR_INFO)/$(THISAPP)-tools1
52 --target=$(CROSSTARGET) \
54 --with-sysroot=$(ROOT) \
55 --with-lib-path=/tools/lib \
61 TARGET = $(DIR_INFO)/$(THISAPP)-tools2
63 CC="$(CROSSTARGET)-gcc -B/tools/lib/" \
64 AR="$(CROSSTARGET)-ar" \
65 RANLIB="$(CROSSTARGET)-ranlib"
67 --host=$(BUILDTARGET) \
68 --build=$(BUILDTARGET) \
70 --with-lib-path=/tools/lib \
78 ifeq "$(MACHINE_TYPE)" "arm"
80 --with-abi=aapcs-linux \
87 ###############################################################################
89 ###############################################################################
93 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
95 $(DL_FILE)_MD5 = e0f71a7b2ddab0f8612336ac81d9636b
99 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
101 download :$(patsubst %,$(DIR_DL)/%,$(objects))
103 md5 : $(subst %,%_MD5,$(objects))
105 ###############################################################################
106 # Downloading, checking, md5sum
107 ###############################################################################
109 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
112 $(patsubst %,$(DIR_DL)/%,$(objects)) :
115 $(subst %,%_MD5,$(objects)) :
118 ###############################################################################
119 # Installation Details
120 ###############################################################################
122 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
124 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
125 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/binutils-2.24-pt-pax-flags-20131231.patch
127 @mkdir $(DIR_SRC)/binutils-build
129 # Prevent installing libiberty to lib64.
130 cd $(DIR_APP) && sed -i 's%\(^MULTIOSDIR = \).*%\1 ../lib%' libiberty/Makefile.in
132 cd $(DIR_SRC)/binutils-build && $(EXTRA_ENV) MACHINE= $(DIR_APP)/configure $(EXTRA_CONFIG)
133 cd $(DIR_SRC)/binutils-build && make $(EXTRA_MAKE) $(MAKETUNING) MACHINE=
134 cd $(DIR_SRC)/binutils-build && make $(EXTRA_INSTALL) install MACHINE=
136 cp -v $(DIR_APP)/include/libiberty.h /usr/include
139 cd $(DIR_SRC)/binutils-build && make -C ld clean MACHINE=
140 cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/usr/lib:/lib MACHINE=
141 cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin
144 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build