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