]> git.ipfire.org Git - ipfire-2.x.git/blame - lfs/binutils
toolchain: cpu-type fixes.
[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
35299235
AF
55EXTRA_CONFIG += --build=$(BUILDTARGET)
56
cd1a2927
MT
57###############################################################################
58# Top-level Rules
59###############################################################################
60
61objects = $(DL_FILE)
62
63$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
64
965018f4 65$(DL_FILE)_MD5 = 9d22ee4dafa3a194457caf4706f9cf01
cd1a2927
MT
66
67install : $(TARGET)
68
69check : $(patsubst %,$(DIR_CHK)/%,$(objects))
70
71download :$(patsubst %,$(DIR_DL)/%,$(objects))
72
73md5 : $(subst %,%_MD5,$(objects))
74
75###############################################################################
76# Downloading, checking, md5sum
77###############################################################################
78
79$(patsubst %,$(DIR_CHK)/%,$(objects)) :
80 @$(CHECK)
81
82$(patsubst %,$(DIR_DL)/%,$(objects)) :
83 @$(LOAD)
84
85$(subst %,%_MD5,$(objects)) :
86 @$(MD5)
87
88###############################################################################
89# Installation Details
90###############################################################################
91
92$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
93 @$(PREBUILD)
94 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
95 @mkdir $(DIR_SRC)/binutils-build
965018f4 96 cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/$(THISAPP)-configure-1.patch
cd1a2927 97 cd $(DIR_SRC)/binutils-build && $(DIR_APP)/configure $(EXTRA_CONFIG)
e22c7973
MT
98ifeq "$(PASS)" "1"
99 cd $(DIR_SRC)/binutils-build && make configure-host
e22c7973 100endif
857d9bf2 101 cd $(DIR_SRC)/binutils-build && make $(EXTRA_MAKE) $(MAKETUNING)
cd1a2927 102 cd $(DIR_SRC)/binutils-build && make $(EXTRA_INSTALL) install
b4b6bcdb 103ifeq "$(ROOT)" ""
f97be0a6 104 cp -v $(DIR_APP)/include/libiberty.h /usr/include
cd1a2927 105else
15679d9f 106ifeq "$(PASS)" "1"
dd714b8a 107 cd $(DIR_SRC)/binutils-build && make -C ld clean
dd714b8a 108 cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/tools/lib
90d372c4 109 cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin
dd714b8a 110else
90d372c4 111 cd $(DIR_SRC)/binutils-build && make -C ld clean
dd714b8a 112 cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/usr/lib:/lib
dd714b8a 113 cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin
90d372c4 114endif
cd1a2927
MT
115endif
116 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build
117 @$(POSTBUILD)