1 ###############################################################################
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007-2011 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 # XXX maybe we can remove that ugly MACHINE= by this
37 # Normal build or /tools build.
40 TARGET = $(DIR_INFO)/$(THISAPP)
41 EXTRA_CONFIG = --prefix=/usr --enable-shared --disable-nls
42 EXTRA_MAKE = tooldir=/usr
43 EXTRA_INSTALL = tooldir=/usr
46 TARGET = $(DIR_INFO)/$(THISAPP)-tools1
47 EXTRA_CONFIG = --prefix=/tools --disable-nls --disable-werror --disable-gprof
48 #EXTRA_MAKE = LDFLAGS="-all-static"
51 TARGET = $(DIR_INFO)/$(THISAPP)-tools2
52 EXTRA_CONFIG = --prefix=/tools --with-lib-path=/tools/lib --disable-nls
58 ifeq "$(MACHINE_TYPE)" "arm"
60 --host=$(BUILDTARGET) \
61 --build=$(BUILDTARGET) \
62 --target=$(BUILDTARGET) \
63 --with-abi=aapcs-linux \
66 EXTRA_CONFIG += --build=$(BUILDTARGET)
69 ###############################################################################
71 ###############################################################################
75 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
77 $(DL_FILE)_MD5 = 9d22ee4dafa3a194457caf4706f9cf01
81 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
83 download :$(patsubst %,$(DIR_DL)/%,$(objects))
85 md5 : $(subst %,%_MD5,$(objects))
87 ###############################################################################
88 # Downloading, checking, md5sum
89 ###############################################################################
91 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
94 $(patsubst %,$(DIR_DL)/%,$(objects)) :
97 $(subst %,%_MD5,$(objects)) :
100 ###############################################################################
101 # Installation Details
102 ###############################################################################
104 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
106 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
107 @mkdir $(DIR_SRC)/binutils-build
108 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/$(THISAPP)-configure-1.patch
109 cd $(DIR_SRC)/binutils-build && MACHINE= $(DIR_APP)/configure $(EXTRA_CONFIG)
111 cd $(DIR_SRC)/binutils-build && make configure-host MAKEINFO=makeinfo MACHINE=
113 cd $(DIR_SRC)/binutils-build && make $(EXTRA_MAKE) $(MAKETUNING) MAKEINFO=makeinfo MACHINE=
114 cd $(DIR_SRC)/binutils-build && make $(EXTRA_INSTALL) install MAKEINFO=makeinfo MACHINE=
116 cp -v $(DIR_APP)/include/libiberty.h /usr/include
119 cd $(DIR_SRC)/binutils-build && make -C ld clean MACHINE=
120 cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/tools/lib MACHINE=
121 cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin
123 cd $(DIR_SRC)/binutils-build && make -C ld clean MACHINE=
124 cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/usr/lib:/lib MACHINE=
125 cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin
128 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build