]> git.ipfire.org Git - ipfire-2.x.git/blame - lfs/cleanup-toolchain
Naechster Schritt im LFS.
[ipfire-2.x.git] / lfs / cleanup-toolchain
CommitLineData
dd714b8a
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# #
21###############################################################################
22
23###############################################################################
24# Definitions
25###############################################################################
26
27include Config
28
15679d9f
MT
29VER = ipfire
30
dd714b8a 31THISAPP = cleanup-toolchain
9b0ff0a0 32TARGET = $(DIR_INFO)/$(THISAPP)-$(PASS)-tools
dd714b8a
MT
33
34###############################################################################
35# Top-level Rules
36###############################################################################
37
38objects =
39
40install : $(TARGET)
41
42check :
43
44download :
45
46md5 :
47
48###############################################################################
49# Installation Details
50###############################################################################
51
52$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
53 @$(PREBUILD)
9b0ff0a0
MT
54ifeq "$(PASS)" "1"
55 cp -v /tools/bin/{ld,ld-old.bak}
56 mv -v /tools/bin/{ld,ld-old}
57 cp -v /tools/i686-pc-linux-gnu/bin/{ld,ld-old.bak}
58 mv -v /tools/i686-pc-linux-gnu/bin/{ld,ld-old}
59 cp -v /tools/bin/{ld-new,ld}
60 ln -sv /tools/bin/ld /tools/i686-pc-linux-gnu/bin/ld
61 /tools/bin/gcc -dumpspecs > /tools/lib/gcc/i686-pc-linux-gnu/4.0.3/specs
62 sed 's@^/lib/ld-linux.so.2@/tools&@g' /tools/lib/gcc/i686-pc-linux-gnu/4.0.3/specs > tempspecfile
63 mv -vf tempspecfile /tools/lib/gcc/i686-pc-linux-gnu/4.0.3/specs
64 GCC_INCLUDEDIR=/tools/lib/gcc/i686-pc-linux-gnu/4.0.3/include
65 find /tools/lib/gcc/i686-pc-linux-gnu/4.0.3/include/* -maxdepth 0 -xtype d -exec rm -rvf '{}' \;
66 rm -vf `grep -l "DO NOT EDIT THIS FILE" /tools/lib/gcc/i686-pc-linux-gnu/4.0.3/include/*`
67endif
68ifeq "$(PASS)" "2"
69 ### I have to check if this really works
dd714b8a
MT
70 -strip --strip-debug /tools/lib/*
71 -strip --strip-unneeded /tools/{,s}bin/*
9b0ff0a0 72 rm -rfv /tools/{info,man} /usr/local/man
90d372c4 73 cp -fv /tools/bin/{ld-old.bak,ld}
dd714b8a 74 chown -R root:root /tools
9b0ff0a0
MT
75endif
76ifeq "$(PASS)" "3"
77 mv -v /tools/bin/{ld,ld-old}
78 mv -v /tools/i686-pc-linux-gnu/bin/{ld,ld-old}
79 mv -v /tools/bin/{ld-new,ld}
80 ln -sv /tools/bin/ld /tools/i686-pc-linux-gnu/bin/ld
81 gcc -dumpspecs | \
82 perl -p -e 's@/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2@g;' \
83 -e 's@\*startfile_prefix_spec:\n@$_/usr/lib/ @g;' > \
84 `dirname $(gcc --print-libgcc-file-name)`/specs
85endif
dd714b8a 86 @$(POSTBUILD)