]> git.ipfire.org Git - ipfire-2.x.git/blame - lfs/cleanup-toolchain
libnet: Keep the version number in source tarball filename
[ipfire-2.x.git] / lfs / cleanup-toolchain
CommitLineData
dd714b8a 1###############################################################################
dd714b8a 2# #
70df8302 3# IPFire.org - A linux based firewall #
3f8c9dc5 4# Copyright (C) 2007-2011 IPFire Team <info@ipfire.org> #
70df8302
MT
5# #
6# This program is free software: you can redistribute it and/or modify #
dd714b8a 7# it under the terms of the GNU General Public License as published by #
70df8302 8# the Free Software Foundation, either version 3 of the License, or #
dd714b8a
MT
9# (at your option) any later version. #
10# #
70df8302 11# This program is distributed in the hope that it will be useful, #
dd714b8a
MT
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 #
70df8302 17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
dd714b8a
MT
18# #
19###############################################################################
20
21###############################################################################
22# Definitions
23###############################################################################
24
25include Config
26
15679d9f
MT
27VER = ipfire
28
dd714b8a 29THISAPP = cleanup-toolchain
9b0ff0a0 30TARGET = $(DIR_INFO)/$(THISAPP)-$(PASS)-tools
dd714b8a 31
7b321c2c 32GCC_VER = 4.1.2
51f9e7ac 33
dd714b8a
MT
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 54ifeq "$(PASS)" "1"
fa22f927
MT
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
9b0ff0a0 59endif
025b7ad5 60
9b0ff0a0 61ifeq "$(PASS)" "2"
025b7ad5
MT
62 # Remove the first cross compiler which is not needed anymore.
63 find /tools/ -name "$(CROSSTARGET)*" | xargs rm -rfv
64
fc44fa1f
MT
65 # Remove man and info pages.
66 rm -rfv /tools/{,share}/{info,man}
67
68 # Strip all binaries.
69 STRIP="/usr/bin/strip" $(DIR_SRC)/src/stripper /tools/
70
71 # Fix ownership of the toolchain.
72 chown -R root:root /tools/
f5ad8f59
MT
73
74 # Update/create linker cache.
75 /tools/sbin/ldconfig
9b0ff0a0 76endif
fc44fa1f 77
9b0ff0a0
MT
78ifeq "$(PASS)" "3"
79 mv -v /tools/bin/{ld,ld-old}
51f9e7ac 80 mv -v /tools/$(BUILDTARGET)/bin/{ld,ld-old}
9b0ff0a0 81 mv -v /tools/bin/{ld-new,ld}
51f9e7ac 82 ln -sv /tools/bin/ld /tools/$(BUILDTARGET)/bin/ld
fc44fa1f
MT
83
84 gcc -dumpspecs | sed \
85 -e 's@/tools@@g' \
86 -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
87 -e '/\*cpp:/{n;s@$$@ -isystem /usr/include@}' > \
88 $$(dirname $$(gcc -print-libgcc-file-name))/specs
9b0ff0a0 89endif
dd714b8a 90 @$(POSTBUILD)