]>
Commit | Line | Data |
---|---|---|
cd1a2927 | 1 | ############################################################################### |
cd1a2927 | 2 | # # |
70df8302 | 3 | # IPFire.org - A linux based firewall # |
f3c01b39 | 4 | # Copyright (C) 2007-2017 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 | ||
7cefbe1c | 27 | VER = 2.28 |
cd1a2927 MT |
28 | |
29 | THISAPP = binutils-$(VER) | |
7cefbe1c | 30 | DL_FILE = $(THISAPP).tar.gz |
1751628e | 31 | DL_FROM = $(URL_IPFIRE) |
cd1a2927 MT |
32 | DIR_APP = $(DIR_SRC)/$(THISAPP) |
33 | ||
34 | # Normal build or /tools build. | |
35 | # | |
36 | ifeq "$(ROOT)" "" | |
37 | TARGET = $(DIR_INFO)/$(THISAPP) | |
1d627130 MT |
38 | EXTRA_CONFIG = \ |
39 | --prefix=/usr \ | |
40 | --enable-shared \ | |
18f49339 MT |
41 | --with-system-zlib \ |
42 | --enable-plugins \ | |
43 | --enable-ld=default \ | |
44 | --disable-gold | |
857d9bf2 MT |
45 | EXTRA_MAKE = tooldir=/usr |
46 | EXTRA_INSTALL = tooldir=/usr | |
cd1a2927 | 47 | else |
15679d9f | 48 | ifeq "$(PASS)" "1" |
8e01581f | 49 | CFLAGS := $(patsubst -march=%,,$(CFLAGS)) |
f3c01b39 | 50 | CFLAGS := $(patsubst -mfpu=%,,$(CFLAGS)) |
8e01581f MT |
51 | CFLAGS := $(patsubst -mfloat-abi=%,,$(CFLAGS)) |
52 | ||
cd1a2927 | 53 | TARGET = $(DIR_INFO)/$(THISAPP)-tools1 |
35a8f5f0 MT |
54 | EXTRA_CONFIG = \ |
55 | --target=$(CROSSTARGET) \ | |
56 | --prefix=/tools \ | |
2eb67894 | 57 | --with-sysroot=$(ROOT) \ |
18f49339 | 58 | --with-lib-path=/tools/lib |
35a8f5f0 | 59 | EXTRA_MAKE = |
cd1a2927 MT |
60 | EXTRA_INSTALL = |
61 | else | |
62 | TARGET = $(DIR_INFO)/$(THISAPP)-tools2 | |
35a8f5f0 | 63 | EXTRA_ENV = \ |
a74272d2 | 64 | CC="$(CROSSTARGET)-gcc" \ |
35a8f5f0 MT |
65 | AR="$(CROSSTARGET)-ar" \ |
66 | RANLIB="$(CROSSTARGET)-ranlib" | |
67 | EXTRA_CONFIG = \ | |
68 | --host=$(BUILDTARGET) \ | |
69 | --build=$(BUILDTARGET) \ | |
70 | --prefix=/tools \ | |
18f49339 | 71 | --with-lib-path=/tools/lib |
cd1a2927 MT |
72 | EXTRA_MAKE = |
73 | EXTRA_INSTALL = | |
74 | endif | |
75 | endif | |
76 | ||
dc7d6b20 | 77 | ifeq "$(BUILD_ARCH)" "armv5tel" |
51f9e7ac | 78 | EXTRA_CONFIG += \ |
51f9e7ac | 79 | --with-abi=aapcs-linux \ |
35a8f5f0 | 80 | --with-float=soft |
51f9e7ac MT |
81 | endif |
82 | ||
81aa9714 | 83 | EXTRA_CONFIG += \ |
18f49339 | 84 | --disable-werror \ |
81aa9714 MT |
85 | --enable-64-bit-bfd |
86 | ||
cd1a2927 MT |
87 | ############################################################################### |
88 | # Top-level Rules | |
89 | ############################################################################### | |
90 | ||
91 | objects = $(DL_FILE) | |
92 | ||
93 | $(DL_FILE) = $(DL_FROM)/$(DL_FILE) | |
94 | ||
7cefbe1c | 95 | $(DL_FILE)_MD5 = d5d270fd0b698ed59ca5ade8e1b5059c |
cd1a2927 MT |
96 | |
97 | install : $(TARGET) | |
98 | ||
99 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
100 | ||
101 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
102 | ||
103 | md5 : $(subst %,%_MD5,$(objects)) | |
104 | ||
105 | ############################################################################### | |
106 | # Downloading, checking, md5sum | |
107 | ############################################################################### | |
108 | ||
109 | $(patsubst %,$(DIR_CHK)/%,$(objects)) : | |
110 | @$(CHECK) | |
111 | ||
112 | $(patsubst %,$(DIR_DL)/%,$(objects)) : | |
113 | @$(LOAD) | |
114 | ||
115 | $(subst %,%_MD5,$(objects)) : | |
116 | @$(MD5) | |
117 | ||
118 | ############################################################################### | |
119 | # Installation Details | |
120 | ############################################################################### | |
121 | ||
122 | $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) | |
123 | @$(PREBUILD) | |
7cefbe1c | 124 | @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) |
cd1a2927 | 125 | @mkdir $(DIR_SRC)/binutils-build |
fc5076e3 MT |
126 | |
127 | # Prevent installing libiberty to lib64. | |
128 | cd $(DIR_APP) && sed -i 's%\(^MULTIOSDIR = \).*%\1 ../lib%' libiberty/Makefile.in | |
129 | ||
dc7d6b20 MT |
130 | cd $(DIR_SRC)/binutils-build && $(EXTRA_ENV) $(DIR_APP)/configure $(EXTRA_CONFIG) |
131 | cd $(DIR_SRC)/binutils-build && make $(EXTRA_MAKE) $(MAKETUNING) | |
132 | cd $(DIR_SRC)/binutils-build && make $(EXTRA_INSTALL) install | |
b4b6bcdb | 133 | ifeq "$(ROOT)" "" |
f97be0a6 | 134 | cp -v $(DIR_APP)/include/libiberty.h /usr/include |
18f49339 MT |
135 | endif |
136 | ||
137 | ifeq "$(TOOLCHAIN)" "1" | |
138 | ifeq "$(PASS)" "2" | |
dc7d6b20 MT |
139 | cd $(DIR_SRC)/binutils-build && make -C ld clean |
140 | cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/usr/lib:/lib | |
dd714b8a | 141 | cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin |
18f49339 | 142 | endif |
90d372c4 | 143 | endif |
18f49339 | 144 | |
cd1a2927 MT |
145 | @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build |
146 | @$(POSTBUILD) |