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