]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - lfs/binutils
Ich hab mal ueber die Feiertage nen kleinen Rewrite von dem Installersystem gemacht.
[people/pmueller/ipfire-2.x.git] / lfs / binutils
CommitLineData
cd1a2927
MT
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# #
cd1a2927
MT
21###############################################################################
22
23###############################################################################
24# Definitions
25###############################################################################
26
27include Config
28
dd714b8a 29VER = 2.16.1
cd1a2927
MT
30
31THISAPP = binutils-$(VER)
32DL_FILE = $(THISAPP).tar.bz2
1751628e 33DL_FROM = $(URL_IPFIRE)
cd1a2927
MT
34DIR_APP = $(DIR_SRC)/$(THISAPP)
35
36# Normal build or /tools build.
37#
38ifeq "$(ROOT)" ""
bc9f0c12
MT
39ifeq "$(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 =
45else
cd1a2927
MT
46 TARGET = $(DIR_INFO)/$(THISAPP)
47 EXTRA_CONFIG = --prefix=/usr --enable-shared --disable-nls
857d9bf2
MT
48 EXTRA_MAKE = tooldir=/usr
49 EXTRA_INSTALL = tooldir=/usr
bc9f0c12 50endif
cd1a2927 51else
15679d9f 52ifeq "$(PASS)" "1"
cd1a2927
MT
53 TARGET = $(DIR_INFO)/$(THISAPP)-tools1
54 EXTRA_CONFIG = --prefix=/tools --disable-nls
e22c7973 55 EXTRA_MAKE = LDFLAGS="-all-static"
cd1a2927
MT
56 EXTRA_INSTALL =
57else
58 TARGET = $(DIR_INFO)/$(THISAPP)-tools2
dd714b8a 59 EXTRA_CONFIG = --prefix=/tools --with-lib-path=/tools/lib --disable-nls
cd1a2927
MT
60 EXTRA_MAKE =
61 EXTRA_INSTALL =
62endif
63endif
64
65###############################################################################
66# Top-level Rules
67###############################################################################
68
69objects = $(DL_FILE)
70
71$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
72
dd714b8a 73$(DL_FILE)_MD5 = 6a9d529efb285071dad10e1f3d2b2967
cd1a2927
MT
74
75install : $(TARGET)
76
77check : $(patsubst %,$(DIR_CHK)/%,$(objects))
78
79download :$(patsubst %,$(DIR_DL)/%,$(objects))
80
81md5 : $(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
bc9f0c12
MT
104ifeq "$(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
107endif
cd1a2927 108 cd $(DIR_SRC)/binutils-build && $(DIR_APP)/configure $(EXTRA_CONFIG)
e22c7973
MT
109ifeq "$(PASS)" "1"
110 cd $(DIR_SRC)/binutils-build && make configure-host
e22c7973 111endif
857d9bf2 112 cd $(DIR_SRC)/binutils-build && make $(EXTRA_MAKE) $(MAKETUNING)
cd1a2927 113 cd $(DIR_SRC)/binutils-build && make $(EXTRA_INSTALL) install
b4b6bcdb 114ifeq "$(ROOT)" ""
bc9f0c12 115ifneq "$(LFS_PASS)" "install"
f97be0a6 116 cp -v $(DIR_APP)/include/libiberty.h /usr/include
bc9f0c12 117endif
cd1a2927 118else
15679d9f 119ifeq "$(PASS)" "1"
dd714b8a 120 cd $(DIR_SRC)/binutils-build && make -C ld clean
dd714b8a 121 cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/tools/lib
90d372c4 122 cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin
dd714b8a 123else
90d372c4 124 cd $(DIR_SRC)/binutils-build && make -C ld clean
dd714b8a 125 cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/usr/lib:/lib
dd714b8a 126 cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin
90d372c4 127endif
cd1a2927
MT
128endif
129 @rm -rf $(DIR_APP) $(DIR_SRC)/binutils-build
130 @$(POSTBUILD)