]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame_incremental - lfs/binutils
Merge branch 'kernel-update' of ssh://git.ipfire.org/pub/git/ipfire-2.x into glibc...
[people/teissler/ipfire-2.x.git] / lfs / binutils
... / ...
CommitLineData
1###############################################################################
2# #
3# IPFire.org - A linux based firewall #
4# Copyright (C) 2007-2011 IPFire Team <info@ipfire.org> #
5# #
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. #
10# #
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. #
15# #
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/>. #
18# #
19###############################################################################
20
21###############################################################################
22# Definitions
23###############################################################################
24
25include Config
26
27VER = 2.22
28
29THISAPP = binutils-$(VER)
30DL_FILE = $(THISAPP).tar.bz2
31DL_FROM = $(URL_IPFIRE)
32DIR_APP = $(DIR_SRC)/$(THISAPP)
33
34# XXX maybe we can remove that ugly MACHINE= by this
35#unexport MACHINE
36
37# Normal build or /tools build.
38#
39ifeq "$(ROOT)" ""
40 TARGET = $(DIR_INFO)/$(THISAPP)
41 EXTRA_CONFIG = --prefix=/usr --enable-shared --disable-nls
42 EXTRA_MAKE = tooldir=/usr
43 EXTRA_INSTALL = tooldir=/usr
44else
45ifeq "$(PASS)" "1"
46 TARGET = $(DIR_INFO)/$(THISAPP)-tools1
47 EXTRA_CONFIG = --prefix=/tools --disable-nls --disable-werror --disable-gprof
48 #EXTRA_MAKE = LDFLAGS="-all-static"
49 EXTRA_INSTALL =
50else
51 TARGET = $(DIR_INFO)/$(THISAPP)-tools2
52 EXTRA_CONFIG = --prefix=/tools --with-lib-path=/tools/lib --disable-nls
53 EXTRA_MAKE =
54 EXTRA_INSTALL =
55endif
56endif
57
58EXTRA_CONFIG += --build=$(BUILDTARGET)
59
60ifeq "$(MACHINE_TYPE)" "arm"
61 EXTRA_CONFIG += \
62 --with-abi=aapcs-linux \
63 --with-float=soft
64endif
65
66###############################################################################
67# Top-level Rules
68###############################################################################
69
70objects = $(DL_FILE)
71
72$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
73
74$(DL_FILE)_MD5 = ee0f10756c84979622b992a4a61ea3f5
75
76install : $(TARGET)
77
78check : $(patsubst %,$(DIR_CHK)/%,$(objects))
79
80download :$(patsubst %,$(DIR_DL)/%,$(objects))
81
82md5 : $(subst %,%_MD5,$(objects))
83
84###############################################################################
85# Downloading, checking, md5sum
86###############################################################################
87
88$(patsubst %,$(DIR_CHK)/%,$(objects)) :
89 @$(CHECK)
90
91$(patsubst %,$(DIR_DL)/%,$(objects)) :
92 @$(LOAD)
93
94$(subst %,%_MD5,$(objects)) :
95 @$(MD5)
96
97###############################################################################
98# Installation Details
99###############################################################################
100
101$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
102 @$(PREBUILD)
103 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
104 @mkdir $(DIR_SRC)/binutils-build
105 cd $(DIR_SRC)/binutils-build && MACHINE= $(DIR_APP)/configure $(EXTRA_CONFIG)
106ifeq "$(PASS)" "1"
107 cd $(DIR_SRC)/binutils-build && make configure-host MAKEINFO=makeinfo MACHINE=
108endif
109 cd $(DIR_SRC)/binutils-build && make $(EXTRA_MAKE) $(MAKETUNING) MAKEINFO=makeinfo MACHINE=
110 cd $(DIR_SRC)/binutils-build && make $(EXTRA_INSTALL) install MAKEINFO=makeinfo MACHINE=
111ifeq "$(ROOT)" ""
112 cp -v $(DIR_APP)/include/libiberty.h /usr/include
113else
114ifeq "$(PASS)" "1"
115 cd $(DIR_SRC)/binutils-build && make -C ld clean MACHINE=
116 cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/tools/lib MACHINE=
117 cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin
118else
119 cd $(DIR_SRC)/binutils-build && make -C ld clean MACHINE=
120 cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/usr/lib:/lib MACHINE=
121 cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin
122endif
123endif
124 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build
125 @$(POSTBUILD)