]>
Commit | Line | Data |
---|---|---|
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 | ||
25 | include Config | |
26 | ||
51f9e7ac MT |
27 | ifeq "$(MACHINE)" "arm" |
28 | VER = 2.18 | |
29 | else | |
30 | VER = 2.17 | |
31 | endif | |
cd1a2927 MT |
32 | |
33 | THISAPP = binutils-$(VER) | |
34 | DL_FILE = $(THISAPP).tar.bz2 | |
1751628e | 35 | DL_FROM = $(URL_IPFIRE) |
cd1a2927 MT |
36 | DIR_APP = $(DIR_SRC)/$(THISAPP) |
37 | ||
51f9e7ac MT |
38 | # XXX maybe we can remove that ugly MACHINE= by this |
39 | #unexport MACHINE | |
40 | ||
cd1a2927 MT |
41 | # Normal build or /tools build. |
42 | # | |
43 | ifeq "$(ROOT)" "" | |
bc9f0c12 MT |
44 | ifeq "$(LFS_PASS)" "install" |
45 | TARGET = $(DIR_INFO)/$(THISAPP)-install | |
a50d04ab MT |
46 | EXTRA_CONFIG = --prefix=/opt/$(MACHINE)-uClibc \ |
47 | --build=$(MACHINE)-pc-linux-gnu \ | |
48 | --host=$(MACHINE)-pc-linux-gnu \ | |
49 | --target=$(MACHINE)-linux-uclibc \ | |
50 | --disable-nls \ | |
51 | --enable-multilib \ | |
52 | --disable-werror | |
53 | EXTRA_MAKE = all | |
54 | EXTRA_INSTALL = | |
bc9f0c12 | 55 | else |
cd1a2927 MT |
56 | TARGET = $(DIR_INFO)/$(THISAPP) |
57 | EXTRA_CONFIG = --prefix=/usr --enable-shared --disable-nls | |
857d9bf2 MT |
58 | EXTRA_MAKE = tooldir=/usr |
59 | EXTRA_INSTALL = tooldir=/usr | |
bc9f0c12 | 60 | endif |
cd1a2927 | 61 | else |
15679d9f | 62 | ifeq "$(PASS)" "1" |
cd1a2927 | 63 | TARGET = $(DIR_INFO)/$(THISAPP)-tools1 |
46c2a9e3 | 64 | EXTRA_CONFIG = --prefix=/tools --disable-nls --disable-werror --disable-gprof |
51f9e7ac | 65 | #EXTRA_MAKE = LDFLAGS="-all-static" |
cd1a2927 MT |
66 | EXTRA_INSTALL = |
67 | else | |
68 | TARGET = $(DIR_INFO)/$(THISAPP)-tools2 | |
dd714b8a | 69 | EXTRA_CONFIG = --prefix=/tools --with-lib-path=/tools/lib --disable-nls |
cd1a2927 MT |
70 | EXTRA_MAKE = |
71 | EXTRA_INSTALL = | |
72 | endif | |
73 | endif | |
74 | ||
51f9e7ac MT |
75 | ifeq "$(MACHINE)" "arm" |
76 | EXTRA_CONFIG += \ | |
77 | --host=$(BUILDTARGET) \ | |
78 | --build=$(BUILDTARGET) \ | |
79 | --target=$(BUILDTARGET) \ | |
80 | --with-abi=aapcs-linux \ | |
81 | --with-float=soft | |
82 | endif | |
83 | ||
cd1a2927 MT |
84 | ############################################################################### |
85 | # Top-level Rules | |
86 | ############################################################################### | |
87 | ||
88 | objects = $(DL_FILE) | |
89 | ||
90 | $(DL_FILE) = $(DL_FROM)/$(DL_FILE) | |
91 | ||
51f9e7ac MT |
92 | ifeq "$(MACHINE)" "arm" |
93 | $(DL_FILE)_MD5 = 9d22ee4dafa3a194457caf4706f9cf01 | |
94 | else | |
95 | $(DL_FILE)_MD5 = e26e2e06b6e4bf3acf1dc8688a94c0d1 | |
96 | endif | |
cd1a2927 MT |
97 | |
98 | install : $(TARGET) | |
99 | ||
100 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
101 | ||
102 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
103 | ||
104 | md5 : $(subst %,%_MD5,$(objects)) | |
105 | ||
106 | ############################################################################### | |
107 | # Downloading, checking, md5sum | |
108 | ############################################################################### | |
109 | ||
110 | $(patsubst %,$(DIR_CHK)/%,$(objects)) : | |
111 | @$(CHECK) | |
112 | ||
113 | $(patsubst %,$(DIR_DL)/%,$(objects)) : | |
114 | @$(LOAD) | |
115 | ||
116 | $(subst %,%_MD5,$(objects)) : | |
117 | @$(MD5) | |
118 | ||
119 | ############################################################################### | |
120 | # Installation Details | |
121 | ############################################################################### | |
122 | ||
123 | $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) | |
124 | @$(PREBUILD) | |
125 | @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE) | |
126 | @mkdir $(DIR_SRC)/binutils-build | |
51f9e7ac | 127 | cd $(DIR_SRC)/binutils-build && MACHINE= $(DIR_APP)/configure $(EXTRA_CONFIG) |
e22c7973 | 128 | ifeq "$(PASS)" "1" |
51f9e7ac | 129 | cd $(DIR_SRC)/binutils-build && make configure-host MAKEINFO=makeinfo MACHINE= |
e22c7973 | 130 | endif |
51f9e7ac MT |
131 | cd $(DIR_SRC)/binutils-build && make $(EXTRA_MAKE) $(MAKETUNING) MAKEINFO=makeinfo MACHINE= |
132 | cd $(DIR_SRC)/binutils-build && make $(EXTRA_INSTALL) install MAKEINFO=makeinfo MACHINE= | |
b4b6bcdb | 133 | ifeq "$(ROOT)" "" |
bc9f0c12 | 134 | ifneq "$(LFS_PASS)" "install" |
f97be0a6 | 135 | cp -v $(DIR_APP)/include/libiberty.h /usr/include |
bc9f0c12 | 136 | endif |
cd1a2927 | 137 | else |
15679d9f | 138 | ifeq "$(PASS)" "1" |
51f9e7ac MT |
139 | cd $(DIR_SRC)/binutils-build && make -C ld clean MACHINE= |
140 | cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/tools/lib MACHINE= | |
90d372c4 | 141 | cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin |
dd714b8a | 142 | else |
51f9e7ac MT |
143 | cd $(DIR_SRC)/binutils-build && make -C ld clean MACHINE= |
144 | cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/usr/lib:/lib MACHINE= | |
dd714b8a | 145 | cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin |
90d372c4 | 146 | endif |
cd1a2927 MT |
147 | endif |
148 | @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build | |
149 | @$(POSTBUILD) |