]>
Commit | Line | Data |
---|---|---|
1 | ############################################################################### | |
2 | # # | |
3 | # IPFire.org - A linux based firewall # | |
4 | # Copyright (C) 2007 Michael Tremer & Christian Schmidt # | |
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.16.1 | |
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 | ifeq "$(LFS_PASS)" "install" | |
38 | TARGET = $(DIR_INFO)/$(THISAPP)-install | |
39 | EXTRA_CONFIG = --prefix=/opt/$(MACHINE)-uClibc \ | |
40 | --build=$(MACHINE)-pc-linux-gnu \ | |
41 | --host=$(MACHINE)-pc-linux-gnu \ | |
42 | --target=$(MACHINE)-linux-uclibc \ | |
43 | --disable-nls \ | |
44 | --enable-multilib \ | |
45 | --disable-werror | |
46 | EXTRA_MAKE = all | |
47 | EXTRA_INSTALL = | |
48 | else | |
49 | TARGET = $(DIR_INFO)/$(THISAPP) | |
50 | EXTRA_CONFIG = --prefix=/usr --enable-shared --disable-nls | |
51 | EXTRA_MAKE = tooldir=/usr | |
52 | EXTRA_INSTALL = tooldir=/usr | |
53 | endif | |
54 | else | |
55 | ifeq "$(PASS)" "1" | |
56 | TARGET = $(DIR_INFO)/$(THISAPP)-tools1 | |
57 | EXTRA_CONFIG = --prefix=/tools --disable-nls | |
58 | EXTRA_MAKE = LDFLAGS="-all-static" | |
59 | EXTRA_INSTALL = | |
60 | else | |
61 | TARGET = $(DIR_INFO)/$(THISAPP)-tools2 | |
62 | EXTRA_CONFIG = --prefix=/tools --with-lib-path=/tools/lib --disable-nls | |
63 | EXTRA_MAKE = | |
64 | EXTRA_INSTALL = | |
65 | endif | |
66 | endif | |
67 | ||
68 | ############################################################################### | |
69 | # Top-level Rules | |
70 | ############################################################################### | |
71 | ||
72 | objects = $(DL_FILE) | |
73 | ||
74 | $(DL_FILE) = $(DL_FROM)/$(DL_FILE) | |
75 | ||
76 | $(DL_FILE)_MD5 = 6a9d529efb285071dad10e1f3d2b2967 | |
77 | ||
78 | install : $(TARGET) | |
79 | ||
80 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
81 | ||
82 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
83 | ||
84 | md5 : $(subst %,%_MD5,$(objects)) | |
85 | ||
86 | ############################################################################### | |
87 | # Downloading, checking, md5sum | |
88 | ############################################################################### | |
89 | ||
90 | $(patsubst %,$(DIR_CHK)/%,$(objects)) : | |
91 | @$(CHECK) | |
92 | ||
93 | $(patsubst %,$(DIR_DL)/%,$(objects)) : | |
94 | @$(LOAD) | |
95 | ||
96 | $(subst %,%_MD5,$(objects)) : | |
97 | @$(MD5) | |
98 | ||
99 | ############################################################################### | |
100 | # Installation Details | |
101 | ############################################################################### | |
102 | ||
103 | $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) | |
104 | @$(PREBUILD) | |
105 | @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE) | |
106 | @mkdir $(DIR_SRC)/binutils-build | |
107 | ifeq "$(LFS_PASS)" "install" | |
108 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/binutils-uclibc-conf.patch | |
109 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/binutils-uclibc-libtool-conf.patch | |
110 | endif | |
111 | cd $(DIR_SRC)/binutils-build && $(DIR_APP)/configure $(EXTRA_CONFIG) | |
112 | ifeq "$(PASS)" "1" | |
113 | cd $(DIR_SRC)/binutils-build && make configure-host | |
114 | endif | |
115 | cd $(DIR_SRC)/binutils-build && make $(EXTRA_MAKE) $(MAKETUNING) | |
116 | cd $(DIR_SRC)/binutils-build && make $(EXTRA_INSTALL) install | |
117 | ifeq "$(ROOT)" "" | |
118 | ifneq "$(LFS_PASS)" "install" | |
119 | cp -v $(DIR_APP)/include/libiberty.h /usr/include | |
120 | endif | |
121 | else | |
122 | ifeq "$(PASS)" "1" | |
123 | cd $(DIR_SRC)/binutils-build && make -C ld clean | |
124 | cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/tools/lib | |
125 | cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin | |
126 | else | |
127 | cd $(DIR_SRC)/binutils-build && make -C ld clean | |
128 | cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/usr/lib:/lib | |
129 | cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin | |
130 | endif | |
131 | endif | |
132 | @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build | |
133 | @$(POSTBUILD) |