]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - lfs/cleanup-toolchain
Add eject rootfile.
[people/pmueller/ipfire-2.x.git] / lfs / cleanup-toolchain
1 ###############################################################################
2 # #
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
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 = ipfire
28
29 THISAPP = cleanup-toolchain
30 TARGET = $(DIR_INFO)/$(THISAPP)-$(PASS)-tools
31
32 ###############################################################################
33 # Top-level Rules
34 ###############################################################################
35
36 objects =
37
38 install : $(TARGET)
39
40 check :
41
42 download :
43
44 md5 :
45
46 ###############################################################################
47 # Installation Details
48 ###############################################################################
49
50 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
51 @$(PREBUILD)
52 ifeq "$(PASS)" "1"
53 mv -v /tools/bin/{ld,ld-old}
54 mv -v /tools/i686-pc-linux-gnu/bin/{ld,ld-old}
55 cp -v /tools/bin/{ld-new,ld}
56 ln -sv /tools/bin/ld /tools/i686-pc-linux-gnu/bin/ld
57 gcc -dumpspecs > /tools/lib/gcc/i686-pc-linux-gnu/4.0.4/specs
58 sed 's@^/lib/ld-linux.so.2@/tools&@g' /tools/lib/gcc/i686-pc-linux-gnu/4.0.4/specs > tempspecfile
59 mv -vf tempspecfile /tools/lib/gcc/i686-pc-linux-gnu/4.0.4/specs
60 find /tools/lib/gcc/i686-pc-linux-gnu/4.0.4/include/* -maxdepth 0 -xtype d -exec rm -rvf '{}' \;
61 rm -vf `grep -l "DO NOT EDIT THIS FILE" /tools/lib/gcc/i686-pc-linux-gnu/4.0.4/include/*`
62 endif
63 ifeq "$(PASS)" "2"
64 -strip --strip-debug /tools/lib/*
65 -strip --strip-unneeded /tools/{,s}bin/*
66 rm -rfv /tools/{info,man} /usr/local/man
67 chown -R root:root /tools
68 endif
69 ifeq "$(PASS)" "3"
70 mv -v /tools/bin/{ld,ld-old}
71 mv -v /tools/i686-pc-linux-gnu/bin/{ld,ld-old}
72 mv -v /tools/bin/{ld-new,ld}
73 ln -sv /tools/bin/ld /tools/i686-pc-linux-gnu/bin/ld
74 gcc -dumpspecs | \
75 perl -p -e 's@/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2@g;' \
76 -e 's@\*startfile_prefix_spec:\n@$$_/usr/lib/ @g;' > \
77 /tools/lib/gcc/i686-pc-linux-gnu/4.0.4/specs
78 endif
79 @$(POSTBUILD)