]>
Commit | Line | Data |
---|---|---|
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 | ||
27 | include Config | |
28 | ||
29 | VER = 4.0.3 | |
30 | ||
31 | THISAPP = gcc-$(VER) | |
32 | DL_FILE = $(THISAPP).tar.bz2 | |
33 | DL_FROM = $(URL_IPFIRE) | |
34 | DIR_APP = $(DIR_SRC)/$(THISAPP) | |
35 | CFLAGS = | |
36 | CXXFLAGS = | |
37 | ||
38 | # Normal build or /tools build. | |
39 | # | |
40 | ifeq "$(ROOT)" "" | |
41 | TARGET = $(DIR_INFO)/$(THISAPP) | |
42 | EXTRA_CONFIG = --prefix=/usr \ | |
43 | --enable-shared --enable-threads=posix \ | |
44 | --enable-__cxa_atexit --enable-clocale=gnu \ | |
45 | --enable-languages=c,c++ --disable-nls | |
46 | EXTRA_MAKE = | |
47 | EXTRA_INSTALL = | |
48 | else | |
49 | ifeq "$(LFS_PASS)" "1" | |
50 | TARGET = $(DIR_INFO)/$(THISAPP)-tools1 | |
51 | EXTRA_CONFIG = --prefix=/tools \ | |
52 | --with-local-prefix=/tools --disable-nls --enable-shared \ | |
53 | --enable-languages=c | |
54 | EXTRA_MAKE = BOOT_LDFLAGS="-static" bootstrap | |
55 | EXTRA_INSTALL = | |
56 | else | |
57 | TARGET = $(DIR_INFO)/$(THISAPP)-tools2 | |
58 | EXTRA_CONFIG = --prefix=/tools \ | |
59 | --with-local-prefix=/tools --enable-clocale=gnu \ | |
60 | --enable-shared --enable-threads=posix \ | |
61 | --enable-__cxa_atexit --enable-languages=c,c++ \ | |
62 | --disable-libstdcxx-pch | |
63 | EXTRA_MAKE = | |
64 | EXTRA_INSTALL = | |
65 | endif | |
66 | endif | |
67 | ||
68 | ############################################################################### | |
69 | # Top-level Rules | |
70 | ############################################################################### | |
71 | objects = $(DL_FILE) | |
72 | ||
73 | $(DL_FILE) = $(DL_FROM)/$(DL_FILE) | |
74 | ||
75 | $(DL_FILE)_MD5 = 6ff1af12c53cbb3f79b27f2d6a9a3d50 | |
76 | ||
77 | install : $(TARGET) | |
78 | ||
79 | check : $(patsubst %,$(DIR_CHK)/%,$(objects)) | |
80 | ||
81 | download :$(patsubst %,$(DIR_DL)/%,$(objects)) | |
82 | ||
83 | md5 : $(subst %,%_MD5,$(objects)) | |
84 | ||
85 | ############################################################################### | |
86 | # Downloading, checking, md5sum | |
87 | ############################################################################### | |
88 | ||
89 | $(patsubst %,$(DIR_CHK)/%,$(objects)) : | |
90 | @$(CHECK) | |
91 | ||
92 | $(patsubst %,$(DIR_DL)/%,$(objects)) : | |
93 | @$(LOAD) | |
94 | ||
95 | $(subst %,%_MD5,$(objects)) : | |
96 | @$(MD5) | |
97 | ||
98 | ############################################################################### | |
99 | # Installation Details | |
100 | ############################################################################### | |
101 | ||
102 | $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) | |
103 | @$(PREBUILD) | |
104 | @rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE) | |
105 | @mkdir $(DIR_SRC)/gcc-build | |
106 | ifeq "$(ROOT)" "" | |
107 | ||
108 | else | |
109 | ifeq "$(LFS_PASS)" "1" | |
110 | cd $(DIR_SRC)/gcc-build && /bin/bash $(DIR_APP)/configure $(EXTRA_CONFIG) | |
111 | cd $(DIR_SRC)/gcc-build && make $(MAKETUNING) $(EXTRA_MAKE) | |
112 | cd $(DIR_SRC)/gcc-build && make $(EXTRA_INSTALL) install | |
113 | ln -vs gcc /tools/bin/cc | |
114 | else | |
115 | cd $(DIR_APP) && cp -v gcc/Makefile.in{,.orig} | |
116 | cd $(DIR_APP) && sed 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig > gcc/Makefile.in | |
117 | cd $(DIR_APP) && cp -v gcc/Makefile.in{,.tmp} | |
118 | #cd $(DIR_APP) && sed 's/^XCFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in.tmp > gcc/Makefile.in | |
119 | cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/gcc-4.0.3-specs-1.patch | |
120 | cd $(DIR_SRC)/gcc-build && /bin/bash $(DIR_APP)/configure $(EXTRA_CONFIG) | |
121 | cd $(DIR_SRC)/gcc-build && make $(MAKETUNING) $(EXTRA_MAKE) | |
122 | cd $(DIR_SRC)/gcc-build && make $(EXTRA_INSTALL) install | |
123 | endif | |
124 | endif | |
125 | @rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build | |
126 | @$(POSTBUILD) |