]>
Commit | Line | Data |
---|---|---|
dd714b8a | 1 | ############################################################################### |
dd714b8a | 2 | # # |
70df8302 MT |
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 # | |
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 | ||
25 | include Config | |
26 | ||
15679d9f MT |
27 | VER = ipfire |
28 | ||
dd714b8a | 29 | THISAPP = cleanup-toolchain |
9b0ff0a0 | 30 | TARGET = $(DIR_INFO)/$(THISAPP)-$(PASS)-tools |
dd714b8a | 31 | |
cc72d5cb | 32 | ifeq "$(MACHINE_TYPE)" "arm" |
51f9e7ac MT |
33 | GCC_VER = 4.1.2 |
34 | else | |
35 | GCC_VER = 4.0.4 | |
36 | endif | |
37 | ||
dd714b8a MT |
38 | ############################################################################### |
39 | # Top-level Rules | |
40 | ############################################################################### | |
41 | ||
42 | objects = | |
43 | ||
44 | install : $(TARGET) | |
45 | ||
46 | check : | |
47 | ||
48 | download : | |
49 | ||
50 | md5 : | |
51 | ||
52 | ############################################################################### | |
53 | # Installation Details | |
54 | ############################################################################### | |
55 | ||
56 | $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) | |
57 | @$(PREBUILD) | |
9b0ff0a0 | 58 | ifeq "$(PASS)" "1" |
9b0ff0a0 | 59 | mv -v /tools/bin/{ld,ld-old} |
51f9e7ac | 60 | mv -v /tools/$(BUILDTARGET)/bin/{ld,ld-old} |
9b0ff0a0 | 61 | cp -v /tools/bin/{ld-new,ld} |
51f9e7ac MT |
62 | ln -sv /tools/bin/ld /tools/$(BUILDTARGET)/bin/ld |
63 | gcc -dumpspecs > /tools/lib/gcc/$(BUILDTARGET)/$(GCC_VER)/specs | |
64 | sed 's@/lib/ld-linux.so@/tools&@g' /tools/lib/gcc/$(BUILDTARGET)/$(GCC_VER)/specs > tempspecfile | |
65 | mv -vf tempspecfile /tools/lib/gcc/$(BUILDTARGET)/$(GCC_VER)/specs | |
66 | find /tools/lib/gcc/$(BUILDTARGET)/$(GCC_VER)/include/* -maxdepth 0 -xtype d -exec rm -rvf '{}' \; | |
67 | rm -vf `grep -l "DO NOT EDIT THIS FILE" /tools/lib/gcc/$(BUILDTARGET)/$(GCC_VER)/include/*` | |
9b0ff0a0 MT |
68 | endif |
69 | ifeq "$(PASS)" "2" | |
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 |
dd714b8a | 73 | chown -R root:root /tools |
9b0ff0a0 MT |
74 | endif |
75 | ifeq "$(PASS)" "3" | |
76 | mv -v /tools/bin/{ld,ld-old} | |
51f9e7ac | 77 | mv -v /tools/$(BUILDTARGET)/bin/{ld,ld-old} |
9b0ff0a0 | 78 | mv -v /tools/bin/{ld-new,ld} |
51f9e7ac | 79 | ln -sv /tools/bin/ld /tools/$(BUILDTARGET)/bin/ld |
9b0ff0a0 | 80 | gcc -dumpspecs | \ |
51f9e7ac | 81 | perl -p -e 's@/tools/lib/ld-linux.so@/lib/ld-linux.so@g;' \ |
857d9bf2 | 82 | -e 's@\*startfile_prefix_spec:\n@$$_/usr/lib/ @g;' > \ |
51f9e7ac | 83 | /tools/lib/gcc/$(BUILDTARGET)/$(GCC_VER)/specs |
9b0ff0a0 | 84 | endif |
dd714b8a | 85 | @$(POSTBUILD) |