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.gz
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 TARGET = $(DIR_INFO)/$(THISAPP)-tools1
49 --target=$(CROSSTARGET) \
51 --with-sysroot=$(ROOT) \
52 --with-lib-path=/tools/lib \
58 TARGET = $(DIR_INFO)/$(THISAPP)-tools2
60 CC="$(CROSSTARGET)-gcc" \
61 AR="$(CROSSTARGET)-ar" \
62 RANLIB="$(CROSSTARGET)-ranlib"
64 --host=$(BUILDTARGET) \
65 --build=$(BUILDTARGET) \
67 --with-lib-path=/tools/lib \
75 ifeq "$(BUILD_ARCH)" "armv5tel"
77 --with-abi=aapcs-linux \
84 ###############################################################################
86 ###############################################################################
90 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
92 $(DL_FILE)_MD5 = d5d270fd0b698ed59ca5ade8e1b5059c
96 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
98 download :$(patsubst %,$(DIR_DL)/%,$(objects))
100 md5 : $(subst %,%_MD5,$(objects))
102 ###############################################################################
103 # Downloading, checking, md5sum
104 ###############################################################################
106 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
109 $(patsubst %,$(DIR_DL)/%,$(objects)) :
112 $(subst %,%_MD5,$(objects)) :
115 ###############################################################################
116 # Installation Details
117 ###############################################################################
119 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
121 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
122 @mkdir $(DIR_SRC)/binutils-build
124 # Prevent installing libiberty to lib64.
125 cd $(DIR_APP) && sed -i 's%\(^MULTIOSDIR = \).*%\1 ../lib%' libiberty/Makefile.in
127 cd $(DIR_SRC)/binutils-build && $(EXTRA_ENV) $(DIR_APP)/configure $(EXTRA_CONFIG)
128 cd $(DIR_SRC)/binutils-build && make $(EXTRA_MAKE) $(MAKETUNING)
129 cd $(DIR_SRC)/binutils-build && make $(EXTRA_INSTALL) install
131 cp -v $(DIR_APP)/include/libiberty.h /usr/include
134 cd $(DIR_SRC)/binutils-build && make -C ld clean
135 cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/usr/lib:/lib
136 cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin
139 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build