]> git.ipfire.org Git - ipfire-2.x.git/blob - lfs/binutils
binutils: Format configure argument list.
[ipfire-2.x.git] / lfs / binutils
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
25 include Config
26
27 VER = 2.22
28
29 THISAPP = binutils-$(VER)
30 DL_FILE = $(THISAPP).tar.bz2
31 DL_FROM = $(URL_IPFIRE)
32 DIR_APP = $(DIR_SRC)/$(THISAPP)
33
34 # Normal build or /tools build.
35 #
36 ifeq "$(ROOT)" ""
37 TARGET = $(DIR_INFO)/$(THISAPP)
38 EXTRA_CONFIG = \
39 --prefix=/usr \
40 --enable-shared \
41 --disable-nls
42 EXTRA_MAKE = tooldir=/usr
43 EXTRA_INSTALL = tooldir=/usr
44 else
45 ifeq "$(PASS)" "1"
46 TARGET = $(DIR_INFO)/$(THISAPP)-tools1
47 EXTRA_CONFIG = \
48 --target=$(CROSSTARGET) \
49 --prefix=/tools \
50 --disable-nls \
51 --disable-werror
52 EXTRA_MAKE =
53 EXTRA_INSTALL =
54 else
55 TARGET = $(DIR_INFO)/$(THISAPP)-tools2
56 EXTRA_ENV = \
57 CC="$(CROSSTARGET)-gcc -B/tools/lib/" \
58 AR="$(CROSSTARGET)-ar" \
59 RANLIB="$(CROSSTARGET)-ranlib"
60 EXTRA_CONFIG = \
61 --host=$(BUILDTARGET) \
62 --build=$(BUILDTARGET) \
63 --prefix=/tools \
64 --with-lib-path=/tools/lib \
65 --disable-nls
66 EXTRA_MAKE =
67 EXTRA_INSTALL =
68 endif
69 endif
70
71 ifeq "$(MACHINE_TYPE)" "arm"
72 EXTRA_CONFIG += \
73 --with-abi=aapcs-linux \
74 --with-float=soft
75 endif
76
77 ###############################################################################
78 # Top-level Rules
79 ###############################################################################
80
81 objects = $(DL_FILE)
82
83 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
84
85 $(DL_FILE)_MD5 = ee0f10756c84979622b992a4a61ea3f5
86
87 install : $(TARGET)
88
89 check : $(patsubst %,$(DIR_CHK)/%,$(objects))
90
91 download :$(patsubst %,$(DIR_DL)/%,$(objects))
92
93 md5 : $(subst %,%_MD5,$(objects))
94
95 ###############################################################################
96 # Downloading, checking, md5sum
97 ###############################################################################
98
99 $(patsubst %,$(DIR_CHK)/%,$(objects)) :
100 @$(CHECK)
101
102 $(patsubst %,$(DIR_DL)/%,$(objects)) :
103 @$(LOAD)
104
105 $(subst %,%_MD5,$(objects)) :
106 @$(MD5)
107
108 ###############################################################################
109 # Installation Details
110 ###############################################################################
111
112 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
113 @$(PREBUILD)
114 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
115 @mkdir $(DIR_SRC)/binutils-build
116 cd $(DIR_SRC)/binutils-build && $(EXTRA_ENV) MACHINE= $(DIR_APP)/configure $(EXTRA_CONFIG)
117 cd $(DIR_SRC)/binutils-build && make $(EXTRA_MAKE) $(MAKETUNING) MACHINE=
118 cd $(DIR_SRC)/binutils-build && make $(EXTRA_INSTALL) install MACHINE=
119 ifeq "$(ROOT)" ""
120 cp -v $(DIR_APP)/include/libiberty.h /usr/include
121 else
122 ifeq "$(PASS)" "2"
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
126 endif
127 endif
128 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build
129 @$(POSTBUILD)