]>
Commit | Line | Data |
---|---|---|
1 | ############################################################################### | |
2 | # This file is part of the IPCop Firewall. # | |
3 | # # | |
4 | # IPCop is free software; you can redistribute it and/or modify # | |
5 | # it under the terms of the GNU General Public License as published by # | |
6 | # the Free Software Foundation; either version 2 of the License, or # | |
7 | # (at your option) any later version. # | |
8 | # # | |
9 | # IPCop is distributed in the hope that it will be useful, # | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # | |
12 | # GNU General Public License for more details. # | |
13 | # # | |
14 | # You should have received a copy of the GNU General Public License # | |
15 | # along with IPCop; if not, write to the Free Software # | |
16 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # | |
17 | # # | |
18 | # Makefiles are based on LFSMake, which is # | |
19 | # Copyright (C) 2002 Rod Roard <rod@sunsetsystems.com> # | |
20 | # # | |
21 | ############################################################################### | |
22 | ||
23 | ############################################################################### | |
24 | # Definitions | |
25 | ############################################################################### | |
26 | ||
27 | include Config | |
28 | ||
29 | VER = 2.16.1 | |
30 | ||
31 | THISAPP = binutils-$(VER) | |
32 | DL_FILE = $(THISAPP).tar.bz2 | |
33 | DL_FROM = $(URL_IPFIRE) | |
34 | DIR_APP = $(DIR_SRC)/$(THISAPP) | |
35 | ||
36 | # Normal build or /tools build. | |
37 | # | |
38 | ifeq "$(ROOT)" "" | |
39 | ifeq "$(LFS_PASS)" "install" | |
40 | TARGET = $(DIR_INFO)/$(THISAPP)-install | |
41 | EXTRA_CONFIG = --target=$(MACHINE)-linux-uclibc --prefix=/opt/$(MACHINE)-uClibc --disable-nls \ | |
42 | --with-sysroot=/opt/$(MACHINE)-uClibc/$(MACHINE)-linux-uclibc | |
43 | EXTRA_MAKE = | |
44 | EXTRA_INSTALL = | |
45 | else | |
46 | TARGET = $(DIR_INFO)/$(THISAPP) | |
47 | EXTRA_CONFIG = --prefix=/usr --enable-shared --disable-nls | |
48 | EXTRA_MAKE = tooldir=/usr | |
49 | EXTRA_INSTALL = tooldir=/usr | |
50 | endif | |
51 | else | |
52 | ifeq "$(PASS)" "1" | |
53 | TARGET = $(DIR_INFO)/$(THISAPP)-tools1 | |
54 | EXTRA_CONFIG = --prefix=/tools --disable-nls | |
55 | EXTRA_MAKE = LDFLAGS="-all-static" | |
56 | EXTRA_INSTALL = | |
57 | else | |
58 | TARGET = $(DIR_INFO)/$(THISAPP)-tools2 | |
59 | EXTRA_CONFIG = --prefix=/tools --with-lib-path=/tools/lib --disable-nls | |
60 | EXTRA_MAKE = | |
61 | EXTRA_INSTALL = | |
62 | endif | |
63 | endif | |
64 | ||
65 | ############################################################################### | |
66 | # Top-level Rules | |
67 | ############################################################################### | |
68 | ||
69 | objects = $(DL_FILE) | |
70 | ||
71 | $(DL_FILE) = $(DL_FROM)/$(DL_FILE) | |
72 | ||
73 | $(DL_FILE)_MD5 = 6a9d529efb285071dad10e1f3d2b2967 | |
74 | ||
75 | install : $(TARGET) | |
76 | ||
77 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
78 | ||
79 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
80 | ||
81 | md5 : $(subst %,%_MD5,$(objects)) | |
82 | ||
83 | ############################################################################### | |
84 | # Downloading, checking, md5sum | |
85 | ############################################################################### | |
86 | ||
87 | $(patsubst %,$(DIR_CHK)/%,$(objects)) : | |
88 | @$(CHECK) | |
89 | ||
90 | $(patsubst %,$(DIR_DL)/%,$(objects)) : | |
91 | @$(LOAD) | |
92 | ||
93 | $(subst %,%_MD5,$(objects)) : | |
94 | @$(MD5) | |
95 | ||
96 | ############################################################################### | |
97 | # Installation Details | |
98 | ############################################################################### | |
99 | ||
100 | $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) | |
101 | @$(PREBUILD) | |
102 | @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE) | |
103 | @mkdir $(DIR_SRC)/binutils-build | |
104 | ifeq "$(LFS_PASS)" "install" | |
105 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/binutils-uclibc-conf.patch | |
106 | cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/binutils-uclibc-libtool-conf.patch | |
107 | endif | |
108 | cd $(DIR_SRC)/binutils-build && $(DIR_APP)/configure $(EXTRA_CONFIG) | |
109 | ifeq "$(PASS)" "1" | |
110 | cd $(DIR_SRC)/binutils-build && make configure-host | |
111 | endif | |
112 | cd $(DIR_SRC)/binutils-build && make $(EXTRA_MAKE) $(MAKETUNING) | |
113 | cd $(DIR_SRC)/binutils-build && make $(EXTRA_INSTALL) install | |
114 | ifeq "$(ROOT)" "" | |
115 | ifneq "$(LFS_PASS)" "install" | |
116 | cp -v $(DIR_APP)/include/libiberty.h /usr/include | |
117 | endif | |
118 | else | |
119 | ifeq "$(PASS)" "1" | |
120 | cd $(DIR_SRC)/binutils-build && make -C ld clean | |
121 | cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/tools/lib | |
122 | cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin | |
123 | else | |
124 | cd $(DIR_SRC)/binutils-build && make -C ld clean | |
125 | cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/usr/lib:/lib | |
126 | cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin | |
127 | endif | |
128 | endif | |
129 | @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build | |
130 | @$(POSTBUILD) |