]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - lfs/binutils
Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next
[people/teissler/ipfire-2.x.git] / lfs / binutils
CommitLineData
cd1a2927 1###############################################################################
cd1a2927 2# #
70df8302 3# IPFire.org - A linux based firewall #
46c2a9e3 4# Copyright (C) 2007-2011 IPFire Team <info@ipfire.org> #
70df8302
MT
5# #
6# This program is free software: you can redistribute it and/or modify #
cd1a2927 7# it under the terms of the GNU General Public License as published by #
70df8302 8# the Free Software Foundation, either version 3 of the License, or #
cd1a2927
MT
9# (at your option) any later version. #
10# #
70df8302 11# This program is distributed in the hope that it will be useful, #
cd1a2927
MT
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. #
15# #
16# You should have received a copy of the GNU General Public License #
70df8302 17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
cd1a2927 18# #
cd1a2927
MT
19###############################################################################
20
21###############################################################################
22# Definitions
23###############################################################################
24
25include Config
26
965018f4 27VER = 2.18
cd1a2927
MT
28
29THISAPP = binutils-$(VER)
30DL_FILE = $(THISAPP).tar.bz2
1751628e 31DL_FROM = $(URL_IPFIRE)
cd1a2927
MT
32DIR_APP = $(DIR_SRC)/$(THISAPP)
33
34# Normal build or /tools build.
35#
36ifeq "$(ROOT)" ""
37 TARGET = $(DIR_INFO)/$(THISAPP)
38 EXTRA_CONFIG = --prefix=/usr --enable-shared --disable-nls
857d9bf2
MT
39 EXTRA_MAKE = tooldir=/usr
40 EXTRA_INSTALL = tooldir=/usr
cd1a2927 41else
15679d9f 42ifeq "$(PASS)" "1"
cd1a2927 43 TARGET = $(DIR_INFO)/$(THISAPP)-tools1
46c2a9e3 44 EXTRA_CONFIG = --prefix=/tools --disable-nls --disable-werror --disable-gprof
e22c7973 45 EXTRA_MAKE = LDFLAGS="-all-static"
cd1a2927
MT
46 EXTRA_INSTALL =
47else
48 TARGET = $(DIR_INFO)/$(THISAPP)-tools2
dd714b8a 49 EXTRA_CONFIG = --prefix=/tools --with-lib-path=/tools/lib --disable-nls
cd1a2927
MT
50 EXTRA_MAKE =
51 EXTRA_INSTALL =
52endif
53endif
54
55###############################################################################
56# Top-level Rules
57###############################################################################
58
59objects = $(DL_FILE)
60
61$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
62
965018f4 63$(DL_FILE)_MD5 = 9d22ee4dafa3a194457caf4706f9cf01
cd1a2927
MT
64
65install : $(TARGET)
66
67check : $(patsubst %,$(DIR_CHK)/%,$(objects))
68
69download :$(patsubst %,$(DIR_DL)/%,$(objects))
70
71md5 : $(subst %,%_MD5,$(objects))
72
73###############################################################################
74# Downloading, checking, md5sum
75###############################################################################
76
77$(patsubst %,$(DIR_CHK)/%,$(objects)) :
78 @$(CHECK)
79
80$(patsubst %,$(DIR_DL)/%,$(objects)) :
81 @$(LOAD)
82
83$(subst %,%_MD5,$(objects)) :
84 @$(MD5)
85
86###############################################################################
87# Installation Details
88###############################################################################
89
90$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
91 @$(PREBUILD)
92 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
93 @mkdir $(DIR_SRC)/binutils-build
965018f4 94 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/$(THISAPP)-configure-1.patch
cd1a2927 95 cd $(DIR_SRC)/binutils-build && $(DIR_APP)/configure $(EXTRA_CONFIG)
e22c7973
MT
96ifeq "$(PASS)" "1"
97 cd $(DIR_SRC)/binutils-build && make configure-host
e22c7973 98endif
857d9bf2 99 cd $(DIR_SRC)/binutils-build && make $(EXTRA_MAKE) $(MAKETUNING)
cd1a2927 100 cd $(DIR_SRC)/binutils-build && make $(EXTRA_INSTALL) install
b4b6bcdb 101ifeq "$(ROOT)" ""
f97be0a6 102 cp -v $(DIR_APP)/include/libiberty.h /usr/include
cd1a2927 103else
15679d9f 104ifeq "$(PASS)" "1"
dd714b8a 105 cd $(DIR_SRC)/binutils-build && make -C ld clean
dd714b8a 106 cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/tools/lib
90d372c4 107 cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin
dd714b8a 108else
90d372c4 109 cd $(DIR_SRC)/binutils-build && make -C ld clean
dd714b8a 110 cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/usr/lib:/lib
dd714b8a 111 cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin
90d372c4 112endif
cd1a2927
MT
113endif
114 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build
115 @$(POSTBUILD)