]>
Commit | Line | Data |
---|---|---|
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.18 | |
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 = --prefix=/tools --disable-nls --disable-werror --disable-gprof | |
45 | EXTRA_MAKE = LDFLAGS="-all-static" | |
46 | EXTRA_INSTALL = | |
47 | else | |
48 | TARGET = $(DIR_INFO)/$(THISAPP)-tools2 | |
49 | EXTRA_CONFIG = --prefix=/tools --with-lib-path=/tools/lib --disable-nls | |
50 | EXTRA_MAKE = | |
51 | EXTRA_INSTALL = | |
52 | endif | |
53 | endif | |
54 | ||
55 | EXTRA_CONFIG += --build=$(BUILDTARGET) | |
56 | ||
57 | ############################################################################### | |
58 | # Top-level Rules | |
59 | ############################################################################### | |
60 | ||
61 | objects = $(DL_FILE) | |
62 | ||
63 | $(DL_FILE) = $(DL_FROM)/$(DL_FILE) | |
64 | ||
65 | $(DL_FILE)_MD5 = 9d22ee4dafa3a194457caf4706f9cf01 | |
66 | ||
67 | install : $(TARGET) | |
68 | ||
69 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
70 | ||
71 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
72 | ||
73 | md5 : $(subst %,%_MD5,$(objects)) | |
74 | ||
75 | ############################################################################### | |
76 | # Downloading, checking, md5sum | |
77 | ############################################################################### | |
78 | ||
79 | $(patsubst %,$(DIR_CHK)/%,$(objects)) : | |
80 | @$(CHECK) | |
81 | ||
82 | $(patsubst %,$(DIR_DL)/%,$(objects)) : | |
83 | @$(LOAD) | |
84 | ||
85 | $(subst %,%_MD5,$(objects)) : | |
86 | @$(MD5) | |
87 | ||
88 | ############################################################################### | |
89 | # Installation Details | |
90 | ############################################################################### | |
91 | ||
92 | $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) | |
93 | @$(PREBUILD) | |
94 | @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE) | |
95 | @mkdir $(DIR_SRC)/binutils-build | |
96 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/$(THISAPP)-configure-1.patch | |
97 | cd $(DIR_SRC)/binutils-build && $(DIR_APP)/configure $(EXTRA_CONFIG) | |
98 | ifeq "$(PASS)" "1" | |
99 | cd $(DIR_SRC)/binutils-build && make configure-host | |
100 | endif | |
101 | cd $(DIR_SRC)/binutils-build && make $(EXTRA_MAKE) $(MAKETUNING) | |
102 | cd $(DIR_SRC)/binutils-build && make $(EXTRA_INSTALL) install | |
103 | ifeq "$(ROOT)" "" | |
104 | cp -v $(DIR_APP)/include/libiberty.h /usr/include | |
105 | else | |
106 | ifeq "$(PASS)" "1" | |
107 | cd $(DIR_SRC)/binutils-build && make -C ld clean | |
108 | cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/tools/lib | |
109 | cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin | |
110 | else | |
111 | cd $(DIR_SRC)/binutils-build && make -C ld clean | |
112 | cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/usr/lib:/lib | |
113 | cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin | |
114 | endif | |
115 | endif | |
116 | @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build | |
117 | @$(POSTBUILD) |