1 ###############################################################################
3 # IPFire.org - A linux based firewall #
4 # Copyright (C) 2007-2011 IPFire Team <info@ipfire.org> #
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. #
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. #
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/>. #
19 ###############################################################################
21 ###############################################################################
23 ###############################################################################
29 THISAPP = cleanup-toolchain
30 TARGET = $(DIR_INFO)/$(THISAPP)-$(PASS)-tools
34 ###############################################################################
36 ###############################################################################
48 ###############################################################################
49 # Installation Details
50 ###############################################################################
52 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
55 SPECS=$$(dirname $$(/tools/bin/$(CROSSTARGET)-gcc -print-libgcc-file-name))/specs; \
56 /tools/bin/$(CROSSTARGET)-gcc -dumpspecs | sed \
57 -e 's@/lib\(64\)\?/ld@/tools&@g' \
58 -e "/^\*cpp:$$/{n;s,$$, -isystem /tools/include,}" > $$SPECS
61 -strip --strip-debug /tools/lib/*
62 -strip --strip-unneeded /tools/{,s}bin/*
63 rm -rfv /tools/{,share}/{info,man} /usr/local/man
64 chown -R root:root /tools
67 mv -v /tools/bin/{ld,ld-old}
68 mv -v /tools/$(BUILDTARGET)/bin/{ld,ld-old}
69 mv -v /tools/bin/{ld-new,ld}
70 ln -sv /tools/bin/ld /tools/$(BUILDTARGET)/bin/ld
72 perl -p -e 's@/tools/lib/ld-linux.so@/lib/ld-linux.so@g;' \
73 -e 's@\*startfile_prefix_spec:\n@$$_/usr/lib/ @g;' > \
74 /tools/lib/gcc/$(BUILDTARGET)/$(GCC_VER)/specs