]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - lfs/binutils
Added mdadm lfs file
[people/pmueller/ipfire-2.x.git] / lfs / binutils
CommitLineData
cd1a2927 1###############################################################################
cd1a2927 2# #
70df8302
MT
3# IPFire.org - A linux based firewall #
4# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
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
1bffd938 27VER = 2.17
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)" ""
bc9f0c12
MT
37ifeq "$(LFS_PASS)" "install"
38 TARGET = $(DIR_INFO)/$(THISAPP)-install
a50d04ab
MT
39 EXTRA_CONFIG = --prefix=/opt/$(MACHINE)-uClibc \
40 --build=$(MACHINE)-pc-linux-gnu \
41 --host=$(MACHINE)-pc-linux-gnu \
42 --target=$(MACHINE)-linux-uclibc \
43 --disable-nls \
44 --enable-multilib \
45 --disable-werror
46 EXTRA_MAKE = all
47 EXTRA_INSTALL =
bc9f0c12 48else
cd1a2927
MT
49 TARGET = $(DIR_INFO)/$(THISAPP)
50 EXTRA_CONFIG = --prefix=/usr --enable-shared --disable-nls
857d9bf2
MT
51 EXTRA_MAKE = tooldir=/usr
52 EXTRA_INSTALL = tooldir=/usr
bc9f0c12 53endif
cd1a2927 54else
15679d9f 55ifeq "$(PASS)" "1"
cd1a2927 56 TARGET = $(DIR_INFO)/$(THISAPP)-tools1
da7a0177 57 EXTRA_CONFIG = --prefix=/tools --disable-nls --disable-werror
e22c7973 58 EXTRA_MAKE = LDFLAGS="-all-static"
cd1a2927
MT
59 EXTRA_INSTALL =
60else
61 TARGET = $(DIR_INFO)/$(THISAPP)-tools2
dd714b8a 62 EXTRA_CONFIG = --prefix=/tools --with-lib-path=/tools/lib --disable-nls
cd1a2927
MT
63 EXTRA_MAKE =
64 EXTRA_INSTALL =
65endif
66endif
67
68###############################################################################
69# Top-level Rules
70###############################################################################
71
72objects = $(DL_FILE)
73
74$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
75
1bffd938 76$(DL_FILE)_MD5 = e26e2e06b6e4bf3acf1dc8688a94c0d1
cd1a2927
MT
77
78install : $(TARGET)
79
80check : $(patsubst %,$(DIR_CHK)/%,$(objects))
81
82download :$(patsubst %,$(DIR_DL)/%,$(objects))
83
84md5 : $(subst %,%_MD5,$(objects))
85
86###############################################################################
87# Downloading, checking, md5sum
88###############################################################################
89
90$(patsubst %,$(DIR_CHK)/%,$(objects)) :
91 @$(CHECK)
92
93$(patsubst %,$(DIR_DL)/%,$(objects)) :
94 @$(LOAD)
95
96$(subst %,%_MD5,$(objects)) :
97 @$(MD5)
98
99###############################################################################
100# Installation Details
101###############################################################################
102
103$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
104 @$(PREBUILD)
105 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
106 @mkdir $(DIR_SRC)/binutils-build
107 cd $(DIR_SRC)/binutils-build && $(DIR_APP)/configure $(EXTRA_CONFIG)
e22c7973
MT
108ifeq "$(PASS)" "1"
109 cd $(DIR_SRC)/binutils-build && make configure-host
e22c7973 110endif
857d9bf2 111 cd $(DIR_SRC)/binutils-build && make $(EXTRA_MAKE) $(MAKETUNING)
cd1a2927 112 cd $(DIR_SRC)/binutils-build && make $(EXTRA_INSTALL) install
b4b6bcdb 113ifeq "$(ROOT)" ""
bc9f0c12 114ifneq "$(LFS_PASS)" "install"
f97be0a6 115 cp -v $(DIR_APP)/include/libiberty.h /usr/include
bc9f0c12 116endif
cd1a2927 117else
15679d9f 118ifeq "$(PASS)" "1"
dd714b8a 119 cd $(DIR_SRC)/binutils-build && make -C ld clean
dd714b8a 120 cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/tools/lib
90d372c4 121 cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin
dd714b8a 122else
90d372c4 123 cd $(DIR_SRC)/binutils-build && make -C ld clean
dd714b8a 124 cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/usr/lib:/lib
dd714b8a 125 cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin
90d372c4 126endif
cd1a2927
MT
127endif
128 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build
129 @$(POSTBUILD)