Commit | Line | Data |
---|---|---|
52d7cdee | 1 | [+ AutoGen5 template -*- Mode: Makefile -*- |
405ea7a0 NN |
2 | in |
3 | +] | |
4 | ||
5 | # Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'. | |
6 | # | |
7 | # Makefile for directory with subdirs to build. | |
8 | # Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, | |
378fce5b | 9 | # 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation |
405ea7a0 NN |
10 | # |
11 | # This file is free software; you can redistribute it and/or modify | |
12 | # it under the terms of the GNU General Public License as published by | |
13 | # the Free Software Foundation; either version 2 of the License, or | |
14 | # (at your option) any later version. | |
15 | # | |
16 | # This program is distributed in the hope that it will be useful, | |
17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | # GNU General Public License for more details. | |
20 | # | |
21 | # You should have received a copy of the GNU General Public License | |
22 | # along with this program; if not, write to the Free Software | |
23 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
24 | # | |
25 | ||
50212802 NN |
26 | # ------------------------------- |
27 | # Standard Autoconf-set variables | |
28 | # ------------------------------- | |
583d52d7 | 29 | VPATH=@srcdir@ |
583d52d7 NN |
30 | |
31 | build_alias=@build_alias@ | |
7f121bbf | 32 | build=@build@ |
583d52d7 | 33 | host_alias=@host_alias@ |
7f121bbf | 34 | host=@host@ |
583d52d7 | 35 | target_alias=@target_alias@ |
7f121bbf | 36 | target=@target@ |
583d52d7 | 37 | |
50212802 | 38 | program_transform_name = @program_transform_name@ |
c66d951e NN |
39 | |
40 | prefix = @prefix@ | |
41 | exec_prefix = @exec_prefix@ | |
42 | ||
50212802 NN |
43 | srcdir = @srcdir@ |
44 | ||
c66d951e NN |
45 | bindir = @bindir@ |
46 | sbindir = @sbindir@ | |
47 | libexecdir = @libexecdir@ | |
48 | datadir = @datadir@ | |
49 | sysconfdir = @sysconfdir@ | |
50 | sharedstatedir = @sharedstatedir@ | |
51 | localstatedir = @localstatedir@ | |
52 | libdir = @libdir@ | |
53 | includedir = @includedir@ | |
54 | oldincludedir = @oldincludedir@ | |
55 | infodir = @infodir@ | |
56 | mandir = @mandir@ | |
405ea7a0 NN |
57 | man1dir = $(mandir)/man1 |
58 | man2dir = $(mandir)/man2 | |
59 | man3dir = $(mandir)/man3 | |
60 | man4dir = $(mandir)/man4 | |
61 | man5dir = $(mandir)/man5 | |
62 | man6dir = $(mandir)/man6 | |
63 | man7dir = $(mandir)/man7 | |
64 | man8dir = $(mandir)/man8 | |
65 | man9dir = $(mandir)/man9 | |
405ea7a0 | 66 | |
e5c3f801 NN |
67 | INSTALL = @INSTALL@ |
68 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
69 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | |
70 | INSTALL_DATA = @INSTALL_DATA@ | |
656fdd47 PB |
71 | LN = @LN@ |
72 | LN_S = @LN_S@ | |
405ea7a0 | 73 | |
50212802 NN |
74 | # ------------------------------------------------- |
75 | # Miscellaneous non-standard autoconf-set variables | |
76 | # ------------------------------------------------- | |
405ea7a0 | 77 | |
50212802 NN |
78 | # The file containing GCC's version number. |
79 | gcc_version_trigger = @gcc_version_trigger@ | |
80 | gcc_version = @gcc_version@ | |
405ea7a0 | 81 | |
50212802 NN |
82 | # The gcc driver likes to know the arguments it was configured with. |
83 | TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@ | |
405ea7a0 | 84 | |
50212802 NN |
85 | gxx_include_dir = @gxx_include_dir@ |
86 | libstdcxx_incdir = @libstdcxx_incdir@ | |
405ea7a0 | 87 | |
50212802 NN |
88 | tooldir = @tooldir@ |
89 | build_tooldir = @build_tooldir@ | |
405ea7a0 | 90 | |
50212802 | 91 | # Directory in which the compiler finds executables, libraries, etc. |
ede4fbe4 | 92 | libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version) |
50212802 | 93 | GDB_NLM_DEPS = |
405ea7a0 | 94 | |
50212802 NN |
95 | # This is the name of the environment variable used for the path to |
96 | # the libraries. | |
97 | RPATH_ENVVAR = @RPATH_ENVVAR@ | |
405ea7a0 | 98 | |
50212802 NN |
99 | # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared |
100 | # was used. | |
101 | SET_LIB_PATH = @SET_LIB_PATH@ | |
405ea7a0 | 102 | |
50212802 NN |
103 | # configure.in sets SET_LIB_PATH to this if --enable-shared was used. |
104 | # Some platforms don't like blank entries, so we remove duplicate, | |
105 | # leading and trailing colons. | |
106 | REALLY_SET_LIB_PATH = \ | |
107 | $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); | |
405ea7a0 | 108 | |
50212802 | 109 | # This is the list of directories to be built for the build system. |
4b1cb4fe | 110 | BUILD_CONFIGDIRS = libiberty libbanshee |
50212802 NN |
111 | # Build programs are put under this directory. |
112 | BUILD_SUBDIR = @build_subdir@ | |
113 | # This is set by the configure script to the arguments to use when configuring | |
114 | # directories built for the build system. | |
115 | BUILD_CONFIGARGS = @build_configargs@ | |
378fce5b DD |
116 | # This is the list of variables to export in the environment when |
117 | # configuring subdirectories for the build system. It must also be | |
118 | # exported whenever recursing into a build directory in case that | |
119 | # directory's Makefile re-runs configure. | |
120 | BUILD_EXPORTS = \ | |
121 | AR="$(AR_FOR_BUILD)"; export AR; \ | |
122 | AS="$(AS_FOR_BUILD)"; export AS; \ | |
123 | CC="$(CC_FOR_BUILD)"; export CC; \ | |
124 | CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ | |
125 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | |
126 | CXX="$(CXX_FOR_BUILD)"; export CXX; \ | |
127 | CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ | |
128 | GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \ | |
129 | GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \ | |
130 | DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \ | |
131 | LD="$(LD_FOR_BUILD)"; export LD; \ | |
132 | LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \ | |
133 | NM="$(NM_FOR_BUILD)"; export NM; \ | |
134 | RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \ | |
135 | WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; | |
50212802 NN |
136 | |
137 | # This is the list of directories to built for the host system. | |
138 | SUBDIRS = @configdirs@ | |
139 | # This is set by the configure script to the arguments to use when configuring | |
140 | # directories built for the host system. | |
141 | HOST_CONFIGARGS = @host_configargs@ | |
378fce5b DD |
142 | # This is the list of variables to export in the environment when |
143 | # configuring subdirectories for the host system. It must also be | |
144 | # exported whenever recursing into a host directory in case that | |
145 | # directory's Makefile re-runs configure. | |
146 | HOST_EXPORTS = \ | |
147 | CC="$(CC)"; export CC; \ | |
148 | CFLAGS="$(CFLAGS)"; export CFLAGS; \ | |
149 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | |
150 | CXX="$(CXX)"; export CXX; \ | |
151 | CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ | |
152 | AR="$(AR)"; export AR; \ | |
153 | AS="$(AS)"; export AS; \ | |
154 | CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ | |
155 | DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ | |
156 | LD="$(LD)"; export LD; \ | |
157 | LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ | |
158 | NM="$(NM)"; export NM; \ | |
159 | RANLIB="$(RANLIB)"; export RANLIB; \ | |
160 | WINDRES="$(WINDRES)"; export WINDRES; \ | |
161 | OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ | |
162 | OBJDUMP="$(OBJDUMP)"; export OBJDUMP; | |
163 | ||
164 | # Similar, for the gcc directory. | |
165 | GCC_HOST_EXPORTS = \ | |
166 | $(HOST_EXPORTS) \ | |
167 | TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \ | |
168 | GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \ | |
169 | GMPINC="$(HOST_GMPINC)"; export GMPINC; | |
170 | ||
171 | # Similar, for later GCC stages. | |
172 | STAGE_HOST_EXPORTS = \ | |
173 | $(GCC_HOST_EXPORTS) \ | |
174 | CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \ | |
175 | CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC_FOR_BUILD; | |
50212802 NN |
176 | |
177 | # This is set by the configure script to the list of directories which | |
178 | # should be built using the target tools. | |
179 | TARGET_CONFIGDIRS = @target_configdirs@ | |
180 | # Target libraries are put under this directory: | |
181 | TARGET_SUBDIR = @target_subdir@ | |
182 | # This is set by the configure script to the arguments to use when configuring | |
183 | # directories built for the target. | |
184 | TARGET_CONFIGARGS = @target_configargs@ | |
378fce5b DD |
185 | # This is the list of variables to export in the environment when |
186 | # configuring subdirectories for the host system. It must also be | |
187 | # exported whenever recursing into a host directory in case that | |
188 | # directory's Makefile re-runs configure. | |
189 | BASE_TARGET_EXPORTS = \ | |
190 | AR="$(AR_FOR_TARGET)"; export AR; \ | |
191 | AS="$(AS_FOR_TARGET)"; export AS; \ | |
192 | CC="$(CC_FOR_TARGET)"; export CC; \ | |
193 | CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ | |
194 | CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ | |
195 | CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ | |
196 | CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ | |
197 | GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ | |
198 | GFORTRAN="$(GFORTRAN_FOR_TARGET)"; export GFORTRAN; \ | |
199 | DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ | |
200 | LD="$(LD_FOR_TARGET)"; export LD; \ | |
201 | LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ | |
202 | NM="$(NM_FOR_TARGET)"; export NM; \ | |
203 | RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ | |
204 | WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; | |
205 | ||
206 | RAW_CXX_TARGET_EXPORTS = \ | |
207 | $(BASE_TARGET_EXPORTS) \ | |
208 | CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ | |
209 | CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; | |
210 | ||
211 | NORMAL_TARGET_EXPORTS = \ | |
212 | $(BASE_TARGET_EXPORTS) \ | |
213 | CXX="$(CXX_FOR_TARGET)"; export CXX; | |
50212802 | 214 | |
4b1cb4fe DD |
215 | # Where to find GMP |
216 | HOST_GMPLIBS = @gmplibs@ | |
217 | HOST_GMPINC = @gmpinc@ | |
218 | ||
50212802 NN |
219 | # ---------------------------------------------- |
220 | # Programs producing files for the BUILD machine | |
221 | # ---------------------------------------------- | |
222 | ||
223 | SHELL = @config_shell@ | |
224 | ||
225 | # pwd command to use. Allow user to override default by setting PWDCMD in | |
226 | # the environment to account for automounters. The make variable must not | |
227 | # be called PWDCMD, otherwise the value set here is passed to make | |
228 | # subprocesses and overrides the setting from the user's environment. | |
b40e3958 L |
229 | # Don't use PWD since it is a common shell environment variable and we |
230 | # don't want to corrupt it. | |
231 | PWD_COMMAND = $${PWDCMD-pwd} | |
50212802 NN |
232 | |
233 | # compilers to use to create programs which must be run in the build | |
234 | # environment. | |
235 | CC_FOR_BUILD = @CC_FOR_BUILD@ | |
5fbad20a | 236 | CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ |
50212802 NN |
237 | |
238 | CXX_FOR_BUILD = $(CXX) | |
239 | ||
240 | # Special variables passed down in EXTRA_GCC_FLAGS. They are defined | |
241 | # here so that they can be overridden by Makefile fragments. | |
50212802 NN |
242 | BUILD_PREFIX = @BUILD_PREFIX@ |
243 | BUILD_PREFIX_1 = @BUILD_PREFIX_1@ | |
405ea7a0 | 244 | |
852e5f18 NN |
245 | BISON=@BISON@ |
246 | USUAL_BISON = `if [ -f $$r/bison/bison ] ; then \ | |
405ea7a0 NN |
247 | echo $$r/bison/bison -L $$s/bison/ ; \ |
248 | else \ | |
249 | echo bison ; \ | |
250 | fi` | |
251 | ||
50212802 | 252 | DEFAULT_YACC = @DEFAULT_YACC@ |
852e5f18 NN |
253 | YACC=@YACC@ |
254 | USUAL_YACC = `if [ -f $$r/bison/bison ] ; then \ | |
405ea7a0 NN |
255 | echo $$r/bison/bison -y -L $$s/bison/ ; \ |
256 | elif [ -f $$r/byacc/byacc ] ; then \ | |
257 | echo $$r/byacc/byacc ; \ | |
258 | else \ | |
259 | echo ${DEFAULT_YACC} ; \ | |
260 | fi` | |
261 | ||
50212802 | 262 | DEFAULT_LEX = @DEFAULT_LEX@ |
852e5f18 NN |
263 | LEX=@LEX@ |
264 | USUAL_LEX = `if [ -f $$r/flex/flex ] ; \ | |
405ea7a0 NN |
265 | then echo $$r/flex/flex ; \ |
266 | else echo ${DEFAULT_LEX} ; fi` | |
267 | ||
50212802 | 268 | DEFAULT_M4 = @DEFAULT_M4@ |
405ea7a0 NN |
269 | M4 = `if [ -f $$r/m4/m4 ] ; \ |
270 | then echo $$r/m4/m4 ; \ | |
271 | else echo ${DEFAULT_M4} ; fi` | |
272 | ||
77f7441a | 273 | # For an installed makeinfo, we require it to be from texinfo 4.2 or |
405ea7a0 | 274 | # higher, else we use the "missing" dummy. |
852e5f18 NN |
275 | MAKEINFO=@MAKEINFO@ |
276 | USUAL_MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \ | |
405ea7a0 NN |
277 | then echo $$r/texinfo/makeinfo/makeinfo ; \ |
278 | else if (makeinfo --version \ | |
77f7441a | 279 | | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])') >/dev/null 2>&1; \ |
405ea7a0 NN |
280 | then echo makeinfo; else echo $$s/missing makeinfo; fi; fi` |
281 | ||
282 | # This just becomes part of the MAKEINFO definition passed down to | |
283 | # sub-makes. It lets flags be given on the command line while still | |
284 | # using the makeinfo from the object tree. | |
62a3fc85 DD |
285 | # (Default to avoid splitting info files by setting the threshold high.) |
286 | MAKEINFOFLAGS = --split-size=5000000 | |
405ea7a0 NN |
287 | |
288 | EXPECT = `if [ -f $$r/expect/expect ] ; \ | |
289 | then echo $$r/expect/expect ; \ | |
290 | else echo expect ; fi` | |
291 | ||
292 | RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \ | |
293 | then echo $$s/dejagnu/runtest ; \ | |
294 | else echo runtest ; fi` | |
295 | ||
50212802 NN |
296 | # --------------------------------------------- |
297 | # Programs producing files for the HOST machine | |
298 | # --------------------------------------------- | |
405ea7a0 | 299 | |
50212802 NN |
300 | # This is the list of directories that may be needed in RPATH_ENVVAR |
301 | # so that programs built for the host machine work. | |
302 | HOST_LIB_PATH = $$r/bfd:$$r/opcodes | |
405ea7a0 | 303 | |
50212802 | 304 | AS = @AS@ |
405ea7a0 | 305 | |
50212802 NN |
306 | AR = @AR@ |
307 | AR_FLAGS = rc | |
405ea7a0 | 308 | |
50212802 NN |
309 | CC = @CC@ |
310 | CFLAGS = @CFLAGS@ | |
311 | LIBCFLAGS = $(CFLAGS) | |
405ea7a0 | 312 | |
50212802 NN |
313 | CXX = @CXX@ |
314 | CXXFLAGS = @CXXFLAGS@ | |
315 | LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates | |
405ea7a0 | 316 | |
50212802 | 317 | DLLTOOL = @DLLTOOL@ |
405ea7a0 | 318 | |
50212802 | 319 | NM = @NM@ |
15723a45 | 320 | |
50212802 NN |
321 | LD = @LD@ |
322 | LDFLAGS = | |
15723a45 | 323 | |
50212802 | 324 | RANLIB = @RANLIB@ |
405ea7a0 | 325 | |
50212802 | 326 | WINDRES = @WINDRES@ |
405ea7a0 | 327 | |
50212802 NN |
328 | PICFLAG = |
329 | ||
330 | # ----------------------------------------------- | |
331 | # Programs producing files for the TARGET machine | |
332 | # ----------------------------------------------- | |
405ea7a0 NN |
333 | |
334 | # This is the list of directories that may be needed in RPATH_ENVVAR | |
335 | # so that prorgams built for the target machine work. | |
4b1cb4fe | 336 | TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:$$r/$(TARGET_SUBDIR)/libmudflap/.libs |
405ea7a0 | 337 | |
58daee98 | 338 | FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@ |
405ea7a0 | 339 | |
50212802 | 340 | AR_FOR_TARGET=@AR_FOR_TARGET@ |
54752a6b | 341 | CONFIGURED_AR_FOR_TARGET=@CONFIGURED_AR_FOR_TARGET@ |
50212802 NN |
342 | USUAL_AR_FOR_TARGET = ` \ |
343 | if [ -f $$r/binutils/ar ] ; then \ | |
344 | echo $$r/binutils/ar ; \ | |
345 | else \ | |
7f121bbf | 346 | if [ '$(host)' = '$(target)' ] ; then \ |
50212802 NN |
347 | echo $(AR); \ |
348 | else \ | |
54752a6b | 349 | echo $(CONFIGURED_AR_FOR_TARGET) ; \ |
50212802 NN |
350 | fi; \ |
351 | fi` | |
405ea7a0 | 352 | |
852e5f18 | 353 | AS_FOR_TARGET=@AS_FOR_TARGET@ |
54752a6b | 354 | CONFIGURED_AS_FOR_TARGET=@CONFIGURED_AS_FOR_TARGET@ |
852e5f18 | 355 | USUAL_AS_FOR_TARGET = ` \ |
405ea7a0 NN |
356 | if [ -f $$r/gas/as-new ] ; then \ |
357 | echo $$r/gas/as-new ; \ | |
358 | elif [ -f $$r/gcc/xgcc ]; then \ | |
359 | $(CC_FOR_TARGET) -print-prog-name=as ; \ | |
360 | else \ | |
7f121bbf | 361 | if [ '$(host)' = '$(target)' ] ; then \ |
405ea7a0 NN |
362 | echo $(AS); \ |
363 | else \ | |
54752a6b | 364 | echo $(CONFIGURED_AS_FOR_TARGET) ; \ |
405ea7a0 NN |
365 | fi; \ |
366 | fi` | |
367 | ||
50212802 NN |
368 | CC_FOR_TARGET = @CC_FOR_TARGET@ |
369 | # During gcc bootstrap, if we use some random cc for stage1 then | |
370 | # CFLAGS will be just -g. We want to ensure that TARGET libraries | |
371 | # (which we know are built with gcc) are built with optimizations so | |
372 | # prepend -O2 when setting CFLAGS_FOR_TARGET. | |
373 | CFLAGS_FOR_TARGET = -O2 $(CFLAGS) | |
374 | # If GCC_FOR_TARGET is not overriden on the command line, then this | |
375 | # variable is passed down to the gcc Makefile, where it is used to | |
376 | # build libgcc2.a. We define it here so that it can itself be | |
377 | # overridden on the command line. | |
378 | GCC_FOR_TARGET=@GCC_FOR_TARGET@ | |
379 | USUAL_GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET) | |
380 | LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) | |
381 | ||
382 | CXX_FOR_TARGET = @CXX_FOR_TARGET@ | |
383 | RAW_CXX_FOR_TARGET = @RAW_CXX_FOR_TARGET@ | |
384 | CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@ | |
385 | RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@ | |
386 | CXXFLAGS_FOR_TARGET = $(CXXFLAGS) | |
387 | LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates | |
405ea7a0 | 388 | |
852e5f18 | 389 | DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@ |
54752a6b | 390 | CONFIGURED_DLLTOOL_FOR_TARGET=@CONFIGURED_DLLTOOL_FOR_TARGET@ |
852e5f18 | 391 | USUAL_DLLTOOL_FOR_TARGET = ` \ |
405ea7a0 NN |
392 | if [ -f $$r/binutils/dlltool ] ; then \ |
393 | echo $$r/binutils/dlltool ; \ | |
394 | else \ | |
7f121bbf | 395 | if [ '$(host)' = '$(target)' ] ; then \ |
405ea7a0 NN |
396 | echo $(DLLTOOL); \ |
397 | else \ | |
54752a6b | 398 | echo $(CONFIGURED_DLLTOOL_FOR_TARGET) ; \ |
405ea7a0 NN |
399 | fi; \ |
400 | fi` | |
401 | ||
50212802 | 402 | GCJ_FOR_TARGET = @GCJ_FOR_TARGET@ |
4b1cb4fe | 403 | GFORTRAN_FOR_TARGET = @GFORTRAN_FOR_TARGET@ |
50212802 NN |
404 | |
405 | LD_FOR_TARGET=@LD_FOR_TARGET@ | |
54752a6b | 406 | CONFIGURED_LD_FOR_TARGET=@CONFIGURED_LD_FOR_TARGET@ |
50212802 NN |
407 | USUAL_LD_FOR_TARGET = ` \ |
408 | if [ -f $$r/ld/ld-new ] ; then \ | |
409 | echo $$r/ld/ld-new ; \ | |
410 | elif [ -f $$r/gcc/xgcc ]; then \ | |
411 | $(CC_FOR_TARGET) -print-prog-name=ld ; \ | |
405ea7a0 | 412 | else \ |
7f121bbf | 413 | if [ '$(host)' = '$(target)' ] ; then \ |
50212802 | 414 | echo $(LD); \ |
405ea7a0 | 415 | else \ |
54752a6b | 416 | echo $(CONFIGURED_LD_FOR_TARGET) ; \ |
405ea7a0 NN |
417 | fi; \ |
418 | fi` | |
419 | ||
50212802 NN |
420 | LDFLAGS_FOR_TARGET = |
421 | ||
422 | NM_FOR_TARGET=@NM_FOR_TARGET@ | |
54752a6b | 423 | CONFIGURED_NM_FOR_TARGET=@CONFIGURED_NM_FOR_TARGET@ |
50212802 NN |
424 | USUAL_NM_FOR_TARGET = ` \ |
425 | if [ -f $$r/binutils/nm-new ] ; then \ | |
426 | echo $$r/binutils/nm-new ; \ | |
427 | elif [ -f $$r/gcc/xgcc ]; then \ | |
428 | $(CC_FOR_TARGET) -print-prog-name=nm ; \ | |
405ea7a0 | 429 | else \ |
7f121bbf | 430 | if [ '$(host)' = '$(target)' ] ; then \ |
50212802 | 431 | echo $(NM); \ |
405ea7a0 | 432 | else \ |
54752a6b | 433 | echo $(CONFIGURED_NM_FOR_TARGET) ; \ |
405ea7a0 NN |
434 | fi; \ |
435 | fi` | |
436 | ||
852e5f18 | 437 | RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@ |
54752a6b | 438 | CONFIGURED_RANLIB_FOR_TARGET=@CONFIGURED_RANLIB_FOR_TARGET@ |
852e5f18 | 439 | USUAL_RANLIB_FOR_TARGET = ` \ |
405ea7a0 NN |
440 | if [ -f $$r/binutils/ranlib ] ; then \ |
441 | echo $$r/binutils/ranlib ; \ | |
442 | else \ | |
7f121bbf | 443 | if [ '$(host)' = '$(target)' ] ; then \ |
405ea7a0 NN |
444 | if [ x'$(RANLIB)' != x ]; then \ |
445 | echo $(RANLIB); \ | |
446 | else \ | |
447 | echo ranlib; \ | |
448 | fi; \ | |
449 | else \ | |
54752a6b | 450 | echo $(CONFIGURED_RANLIB_FOR_TARGET) ; \ |
405ea7a0 NN |
451 | fi; \ |
452 | fi` | |
453 | ||
50212802 | 454 | WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@ |
54752a6b | 455 | CONFIGURED_WINDRES_FOR_TARGET=@CONFIGURED_WINDRES_FOR_TARGET@ |
50212802 NN |
456 | USUAL_WINDRES_FOR_TARGET = ` \ |
457 | if [ -f $$r/binutils/windres ] ; then \ | |
458 | echo $$r/binutils/windres ; \ | |
405ea7a0 | 459 | else \ |
7f121bbf | 460 | if [ '$(host)' = '$(target)' ] ; then \ |
50212802 | 461 | echo $(WINDRES); \ |
405ea7a0 | 462 | else \ |
54752a6b | 463 | echo $(CONFIGURED_WINDRES_FOR_TARGET) ; \ |
405ea7a0 NN |
464 | fi; \ |
465 | fi` | |
466 | ||
50212802 NN |
467 | PICFLAG_FOR_TARGET = |
468 | ||
469 | # ------------------------------------ | |
470 | # Miscellaneous targets and flag lists | |
471 | # ------------------------------------ | |
472 | ||
405ea7a0 NN |
473 | # The first rule in the file had better be this one. Don't put any above it. |
474 | # This lives here to allow makefile fragments to contain dependencies. | |
319cab08 | 475 | @default_target@: |
405ea7a0 | 476 | |
405ea7a0 | 477 | #### host and target specific makefile fragments come in here. |
a0da8069 NN |
478 | @target_makefile_frag@ |
479 | @alphaieee_frag@ | |
480 | @ospace_frag@ | |
481 | @host_makefile_frag@ | |
405ea7a0 NN |
482 | ### |
483 | ||
484 | # Flags to pass down to all sub-makes. | |
12f0bd74 NN |
485 | BASE_FLAGS_TO_PASS = [+ FOR flags_to_pass +]\ |
486 | "[+flag+]=$([+flag+])" [+ ENDFOR flags_to_pass +]\ | |
10ecffb9 | 487 | "CONFIG_SHELL=$(SHELL)" \ |
12f0bd74 | 488 | "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" |
405ea7a0 NN |
489 | |
490 | # For any flags above that may contain shell code that varies from one | |
491 | # target library to another. When doing recursive invocations of the | |
492 | # top-level Makefile, we don't want the outer make to evaluate them, | |
493 | # so we pass these variables down unchanged. They must not contain | |
494 | # single nor double quotes. | |
495 | RECURSE_FLAGS = \ | |
930314a4 NN |
496 | CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \ |
497 | RAW_CXX_FOR_TARGET='$(RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \ | |
405ea7a0 | 498 | |
656fdd47 PB |
499 | RECURSE_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) |
500 | ||
405ea7a0 NN |
501 | # Flags to pass down to most sub-makes, in which we're building with |
502 | # the host environment. | |
405ea7a0 NN |
503 | EXTRA_HOST_FLAGS = \ |
504 | 'AR=$(AR)' \ | |
505 | 'AS=$(AS)' \ | |
506 | 'CC=$(CC)' \ | |
507 | 'CXX=$(CXX)' \ | |
508 | 'DLLTOOL=$(DLLTOOL)' \ | |
509 | 'LD=$(LD)' \ | |
510 | 'NM=$(NM)' \ | |
b9459e83 | 511 | 'RANLIB=$(RANLIB)' \ |
405ea7a0 NN |
512 | 'WINDRES=$(WINDRES)' |
513 | ||
514 | FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) | |
515 | ||
516 | # Flags that are concerned with the location of the X11 include files | |
517 | # and library files | |
518 | # | |
519 | # NOTE: until the top-level is getting the values via autoconf, it only | |
520 | # causes problems to have this top-level Makefile overriding the autoconf-set | |
521 | # values in child directories. Only variables that don't conflict with | |
522 | # autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now. | |
523 | # | |
524 | X11_FLAGS_TO_PASS = \ | |
525 | 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \ | |
526 | 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)' | |
527 | ||
528 | # Flags to pass down to makes which are built with the target environment. | |
529 | # The double $ decreases the length of the command line; the variables | |
530 | # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. | |
405ea7a0 NN |
531 | EXTRA_TARGET_FLAGS = \ |
532 | 'AR=$$(AR_FOR_TARGET)' \ | |
533 | 'AS=$$(AS_FOR_TARGET)' \ | |
534 | 'CC=$$(CC_FOR_TARGET)' \ | |
535 | 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \ | |
536 | 'CXX=$$(CXX_FOR_TARGET)' \ | |
537 | 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \ | |
538 | 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \ | |
539 | 'LD=$$(LD_FOR_TARGET)' \ | |
540 | 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \ | |
541 | 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \ | |
542 | 'NM=$$(NM_FOR_TARGET)' \ | |
543 | 'RANLIB=$$(RANLIB_FOR_TARGET)' \ | |
544 | 'WINDRES=$$(WINDRES_FOR_TARGET)' | |
545 | ||
546 | TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) | |
547 | ||
548 | # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it | |
549 | # unfortunately needs the native compiler and the target ar and | |
550 | # ranlib. | |
551 | # If any variables are added here, they must be added to do-*, below. | |
2a4cbe27 | 552 | # The BUILD_* variables are a special case, which are used for the gcc |
405ea7a0 NN |
553 | # cross-building scheme. |
554 | EXTRA_GCC_FLAGS = \ | |
405ea7a0 NN |
555 | 'BUILD_PREFIX=$(BUILD_PREFIX)' \ |
556 | 'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \ | |
405ea7a0 NN |
557 | "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \ |
558 | "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ | |
3dee29da NN |
559 | "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \ |
560 | "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \ | |
561 | "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \ | |
562 | "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \ | |
563 | "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \ | |
564 | "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \ | |
565 | "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \ | |
566 | "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \ | |
567 | "`echo 'BOOT_ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" | |
405ea7a0 | 568 | |
f0b24077 | 569 | GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS) |
405ea7a0 | 570 | |
dd12c3a8 NN |
571 | .PHONY: configure-host |
572 | configure-host: maybe-configure-gcc [+ | |
573 | FOR host_modules +] \ | |
574 | maybe-configure-[+module+][+ | |
575 | ENDFOR host_modules +] | |
576 | .PHONY: configure-target | |
577 | configure-target: [+ | |
578 | FOR target_modules +] \ | |
579 | maybe-configure-target-[+module+][+ | |
580 | ENDFOR target_modules +] | |
405ea7a0 | 581 | |
319cab08 PB |
582 | # The target built for a native non-bootstrap build. |
583 | .PHONY: all | |
584 | all: @all_build_modules@ all-host all-target | |
dd12c3a8 NN |
585 | |
586 | .PHONY: all-host | |
587 | all-host: maybe-all-gcc [+ | |
588 | FOR host_modules +] \ | |
589 | maybe-all-[+module+][+ | |
590 | ENDFOR host_modules +] | |
591 | .PHONY: all-target | |
592 | all-target: [+ | |
593 | FOR target_modules +] \ | |
594 | maybe-all-target-[+module+][+ | |
595 | ENDFOR target_modules +] | |
405ea7a0 NN |
596 | |
597 | # Do a target for all the subdirectories. A ``make do-X'' will do a | |
598 | # ``make X'' in all subdirectories (because, in general, there is a | |
599 | # dependency (below) of X upon do-X, a ``make X'' will also do this, | |
600 | # but it may do additional work as well). | |
e393202e | 601 | [+ FOR recursive_targets +] |
27b1cc72 | 602 | .PHONY: do-[+make_target+] |
2a4cbe27 NN |
603 | do-[+make_target+]: [+make_target+]-host [+make_target+]-target |
604 | ||
605 | .PHONY: [+make_target+]-host | |
606 | [+make_target+]-host: maybe-[+make_target+]-gcc [+ | |
607 | FOR host_modules +] \ | |
608 | maybe-[+make_target+]-[+module+][+ | |
609 | ENDFOR host_modules +] | |
610 | ||
611 | .PHONY: [+make_target+]-target | |
612 | [+make_target+]-target: [+ | |
613 | FOR target_modules +] \ | |
614 | maybe-[+make_target+]-target-[+module+][+ | |
615 | ENDFOR target_modules +] | |
e393202e NN |
616 | [+ ENDFOR recursive_targets +] |
617 | ||
405ea7a0 NN |
618 | # Here are the targets which correspond to the do-X targets. |
619 | ||
620 | .PHONY: info installcheck dvi install-info | |
621 | .PHONY: clean distclean mostlyclean maintainer-clean realclean | |
622 | .PHONY: local-clean local-distclean local-maintainer-clean | |
623 | info: do-info | |
624 | installcheck: do-installcheck | |
625 | dvi: do-dvi | |
626 | ||
43d92c63 NN |
627 | # Make sure makeinfo is built before we do a `make info', if we're |
628 | # in fact building texinfo. | |
629 | do-info: maybe-all-texinfo | |
405ea7a0 NN |
630 | |
631 | install-info: do-install-info dir.info | |
b40e3958 | 632 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ |
405ea7a0 | 633 | if [ -f dir.info ] ; then \ |
497f816e | 634 | $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \ |
405ea7a0 NN |
635 | else true ; fi |
636 | ||
637 | local-clean: | |
638 | -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log | |
639 | ||
640 | local-distclean: | |
641 | -rm -f Makefile config.status config.cache mh-frag mt-frag | |
e6bfb94a | 642 | -rm -f multilib.out multilib.tmp maybedep.tmp serdep.tmp |
405ea7a0 NN |
643 | -if [ "$(TARGET_SUBDIR)" != "." ]; then \ |
644 | rm -rf $(TARGET_SUBDIR); \ | |
645 | else true; fi | |
e4c4d240 | 646 | -rm -rf $(BUILD_SUBDIR) |
405ea7a0 NN |
647 | -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile |
648 | -rm -f texinfo/doc/Makefile texinfo/po/POTFILES | |
649 | -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null | |
650 | -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null | |
651 | -rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null | |
652 | ||
653 | local-maintainer-clean: | |
654 | @echo "This command is intended for maintainers to use;" | |
655 | @echo "it deletes files that may require special tools to rebuild." | |
656 | ||
657 | clean: do-clean local-clean | |
658 | mostlyclean: do-mostlyclean local-clean | |
659 | distclean: do-distclean local-clean local-distclean | |
660 | maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean | |
661 | maintainer-clean: local-distclean | |
662 | realclean: maintainer-clean | |
663 | ||
2a4cbe27 NN |
664 | # Extra dependency for clean-target, owing to the mixed nature of gcc |
665 | clean-target: clean-target-libgcc | |
405ea7a0 NN |
666 | clean-target-libgcc: |
667 | test ! -d gcc/libgcc || \ | |
668 | (cd gcc/libgcc && find . -type d -print) | \ | |
669 | while read d; do rm -f gcc/$$d/libgcc.a || : ; done | |
670 | -rm -rf gcc/libgcc | |
671 | ||
672 | # Check target. | |
673 | ||
674 | .PHONY: check do-check | |
ede4fbe4 | 675 | check: do-check |
405ea7a0 | 676 | |
3866be5d | 677 | # Only include modules actually being configured and built. |
16ae0395 NN |
678 | do-check: maybe-check-gcc [+ |
679 | FOR host_modules +] \ | |
680 | maybe-check-[+module+][+ | |
681 | ENDFOR host_modules +][+ | |
682 | FOR target_modules +] \ | |
683 | maybe-check-target-[+module+][+ | |
684 | ENDFOR target_modules +] | |
405ea7a0 NN |
685 | |
686 | # Automated reporting of test results. | |
687 | ||
688 | warning.log: build.log | |
689 | $(srcdir)/contrib/warn_summary build.log > $@ | |
690 | ||
691 | mail-report.log: | |
692 | if test x'$(BOOT_CFLAGS)' != x''; then \ | |
693 | BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \ | |
694 | fi; \ | |
695 | $(srcdir)/contrib/test_summary -t >$@ | |
696 | chmod +x $@ | |
697 | echo If you really want to send e-mail, run ./$@ now | |
698 | ||
699 | mail-report-with-warnings.log: warning.log | |
700 | if test x'$(BOOT_CFLAGS)' != x''; then \ | |
701 | BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \ | |
702 | fi; \ | |
703 | $(srcdir)/contrib/test_summary -t -i warning.log >$@ | |
704 | chmod +x $@ | |
705 | echo If you really want to send e-mail, run ./$@ now | |
706 | ||
707 | # Installation targets. | |
708 | ||
ae831be5 | 709 | .PHONY: install uninstall |
dd12c3a8 NN |
710 | install: installdirs install-host install-target |
711 | ||
16ae0395 NN |
712 | .PHONY: install-host-nogcc |
713 | install-host-nogcc: [+ | |
714 | FOR host_modules +] \ | |
715 | maybe-install-[+module+][+ | |
716 | ENDFOR host_modules +] | |
717 | ||
dd12c3a8 NN |
718 | .PHONY: install-host |
719 | install-host: maybe-install-gcc [+ | |
720 | FOR host_modules +] \ | |
721 | maybe-install-[+module+][+ | |
722 | ENDFOR host_modules +] | |
16ae0395 | 723 | |
dd12c3a8 NN |
724 | .PHONY: install-target |
725 | install-target: [+ | |
726 | FOR target_modules +] \ | |
727 | maybe-install-target-[+module+][+ | |
728 | ENDFOR target_modules +] | |
405ea7a0 NN |
729 | |
730 | uninstall: | |
731 | @echo "the uninstall target is not supported in this tree" | |
732 | ||
405ea7a0 NN |
733 | .PHONY: install.all |
734 | install.all: install-no-fixedincludes | |
735 | @if [ -f ./gcc/Makefile ] ; then \ | |
b40e3958 | 736 | r=`${PWD_COMMAND}` ; export r ; \ |
405ea7a0 | 737 | $(SET_LIB_PATH) \ |
378fce5b | 738 | $(GCC_HOST_EXPORTS) \ |
1086bc09 | 739 | (cd ./gcc && \ |
405ea7a0 NN |
740 | $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \ |
741 | else \ | |
742 | true ; \ | |
743 | fi | |
744 | ||
745 | # install-no-fixedincludes is used because Cygnus can not distribute | |
746 | # the fixed header files. | |
747 | .PHONY: install-no-fixedincludes | |
16ae0395 | 748 | install-no-fixedincludes: installdirs install-host-nogcc \ |
dd12c3a8 | 749 | install-target gcc-no-fixedincludes |
405ea7a0 | 750 | |
15723a45 | 751 | ### other supporting targets |
405ea7a0 | 752 | |
15723a45 NN |
753 | MAKEDIRS= \ |
754 | $(DESTDIR)$(prefix) \ | |
755 | $(DESTDIR)$(exec_prefix) | |
756 | .PHONY: installdirs | |
757 | installdirs: mkinstalldirs | |
758 | $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS) | |
759 | ||
760 | dir.info: do-install-info | |
761 | if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \ | |
497f816e | 762 | $(srcdir)/texinfo/gen-info-dir $(DESTDIR)$(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \ |
15723a45 NN |
763 | mv -f dir.info.new dir.info ; \ |
764 | else true ; \ | |
405ea7a0 NN |
765 | fi |
766 | ||
15723a45 NN |
767 | dist: |
768 | @echo "Building a full distribution of this tree isn't done" | |
769 | @echo "via 'make dist'. Check out the etc/ subdirectory" | |
770 | ||
771 | etags tags: TAGS | |
772 | ||
773 | # Right now this just builds TAGS in each subdirectory. emacs19 has the | |
774 | # ability to use several tags files at once, so there is probably no need | |
775 | # to combine them into one big TAGS file (like CVS 1.3 does). We could | |
776 | # (if we felt like it) have this Makefile write a piece of elisp which | |
777 | # the user could load to tell emacs19 where all the TAGS files we just | |
778 | # built are. | |
779 | TAGS: do-TAGS | |
780 | ||
15723a45 NN |
781 | # -------------------------------------- |
782 | # Modules which run on the build machine | |
783 | # -------------------------------------- | |
784 | [+ FOR build_modules +] | |
930314a4 NN |
785 | .PHONY: configure-build-[+module+] maybe-configure-build-[+module+] |
786 | maybe-configure-build-[+module+]: | |
6bd3dfaa PB |
787 | @if build-[+module+] |
788 | maybe-configure-build-[+module+]: configure-build-[+module+] | |
e6bfb94a AO |
789 | configure-build-[+module+]: |
790 | @test ! -f $(BUILD_SUBDIR)/[+module+]/Makefile || exit 0; \ | |
9175bfc0 | 791 | $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/[+module+] ; \ |
b40e3958 L |
792 | r=`${PWD_COMMAND}`; export r; \ |
793 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
378fce5b | 794 | $(BUILD_EXPORTS) \ |
bba45b8b NN |
795 | echo Configuring in $(BUILD_SUBDIR)/[+module+]; \ |
796 | cd "$(BUILD_SUBDIR)/[+module+]" || exit 1; \ | |
797 | case $(srcdir) in \ | |
798 | /* | [A-Za-z]:[\\/]*) \ | |
799 | topdir=$(srcdir) ;; \ | |
800 | *) \ | |
801 | case "$(BUILD_SUBDIR)" in \ | |
405ea7a0 NN |
802 | .) topdir="../$(srcdir)" ;; \ |
803 | *) topdir="../../$(srcdir)" ;; \ | |
bba45b8b NN |
804 | esac ;; \ |
805 | esac; \ | |
806 | if [ "$(srcdir)" = "." ] ; then \ | |
807 | if [ "$(BUILD_SUBDIR)" != "." ] ; then \ | |
808 | if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \ | |
809 | if [ -f Makefile ]; then \ | |
810 | if $(MAKE) distclean; then \ | |
811 | true; \ | |
812 | else \ | |
813 | exit 1; \ | |
814 | fi; \ | |
405ea7a0 | 815 | else \ |
bba45b8b | 816 | true; \ |
405ea7a0 | 817 | fi; \ |
405ea7a0 | 818 | else \ |
bba45b8b | 819 | exit 1; \ |
405ea7a0 | 820 | fi; \ |
bba45b8b NN |
821 | else \ |
822 | true; \ | |
823 | fi; \ | |
824 | srcdiroption="--srcdir=."; \ | |
825 | libsrcdir="."; \ | |
826 | else \ | |
827 | srcdiroption="--srcdir=$${topdir}/[+module+]"; \ | |
828 | libsrcdir="$$s/[+module+]"; \ | |
829 | fi; \ | |
830 | rm -f no-such-file || : ; \ | |
831 | CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ | |
832 | $(BUILD_CONFIGARGS) $${srcdiroption} \ | |
833 | --with-build-subdir="$(BUILD_SUBDIR)" \ | |
834 | || exit 1 | |
6bd3dfaa | 835 | @endif build-[+module+] |
15723a45 NN |
836 | |
837 | .PHONY: all-build-[+module+] maybe-all-build-[+module+] | |
838 | maybe-all-build-[+module+]: | |
6bd3dfaa PB |
839 | @if build-[+module+] |
840 | maybe-all-build-[+module+]: all-build-[+module+] | |
15723a45 | 841 | all-build-[+module+]: configure-build-[+module+] |
b40e3958 L |
842 | @r=`${PWD_COMMAND}`; export r; \ |
843 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
378fce5b | 844 | $(BUILD_EXPORTS) \ |
bba45b8b | 845 | (cd $(BUILD_SUBDIR)/[+module+] && $(MAKE) all) |
6bd3dfaa | 846 | @endif build-[+module+] |
e393202e | 847 | [+ ENDFOR build_modules +] |
405ea7a0 | 848 | |
15723a45 NN |
849 | # -------------------------------------- |
850 | # Modules which run on the host machine | |
851 | # -------------------------------------- | |
3866be5d | 852 | [+ FOR host_modules +] |
e2b9e2dc NN |
853 | .PHONY: configure-[+module+] maybe-configure-[+module+] |
854 | maybe-configure-[+module+]: | |
6bd3dfaa PB |
855 | @if [+module+] |
856 | maybe-configure-[+module+]: configure-[+module+] | |
e6bfb94a AO |
857 | configure-[+module+]: |
858 | @test ! -f [+module+]/Makefile || exit 0; \ | |
859 | [ -d [+module+] ] || mkdir [+module+]; \ | |
b40e3958 L |
860 | r=`${PWD_COMMAND}`; export r; \ |
861 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
378fce5b | 862 | $(HOST_EXPORTS) \ |
e2b9e2dc NN |
863 | echo Configuring in [+module+]; \ |
864 | cd [+module+] || exit 1; \ | |
865 | case $(srcdir) in \ | |
866 | \.) \ | |
867 | srcdiroption="--srcdir=."; \ | |
868 | libsrcdir=".";; \ | |
869 | /* | [A-Za-z]:[\\/]*) \ | |
870 | srcdiroption="--srcdir=$(srcdir)/[+module+]"; \ | |
871 | libsrcdir="$$s/[+module+]";; \ | |
872 | *) \ | |
873 | srcdiroption="--srcdir=../$(srcdir)/[+module+]"; \ | |
874 | libsrcdir="$$s/[+module+]";; \ | |
875 | esac; \ | |
876 | $(SHELL) $${libsrcdir}/configure \ | |
877 | $(HOST_CONFIGARGS) $${srcdiroption} \ | |
878 | || exit 1 | |
6bd3dfaa | 879 | @endif [+module+] |
e2b9e2dc | 880 | |
930314a4 NN |
881 | .PHONY: all-[+module+] maybe-all-[+module+] |
882 | maybe-all-[+module+]: | |
6bd3dfaa PB |
883 | @if [+module+] |
884 | maybe-all-[+module+]: all-[+module+] | |
db1ac78d | 885 | all-[+module+]: configure-[+module+] |
b40e3958 L |
886 | @r=`${PWD_COMMAND}`; export r; \ |
887 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
bba45b8b | 888 | $(SET_LIB_PATH) \ |
378fce5b | 889 | $(HOST_EXPORTS) \ |
bba45b8b NN |
890 | (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ |
891 | IF with_x | |
892 | +] $(X11_FLAGS_TO_PASS)[+ | |
893 | ENDIF with_x +] all) | |
6bd3dfaa | 894 | @endif [+module+] |
405ea7a0 | 895 | |
16ae0395 NN |
896 | .PHONY: check-[+module+] maybe-check-[+module+] |
897 | maybe-check-[+module+]: | |
6bd3dfaa PB |
898 | @if [+module+] |
899 | maybe-check-[+module+]: check-[+module+] | |
3866be5d | 900 | [+ IF no_check +] |
3866be5d NN |
901 | check-[+module+]: |
902 | [+ ELIF no_check_cross +] | |
3866be5d NN |
903 | # This module is only tested in a native toolchain. |
904 | check-[+module+]: | |
7f121bbf | 905 | @if [ '$(host)' = '$(target)' ] ; then \ |
b40e3958 L |
906 | r=`${PWD_COMMAND}`; export r; \ |
907 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
405ea7a0 | 908 | $(SET_LIB_PATH) \ |
378fce5b | 909 | $(HOST_EXPORTS) \ |
1086bc09 | 910 | (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ |
3866be5d NN |
911 | IF with_x |
912 | +] $(X11_FLAGS_TO_PASS)[+ | |
bba45b8b NN |
913 | ENDIF with_x +] check); \ |
914 | fi | |
915 | [+ ELSE check +] | |
bba45b8b | 916 | check-[+module+]: |
b40e3958 L |
917 | @r=`${PWD_COMMAND}`; export r; \ |
918 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
bba45b8b | 919 | $(SET_LIB_PATH) \ |
378fce5b | 920 | $(HOST_EXPORTS) \ |
bba45b8b NN |
921 | (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ |
922 | IF with_x | |
923 | +] $(X11_FLAGS_TO_PASS)[+ | |
924 | ENDIF with_x +] check) | |
3866be5d | 925 | [+ ENDIF no_check +] |
6bd3dfaa | 926 | @endif [+module+] |
405ea7a0 | 927 | |
930314a4 NN |
928 | .PHONY: install-[+module+] maybe-install-[+module+] |
929 | maybe-install-[+module+]: | |
6bd3dfaa PB |
930 | @if [+module+] |
931 | maybe-install-[+module+]: install-[+module+] | |
16ae0395 | 932 | [+ IF no_install +] |
3866be5d NN |
933 | install-[+module+]: |
934 | [+ ELSE install +] | |
3866be5d | 935 | install-[+module+]: installdirs |
b40e3958 L |
936 | @r=`${PWD_COMMAND}`; export r; \ |
937 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
bba45b8b | 938 | $(SET_LIB_PATH) \ |
378fce5b | 939 | $(HOST_EXPORTS) \ |
bba45b8b NN |
940 | (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ |
941 | IF with_x | |
942 | +] $(X11_FLAGS_TO_PASS)[+ | |
943 | ENDIF with_x +] install) | |
3866be5d | 944 | [+ ENDIF no_install +] |
6bd3dfaa | 945 | @endif [+module+] |
4fa63067 NN |
946 | |
947 | # Other targets (info, dvi, etc.) | |
948 | [+ FOR recursive_targets +] | |
949 | .PHONY: maybe-[+make_target+]-[+module+] [+make_target+]-[+module+] | |
950 | maybe-[+make_target+]-[+module+]: | |
6bd3dfaa PB |
951 | @if [+module+] |
952 | maybe-[+make_target+]-[+module+]: [+make_target+]-[+module+] | |
4fa63067 NN |
953 | [+ IF (match-value? = "missing" (get "make_target") ) +] |
954 | # [+module+] doesn't support [+make_target+]. | |
955 | [+make_target+]-[+module+]: | |
956 | [+ ELSE +] | |
957 | [+make_target+]-[+module+]: [+ | |
958 | FOR depend +]\ | |
959 | [+depend+]-[+module+] [+ | |
960 | ENDFOR depend +] | |
961 | @[ -f ./[+module+]/Makefile ] || exit 0; \ | |
962 | r=`${PWD_COMMAND}`; export r; \ | |
963 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
964 | $(SET_LIB_PATH) \ | |
378fce5b | 965 | $(HOST_EXPORTS) \ |
4fa63067 NN |
966 | for flag in $(EXTRA_HOST_FLAGS); do \ |
967 | eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | |
968 | done; \ | |
969 | echo "Doing [+make_target+] in [+module+]" ; \ | |
970 | (cd [+module+] && \ | |
971 | $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ | |
972 | "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | |
973 | "RANLIB=$${RANLIB}" \ | |
974 | "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ | |
975 | [+make_target+]) \ | |
976 | || exit 1 | |
977 | [+ ENDIF +] | |
6bd3dfaa | 978 | @endif [+module+] |
4fa63067 | 979 | [+ ENDFOR recursive_targets +] |
3866be5d | 980 | [+ ENDFOR host_modules +] |
405ea7a0 | 981 | |
15723a45 NN |
982 | # --------------------------------------- |
983 | # Modules which run on the target machine | |
984 | # --------------------------------------- | |
e393202e | 985 | [+ FOR target_modules +] |
930314a4 NN |
986 | .PHONY: configure-target-[+module+] maybe-configure-target-[+module+] |
987 | maybe-configure-target-[+module+]: | |
6bd3dfaa PB |
988 | @if target-[+module+] |
989 | maybe-configure-target-[+module+]: configure-target-[+module+] | |
15723a45 | 990 | |
1086bc09 NN |
991 | # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. |
992 | $(TARGET_SUBDIR)/[+module+]/multilib.out: multilib.out | |
9175bfc0 | 993 | $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/[+module+] ; \ |
e6bfb94a | 994 | rm -f $(TARGET_SUBDIR)/[+module+]/Makefile || : ; \ |
1086bc09 | 995 | cp multilib.out $(TARGET_SUBDIR)/[+module+]/multilib.out |
15723a45 | 996 | |
e6bfb94a AO |
997 | configure-target-[+module+]: $(TARGET_SUBDIR)/[+module+]/multilib.out |
998 | @test ! -f $(TARGET_SUBDIR)/[+module+]/Makefile || exit 0; \ | |
9175bfc0 | 999 | $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/[+module+] ; \ |
b40e3958 L |
1000 | r=`${PWD_COMMAND}`; export r; \ |
1001 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
378fce5b | 1002 | $(SET_LIB_PATH) \[+ |
bba45b8b | 1003 | IF raw_cxx +] |
378fce5b | 1004 | $(RAW_CXX_TARGET_EXPORTS) \[+ |
bba45b8b | 1005 | ELSE normal_cxx +] |
378fce5b | 1006 | $(NORMAL_TARGET_EXPORTS) \[+ |
bba45b8b | 1007 | ENDIF raw_cxx +] |
bba45b8b NN |
1008 | echo Configuring in $(TARGET_SUBDIR)/[+module+]; \ |
1009 | cd "$(TARGET_SUBDIR)/[+module+]" || exit 1; \ | |
1010 | case $(srcdir) in \ | |
1011 | /* | [A-Za-z]:[\\/]*) \ | |
1012 | topdir=$(srcdir) ;; \ | |
1013 | *) \ | |
1014 | case "$(TARGET_SUBDIR)" in \ | |
405ea7a0 NN |
1015 | .) topdir="../$(srcdir)" ;; \ |
1016 | *) topdir="../../$(srcdir)" ;; \ | |
bba45b8b | 1017 | esac ;; \ |
a6d6062d | 1018 | esac; \[+ IF stage +] |
bba45b8b NN |
1019 | if [ "$(srcdir)" = "." ] ; then \ |
1020 | if [ "$(TARGET_SUBDIR)" != "." ] ; then \ | |
1021 | if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \ | |
1022 | if [ -f Makefile ]; then \ | |
1023 | if $(MAKE) distclean; then \ | |
1024 | true; \ | |
1025 | else \ | |
1026 | exit 1; \ | |
1027 | fi; \ | |
405ea7a0 | 1028 | else \ |
bba45b8b | 1029 | true; \ |
405ea7a0 | 1030 | fi; \ |
405ea7a0 | 1031 | else \ |
bba45b8b | 1032 | exit 1; \ |
405ea7a0 | 1033 | fi; \ |
bba45b8b NN |
1034 | else \ |
1035 | true; \ | |
1036 | fi; \ | |
1037 | srcdiroption="--srcdir=."; \ | |
1038 | libsrcdir="."; \ | |
a6d6062d | 1039 | else \[+ ENDIF stage +] |
bba45b8b | 1040 | srcdiroption="--srcdir=$${topdir}/[+module+]"; \ |
a6d6062d DD |
1041 | libsrcdir="$$s/[+module+]"; \[+ IF stage +] |
1042 | fi; \[+ ENDIF stage +] | |
bba45b8b NN |
1043 | rm -f no-such-file || : ; \ |
1044 | CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ | |
1045 | $(TARGET_CONFIGARGS) $${srcdiroption} \ | |
1046 | --with-target-subdir="$(TARGET_SUBDIR)" \ | |
1047 | || exit 1 | |
6bd3dfaa | 1048 | @endif target-[+module+] |
405ea7a0 | 1049 | |
930314a4 NN |
1050 | .PHONY: all-target-[+module+] maybe-all-target-[+module+] |
1051 | maybe-all-target-[+module+]: | |
6bd3dfaa PB |
1052 | @if target-[+module+] |
1053 | maybe-all-target-[+module+]: all-target-[+module+] | |
15723a45 | 1054 | all-target-[+module+]: configure-target-[+module+] |
b40e3958 L |
1055 | @r=`${PWD_COMMAND}`; export r; \ |
1056 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
378fce5b DD |
1057 | $(SET_LIB_PATH) \[+ |
1058 | IF raw_cxx +] | |
1059 | $(RAW_CXX_TARGET_EXPORTS) \[+ | |
1060 | ELSE normal_cxx +] | |
1061 | $(NORMAL_TARGET_EXPORTS) \[+ | |
1062 | ENDIF raw_cxx +] | |
bba45b8b NN |
1063 | (cd $(TARGET_SUBDIR)/[+module+] && \ |
1064 | $(MAKE) $(TARGET_FLAGS_TO_PASS) [+ | |
1065 | IF raw_cxx | |
1066 | +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ | |
1067 | ENDIF raw_cxx | |
1068 | +] all) | |
6bd3dfaa | 1069 | @endif target-[+module+] |
16ae0395 NN |
1070 | |
1071 | .PHONY: check-target-[+module+] maybe-check-target-[+module+] | |
1072 | maybe-check-target-[+module+]: | |
6bd3dfaa PB |
1073 | @if target-[+module+] |
1074 | maybe-check-target-[+module+]: check-target-[+module+] | |
3866be5d NN |
1075 | [+ IF no_check +] |
1076 | # Dummy target for uncheckable module. | |
3866be5d NN |
1077 | check-target-[+module+]: |
1078 | [+ ELSE check +] | |
e393202e | 1079 | check-target-[+module+]: |
b40e3958 L |
1080 | @r=`${PWD_COMMAND}`; export r; \ |
1081 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
378fce5b DD |
1082 | $(SET_LIB_PATH) \[+ |
1083 | IF raw_cxx +] | |
1084 | $(RAW_CXX_TARGET_EXPORTS) \[+ | |
1085 | ELSE normal_cxx +] | |
1086 | $(NORMAL_TARGET_EXPORTS) \[+ | |
1087 | ENDIF raw_cxx +] | |
bba45b8b NN |
1088 | (cd $(TARGET_SUBDIR)/[+module+] && \ |
1089 | $(MAKE) $(TARGET_FLAGS_TO_PASS) [+ | |
1090 | IF raw_cxx | |
1091 | +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ | |
1092 | ENDIF raw_cxx | |
1093 | +] check) | |
e393202e | 1094 | [+ ENDIF no_check +] |
6bd3dfaa | 1095 | @endif target-[+module+] |
16ae0395 | 1096 | |
930314a4 NN |
1097 | .PHONY: install-target-[+module+] maybe-install-target-[+module+] |
1098 | maybe-install-target-[+module+]: | |
6bd3dfaa PB |
1099 | @if target-[+module+] |
1100 | maybe-install-target-[+module+]: install-target-[+module+] | |
16ae0395 | 1101 | [+ IF no_install +] |
930314a4 NN |
1102 | # Dummy target for uninstallable. |
1103 | install-target-[+module+]: | |
1104 | [+ ELSE install +] | |
e393202e | 1105 | install-target-[+module+]: installdirs |
b40e3958 L |
1106 | @r=`${PWD_COMMAND}`; export r; \ |
1107 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
378fce5b DD |
1108 | $(SET_LIB_PATH) \[+ |
1109 | IF raw_cxx +] | |
1110 | $(RAW_CXX_TARGET_EXPORTS) \[+ | |
1111 | ELSE normal_cxx +] | |
1112 | $(NORMAL_TARGET_EXPORTS) \[+ | |
1113 | ENDIF raw_cxx +] | |
bba45b8b NN |
1114 | (cd $(TARGET_SUBDIR)/[+module+] && \ |
1115 | $(MAKE) $(TARGET_FLAGS_TO_PASS) install) | |
e393202e | 1116 | [+ ENDIF no_install +] |
6bd3dfaa | 1117 | @endif target-[+module+] |
4fa63067 NN |
1118 | |
1119 | # Other targets (info, dvi, etc.) | |
1120 | [+ FOR recursive_targets +] | |
1121 | .PHONY: maybe-[+make_target+]-target-[+module+] [+make_target+]-target-[+module+] | |
1122 | maybe-[+make_target+]-target-[+module+]: | |
6bd3dfaa PB |
1123 | @if target-[+module+] |
1124 | maybe-[+make_target+]-target-[+module+]: [+make_target+]-target-[+module+] | |
4fa63067 NN |
1125 | [+ IF (match-value? = "missing" (get "make_target") ) +] |
1126 | # [+module+] doesn't support [+make_target+]. | |
1127 | [+make_target+]-target-[+module+]: | |
1128 | [+ ELSE +] | |
1129 | [+make_target+]-target-[+module+]: [+ | |
1130 | FOR depend +]\ | |
1131 | [+depend+]-target-[+module+] [+ | |
1132 | ENDFOR depend +] | |
1133 | @[ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] || exit 0 ; \ | |
1134 | r=`${PWD_COMMAND}`; export r; \ | |
1135 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
378fce5b DD |
1136 | $(SET_LIB_PATH) \[+ |
1137 | IF raw_cxx +] | |
1138 | $(RAW_CXX_TARGET_EXPORTS) \[+ | |
1139 | ELSE normal_cxx +] | |
1140 | $(NORMAL_TARGET_EXPORTS) \[+ | |
1141 | ENDIF raw_cxx +] | |
4fa63067 NN |
1142 | echo "Doing [+make_target+] in $(TARGET_SUBDIR)/[+module+]" ; \ |
1143 | for flag in $(EXTRA_TARGET_FLAGS); do \ | |
1144 | eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | |
1145 | done; \ | |
1146 | (cd $(TARGET_SUBDIR)/[+module+] && \ | |
1147 | $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ | |
1148 | "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | |
1149 | "RANLIB=$${RANLIB}" \ | |
1150 | "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ | |
1151 | [+make_target+]) \ | |
1152 | || exit 1 | |
1153 | [+ ENDIF +] | |
6bd3dfaa | 1154 | @endif target-[+module+] |
4fa63067 | 1155 | [+ ENDFOR recursive_targets +] |
e393202e | 1156 | [+ ENDFOR target_modules +] |
405ea7a0 | 1157 | |
15723a45 NN |
1158 | # ---------- |
1159 | # GCC module | |
1160 | # ---------- | |
1161 | ||
1162 | # Unfortunately, while gcc _should_ be a host module, | |
1163 | # libgcc is a target module, and gen* programs are | |
1164 | # build modules. So GCC is a sort of hybrid. | |
1165 | ||
405ea7a0 | 1166 | # gcc is the only module which uses GCC_FLAGS_TO_PASS. |
ac7b618e NN |
1167 | # Don't use shared host config.cache, as it will confuse later |
1168 | # directories; GCC wants slightly different values for some | |
1169 | # precious variables. *sigh* | |
1d39f329 NN |
1170 | |
1171 | # We must skip configuring if toplevel bootstrap is going. | |
e2b9e2dc NN |
1172 | .PHONY: configure-gcc maybe-configure-gcc |
1173 | maybe-configure-gcc: | |
6bd3dfaa PB |
1174 | @if gcc |
1175 | maybe-configure-gcc: configure-gcc | |
e6bfb94a | 1176 | configure-gcc: |
319cab08 PB |
1177 | @endif gcc |
1178 | @if gcc-no-bootstrap | |
e6bfb94a AO |
1179 | @test ! -f gcc/Makefile || exit 0; \ |
1180 | [ -d gcc ] || mkdir gcc; \ | |
b40e3958 L |
1181 | r=`${PWD_COMMAND}`; export r; \ |
1182 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
378fce5b | 1183 | $(GCC_HOST_EXPORTS) \ |
e2b9e2dc NN |
1184 | echo Configuring in gcc; \ |
1185 | cd gcc || exit 1; \ | |
1186 | case $(srcdir) in \ | |
1187 | \.) \ | |
1188 | srcdiroption="--srcdir=."; \ | |
1189 | libsrcdir=".";; \ | |
1190 | /* | [A-Za-z]:[\\/]*) \ | |
1191 | srcdiroption="--srcdir=$(srcdir)/gcc"; \ | |
1192 | libsrcdir="$$s/gcc";; \ | |
1193 | *) \ | |
1194 | srcdiroption="--srcdir=../$(srcdir)/gcc"; \ | |
1195 | libsrcdir="$$s/gcc";; \ | |
1196 | esac; \ | |
1197 | $(SHELL) $${libsrcdir}/configure \ | |
bb5dca17 | 1198 | $(HOST_CONFIGARGS) $${srcdiroption} \ |
e2b9e2dc | 1199 | || exit 1 |
319cab08 | 1200 | @endif gcc-no-bootstrap |
e2b9e2dc | 1201 | |
b72e6a2d JM |
1202 | # Don't 'make all' in gcc if it's already been made by 'bootstrap'; that |
1203 | # causes trouble. This wart will be fixed eventually by moving | |
db1ac78d | 1204 | # the bootstrap behavior to this file. |
930314a4 NN |
1205 | .PHONY: all-gcc maybe-all-gcc |
1206 | maybe-all-gcc: | |
6bd3dfaa PB |
1207 | @if gcc |
1208 | maybe-all-gcc: all-gcc | |
db1ac78d | 1209 | all-gcc: configure-gcc |
319cab08 PB |
1210 | @endif gcc |
1211 | @if gcc-no-bootstrap | |
1d39f329 NN |
1212 | r=`${PWD_COMMAND}`; export r; \ |
1213 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
319cab08 | 1214 | $(SET_LIB_PATH) \ |
378fce5b | 1215 | $(GCC_HOST_EXPORTS) \ |
319cab08 | 1216 | if [ -f gcc/stage_last ] ; then \ |
1086bc09 | 1217 | (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) quickstrap); \ |
db1ac78d | 1218 | else \ |
1086bc09 | 1219 | (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) all); \ |
405ea7a0 NN |
1220 | fi |
1221 | ||
1222 | # Building GCC uses some tools for rebuilding "source" files | |
1223 | # like texinfo, bison/byacc, etc. So we must depend on those. | |
1224 | # | |
1225 | # While building GCC, it may be necessary to run various target | |
1226 | # programs like the assembler, linker, etc. So we depend on | |
1227 | # those too. | |
1228 | # | |
1229 | # In theory, on an SMP all those dependencies can be resolved | |
1230 | # in parallel. | |
1231 | # | |
5b474aa8 DD |
1232 | GCC_STRAP_TARGETS = bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap |
1233 | .PHONY: $(GCC_STRAP_TARGETS) | |
1234 | $(GCC_STRAP_TARGETS): all-bootstrap configure-gcc | |
b40e3958 L |
1235 | @r=`${PWD_COMMAND}`; export r; \ |
1236 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
405ea7a0 | 1237 | $(SET_LIB_PATH) \ |
378fce5b | 1238 | $(GCC_HOST_EXPORTS) \ |
405ea7a0 NN |
1239 | echo "Bootstrapping the compiler"; \ |
1240 | cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@ | |
b40e3958 L |
1241 | @r=`${PWD_COMMAND}`; export r; \ |
1242 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
405ea7a0 NN |
1243 | case "$@" in \ |
1244 | *bootstrap4-lean ) \ | |
bba45b8b NN |
1245 | msg="Comparing stage3 and stage4 of the compiler"; \ |
1246 | compare=compare3-lean ;; \ | |
1247 | *bootstrap4 ) \ | |
1248 | msg="Comparing stage3 and stage4 of the compiler"; \ | |
1249 | compare=compare3 ;; \ | |
1250 | *-lean ) \ | |
1251 | msg="Comparing stage2 and stage3 of the compiler"; \ | |
1252 | compare=compare-lean ;; \ | |
1253 | * ) \ | |
1254 | msg="Comparing stage2 and stage3 of the compiler"; \ | |
1255 | compare=compare ;; \ | |
405ea7a0 NN |
1256 | esac; \ |
1257 | $(SET_LIB_PATH) \ | |
378fce5b | 1258 | $(GCC_HOST_EXPORTS) \ |
405ea7a0 NN |
1259 | echo "$$msg"; \ |
1260 | cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare | |
b40e3958 L |
1261 | @r=`${PWD_COMMAND}`; export r; \ |
1262 | s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ | |
405ea7a0 NN |
1263 | $(SET_LIB_PATH) \ |
1264 | echo "Building runtime libraries"; \ | |
656fdd47 | 1265 | $(MAKE) $(RECURSE_FLAGS_TO_PASS) all |
405ea7a0 | 1266 | |
ec7e0995 | 1267 | profiledbootstrap: all-bootstrap configure-gcc |
b40e3958 L |
1268 | @r=`${PWD_COMMAND}`; export r; \ |
1269 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
ec7e0995 | 1270 | $(SET_LIB_PATH) \ |
378fce5b | 1271 | $(GCC_HOST_EXPORTS) \ |
ec7e0995 NN |
1272 | echo "Bootstrapping the compiler"; \ |
1273 | cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stageprofile_build | |
b40e3958 L |
1274 | @r=`${PWD_COMMAND}`; export r; \ |
1275 | s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ | |
ec7e0995 NN |
1276 | $(SET_LIB_PATH) \ |
1277 | echo "Building runtime libraries and training compiler"; \ | |
656fdd47 | 1278 | $(MAKE) $(RECURSE_FLAGS_TO_PASS) all |
b40e3958 L |
1279 | @r=`${PWD_COMMAND}`; export r; \ |
1280 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
ec7e0995 | 1281 | $(SET_LIB_PATH) \ |
378fce5b | 1282 | $(GCC_HOST_EXPORTS) \ |
ec7e0995 NN |
1283 | echo "Building feedback based compiler"; \ |
1284 | cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stagefeedback_build | |
1285 | ||
405ea7a0 NN |
1286 | .PHONY: cross |
1287 | cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld | |
b40e3958 L |
1288 | @r=`${PWD_COMMAND}`; export r; \ |
1289 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
405ea7a0 | 1290 | $(SET_LIB_PATH) \ |
378fce5b | 1291 | $(GCC_HOST_EXPORTS) \ |
405ea7a0 NN |
1292 | echo "Building the C and C++ compiler"; \ |
1293 | cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" | |
b40e3958 L |
1294 | @r=`${PWD_COMMAND}`; export r; \ |
1295 | s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ | |
405ea7a0 NN |
1296 | $(SET_LIB_PATH) \ |
1297 | echo "Building runtime libraries"; \ | |
656fdd47 | 1298 | $(MAKE) $(RECURSE_FLAGS_TO_PASS) LANGUAGES="c c++" all |
319cab08 | 1299 | @endif gcc-no-bootstrap |
405ea7a0 | 1300 | |
8945c6bb | 1301 | .PHONY: check-gcc maybe-check-gcc |
44482353 | 1302 | maybe-check-gcc: |
6bd3dfaa PB |
1303 | @if gcc |
1304 | maybe-check-gcc: check-gcc | |
405ea7a0 NN |
1305 | check-gcc: |
1306 | @if [ -f ./gcc/Makefile ] ; then \ | |
b40e3958 L |
1307 | r=`${PWD_COMMAND}`; export r; \ |
1308 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
405ea7a0 | 1309 | $(SET_LIB_PATH) \ |
378fce5b | 1310 | $(GCC_HOST_EXPORTS) \ |
1086bc09 | 1311 | (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check); \ |
405ea7a0 NN |
1312 | else \ |
1313 | true; \ | |
1314 | fi | |
1315 | ||
7d695d07 JM |
1316 | .PHONY: check-gcc-c++ |
1317 | check-gcc-c++: | |
405ea7a0 | 1318 | @if [ -f ./gcc/Makefile ] ; then \ |
b40e3958 L |
1319 | r=`${PWD_COMMAND}`; export r; \ |
1320 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
405ea7a0 | 1321 | $(SET_LIB_PATH) \ |
378fce5b | 1322 | $(GCC_HOST_EXPORTS) \ |
1086bc09 | 1323 | (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \ |
405ea7a0 NN |
1324 | else \ |
1325 | true; \ | |
7d695d07 JM |
1326 | fi |
1327 | ||
1328 | .PHONY: check-c++ | |
ede4fbe4 | 1329 | check-c++: check-target-libstdc++-v3 check-gcc-c++ |
6bd3dfaa | 1330 | @endif gcc |
405ea7a0 | 1331 | |
930314a4 NN |
1332 | .PHONY: install-gcc maybe-install-gcc |
1333 | maybe-install-gcc: | |
6bd3dfaa PB |
1334 | @if gcc |
1335 | maybe-install-gcc: install-gcc | |
405ea7a0 NN |
1336 | install-gcc: |
1337 | @if [ -f ./gcc/Makefile ] ; then \ | |
b40e3958 L |
1338 | r=`${PWD_COMMAND}`; export r; \ |
1339 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
405ea7a0 | 1340 | $(SET_LIB_PATH) \ |
378fce5b | 1341 | $(GCC_HOST_EXPORTS) \ |
1086bc09 | 1342 | (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ |
405ea7a0 NN |
1343 | else \ |
1344 | true; \ | |
1345 | fi | |
6bd3dfaa | 1346 | @endif gcc |
405ea7a0 | 1347 | |
15723a45 NN |
1348 | # Install the gcc headers files, but not the fixed include files, |
1349 | # which Cygnus is not allowed to distribute. This rule is very | |
1350 | # dependent on the workings of the gcc Makefile.in. | |
1351 | .PHONY: gcc-no-fixedincludes | |
1352 | gcc-no-fixedincludes: | |
1353 | @if [ -f ./gcc/Makefile ]; then \ | |
1354 | rm -rf gcc/tmp-include; \ | |
1355 | mv gcc/include gcc/tmp-include 2>/dev/null; \ | |
1356 | mkdir gcc/include; \ | |
1357 | cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \ | |
1358 | touch gcc/stmp-fixinc gcc/include/fixed; \ | |
1359 | rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \ | |
b40e3958 L |
1360 | r=`${PWD_COMMAND}`; export r; \ |
1361 | s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ | |
15723a45 | 1362 | $(SET_LIB_PATH) \ |
378fce5b | 1363 | $(GCC_HOST_EXPORTS) \ |
1086bc09 | 1364 | (cd ./gcc && \ |
15723a45 NN |
1365 | $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ |
1366 | rm -rf gcc/include; \ | |
1367 | mv gcc/tmp-include gcc/include 2>/dev/null; \ | |
1368 | else true; fi | |
1369 | ||
4fa63067 NN |
1370 | # Other targets (dvi, info, etc.) |
1371 | [+ FOR recursive_targets +] | |
1372 | .PHONY: maybe-[+make_target+]-gcc [+make_target+]-gcc | |
1373 | maybe-[+make_target+]-gcc: | |
6bd3dfaa PB |
1374 | @if gcc |
1375 | maybe-[+make_target+]-gcc: [+make_target+]-gcc | |
4fa63067 NN |
1376 | [+make_target+]-gcc: [+ |
1377 | FOR depend +]\ | |
1378 | [+depend+]-gcc [+ | |
1379 | ENDFOR depend +] | |
1380 | @[ -f ./gcc/Makefile ] || exit 0; \ | |
1381 | r=`${PWD_COMMAND}`; export r; \ | |
1382 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
1383 | $(SET_LIB_PATH) \ | |
1384 | for flag in $(EXTRA_GCC_FLAGS); do \ | |
1385 | eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | |
1386 | done; \ | |
378fce5b | 1387 | $(GCC_HOST_EXPORTS) \ |
4fa63067 NN |
1388 | echo "Doing [+make_target+] in gcc" ; \ |
1389 | (cd gcc && \ | |
1390 | $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ | |
1391 | "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | |
1392 | "RANLIB=$${RANLIB}" \ | |
1393 | "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ | |
1394 | [+make_target+]) \ | |
1395 | || exit 1 | |
6bd3dfaa | 1396 | @endif gcc |
4fa63067 NN |
1397 | |
1398 | [+ ENDFOR recursive_targets +] | |
1399 | ||
319cab08 | 1400 | @if gcc-bootstrap |
1d39f329 NN |
1401 | # --------------------- |
1402 | # GCC bootstrap support | |
1403 | # --------------------- | |
1404 | ||
dfdffa2c PB |
1405 | # We track the current stage (the one in 'gcc') in the stage_last file. |
1406 | # We name the build directories for the various stages "stage1-gcc", | |
1407 | # "stage2-gcc","stage3-gcc", etc. | |
1408 | ||
1409 | # Since the 'compare' process will fail (on debugging information) if any | |
1410 | # directory names are different, we need to link the gcc directory for | |
1411 | # the previous stage to a constant name ('gcc-prev'), and to make the name of | |
1412 | # the build directories constant as well. For the latter, we use naked names | |
1413 | # like 'gcc', because the scripts in that directory assume it. We use | |
1414 | # mv on platforms where symlinks to directories do not work or are not | |
1415 | # reliable. | |
1416 | ||
1417 | # At the end of the bootstrap, a symlink to 'stage3-gcc' named 'gcc' must | |
1418 | # be kept, so that libraries can find it. Ick! | |
1419 | ||
1420 | # It would be best to preinstall gcc into a staging area (and in the | |
1421 | # future, gather there all prebootstrap packages). This would allow | |
1422 | # assemblers and linkers can be bootstrapped as well as the compiler | |
1423 | # (both in a combined tree, or separately). This however requires some | |
1424 | # change to the gcc driver, again in order to avoid comparison failures. | |
1d39f329 NN |
1425 | |
1426 | # Bugs: This is almost certainly not parallel-make safe. | |
1427 | ||
1428 | # 'touch' doesn't work right on some platforms. | |
1429 | STAMP = echo timestamp > | |
1430 | ||
1431 | # Only build the C compiler for stage1, because that is the only one that | |
1432 | # we can guarantee will build with the native compiler, and also it is the | |
1433 | # only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS), | |
1434 | # MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them | |
1435 | # overrideable (for a bootstrap build stage1 also builds gcc.info). | |
1436 | ||
1437 | STAGE1_CFLAGS=@stage1_cflags@ | |
1438 | STAGE1_LANGUAGES=@stage1_languages@ | |
1439 | ||
dfdffa2c PB |
1440 | # We only want to compare .o files, so set this! |
1441 | objext = .o | |
1d39f329 | 1442 | |
4fa63067 NN |
1443 | # Real targets act phony if they depend on phony targets; this hack |
1444 | # prevents gratuitous rebuilding of stage 1. | |
1445 | prebootstrap: | |
656fdd47 | 1446 | $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-bootstrap |
4fa63067 NN |
1447 | $(STAMP) prebootstrap |
1448 | ||
1d39f329 NN |
1449 | # Flags to pass to stage2 and later makes. |
1450 | BOOT_CFLAGS= -g -O2 | |
1451 | POSTSTAGE1_FLAGS_TO_PASS = \ | |
656fdd47 PB |
1452 | CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \ |
1453 | STAGE_PREFIX=$$r/stage[+prev+]-gcc/ \ | |
1d39f329 | 1454 | CFLAGS="$(BOOT_CFLAGS)" \ |
a0049f1b | 1455 | ADAC="\$$(CC)" |
1d39f329 | 1456 | |
dfdffa2c PB |
1457 | # For stage 1: |
1458 | # * We force-disable intermodule optimizations, even if | |
1459 | # --enable-intermodule was passed, since the installed compiler probably | |
1460 | # can't handle them. Luckily, autoconf always respects | |
1461 | # the last argument when conflicting --enable arguments are passed. | |
1462 | # * Likewise, we force-disable coverage flags, since the installed compiler | |
1463 | # probably has never heard of them. | |
1464 | # * We build only C (and possibly Ada). | |
1465 | ||
1466 | [+ FOR bootstrap-stage +] | |
319cab08 | 1467 | .PHONY: stage[+id+]-start stage[+id+]-end |
dfdffa2c | 1468 | |
656fdd47 | 1469 | stage[+id+]-start:: |
319cab08 | 1470 | [ -f stage_last ] && $(MAKE) `cat stage_last`-end || : |
dfdffa2c PB |
1471 | echo stage[+id+] > stage_last ; \ |
1472 | [ -d stage[+id+]-gcc ] || mkdir stage[+id+]-gcc; \ | |
1473 | set stage[+id+]-gcc gcc ; @CREATE_LINK_TO_DIR@ [+ IF prev +] ; \ | |
1474 | set stage[+prev+]-gcc prev-gcc ; @CREATE_LINK_TO_DIR@ [+ ENDIF prev +] | |
1475 | ||
656fdd47 | 1476 | stage[+id+]-end:: |
dfdffa2c PB |
1477 | rm -f stage_last ; \ |
1478 | set gcc stage[+id+]-gcc ; @UNDO_LINK_TO_DIR@ [+ IF prev +] ; \ | |
1479 | set prev-gcc stage[+prev+]-gcc ; @UNDO_LINK_TO_DIR@ [+ ENDIF prev +] | |
1480 | ||
1481 | # Bubble a bugfix through all the stages up to stage [+id+]. They | |
1482 | # are remade, but not reconfigured. The next stage (if any) will not | |
1483 | # be reconfigured as well. | |
319cab08 | 1484 | .PHONY: stage[+id+]-bubble |
656fdd47 | 1485 | stage[+id+]-bubble:: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +] |
dfdffa2c PB |
1486 | @if [ -f all-stage[+id+]-gcc ] ; then \ |
1487 | echo Remaking stage [+id+] ; \ | |
1488 | rm -f all-stage[+id+]-gcc ; \ | |
656fdd47 PB |
1489 | fi ; \ |
1490 | $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage[+id+]-gcc | |
1491 | ||
1492 | [+ IF prev +] | |
1493 | stage[+prev+]-bubble:: | |
1494 | @if [ -f configure-stage[+id+]-gcc ] ; then \ | |
1495 | $(STAMP) configure-stage[+id+]-gcc ; \ | |
dfdffa2c | 1496 | fi |
656fdd47 | 1497 | [+ ENDIF prev +] |
dfdffa2c PB |
1498 | |
1499 | configure-stage[+id+]-gcc: [+ IF prev +] all-stage[+prev+]-gcc [+ | |
1500 | ELSE +] prebootstrap [+ ENDIF prev +] | |
319cab08 | 1501 | $(MAKE) stage[+id+]-start |
dfdffa2c PB |
1502 | @if [ -f stage[+id+]-gcc/Makefile ] ; then \ |
1503 | $(STAMP) configure-stage[+id+]-gcc ; \ | |
1d39f329 NN |
1504 | exit 0; \ |
1505 | else \ | |
1506 | true ; \ | |
1507 | fi ; \ | |
1d39f329 | 1508 | r=`${PWD_COMMAND}`; export r; \ |
378fce5b DD |
1509 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; [+ IF prev +] \ |
1510 | $(STAGE_HOST_EXPORTS) [+ ELSE prev +] \ | |
1511 | $(GCC_HOST_EXPORTS) [+ ENDIF prev +] \ | |
dfdffa2c | 1512 | echo Configuring stage [+id+] in gcc ; \ |
1d39f329 NN |
1513 | cd gcc || exit 1; \ |
1514 | case $(srcdir) in \ | |
1515 | \.) \ | |
1516 | srcdiroption="--srcdir=."; \ | |
1517 | libsrcdir=".";; \ | |
1518 | /* | [A-Za-z]:[\\/]*) \ | |
1519 | srcdiroption="--srcdir=$(srcdir)/gcc"; \ | |
1520 | libsrcdir="$$s/gcc";; \ | |
1521 | *) \ | |
1522 | srcdiroption="--srcdir=../$(srcdir)/gcc"; \ | |
1523 | libsrcdir="$$s/gcc";; \ | |
1524 | esac; \ | |
1525 | $(SHELL) $${libsrcdir}/configure \ | |
dfdffa2c PB |
1526 | $(HOST_CONFIGARGS) $${srcdiroption} \ |
1527 | [+extra_configure_flags+] && \ | |
1528 | $(STAMP) ../configure-stage[+id+]-gcc | |
1d39f329 | 1529 | |
dfdffa2c | 1530 | all-stage[+id+]-gcc: configure-stage[+id+]-gcc |
319cab08 | 1531 | $(MAKE) stage[+id+]-start |
dfdffa2c | 1532 | @r=`${PWD_COMMAND}`; export r; \ |
378fce5b DD |
1533 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; [+ IF prev +] \ |
1534 | $(STAGE_HOST_EXPORTS) [+ ELSE prev +] \ | |
1535 | $(GCC_HOST_EXPORTS) [+ ENDIF prev +] \ | |
1d39f329 | 1536 | cd gcc && \ |
dfdffa2c | 1537 | $(MAKE) $(GCC_FLAGS_TO_PASS) [+ IF prev +] \ |
656fdd47 | 1538 | $(POSTSTAGE1_FLAGS_TO_PASS) [+ ENDIF prev +] \ |
dfdffa2c | 1539 | [+extra_make_flags+] && $(STAMP) ../all-stage[+id+]-gcc |
1d39f329 | 1540 | |
dfdffa2c PB |
1541 | [+ IF compare-target +] |
1542 | [+compare-target+]: all-stage[+id+]-gcc | |
319cab08 | 1543 | [ -f stage_last ] && $(MAKE) `cat stage_last`-end || : |
dfdffa2c | 1544 | @r=`${PWD_COMMAND}`; export r; \ |
1d39f329 NN |
1545 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ |
1546 | rm -f .bad_compare ; \ | |
dfdffa2c | 1547 | cd stage[+id+]-gcc; \ |
1d39f329 NN |
1548 | files=`find . -name "*$(objext)" -print` ; \ |
1549 | cd .. ; \ | |
1550 | for file in $${files} ; do \ | |
dfdffa2c | 1551 | f1=$$r/stage[+prev+]-gcc/$$file; f2=$$r/stage[+id+]-gcc/$$file; \ |
b8908782 | 1552 | @do_compare@ > /dev/null 2>&1; \ |
1d39f329 NN |
1553 | test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \ |
1554 | done ; \ | |
1555 | if [ -f .bad_compare ]; then \ | |
1556 | echo "Bootstrap comparison failure!"; \ | |
1557 | cat .bad_compare; \ | |
1558 | exit 1; \ | |
1559 | else \ | |
1560 | true; \ | |
1561 | fi ; \ | |
dfdffa2c PB |
1562 | $(STAMP) [+compare-target+] |
1563 | [+ ENDIF compare-target +] | |
1564 | ||
1565 | [+ IF bootstrap-target +] | |
1566 | .PHONY: [+bootstrap-target+] | |
1567 | [+bootstrap-target+]: | |
656fdd47 | 1568 | $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage[+id+]-bubble [+ |
dfdffa2c PB |
1569 | IF compare-target +] [+compare-target+] [+ |
1570 | ENDIF compare-target +] \ | |
319cab08 | 1571 | stage[+id+]-start all stage[+id+]-end |
dfdffa2c PB |
1572 | [+ ENDIF bootstrap-target +] |
1573 | ||
656fdd47 | 1574 | .PHONY: restage[+id+] touch-stage[+id+] distclean-stage[+id+] |
dfdffa2c | 1575 | |
656fdd47 PB |
1576 | # Rules to wipe a stage and all the following ones, used for cleanstrap |
1577 | [+ IF prev +]distclean-stage[+prev+]:: distclean-stage[+id+] [+ ENDIF prev +] | |
1578 | distclean-stage[+id+]:: | |
319cab08 | 1579 | [ -f stage_last ] && $(MAKE) `cat stage_last`-end || : |
dfdffa2c PB |
1580 | rm -rf configure-stage[+id+]-gcc all-stage[+id+]-gcc stage[+id+]-gcc [+ |
1581 | IF compare-target +][+compare-target+] [+ ENDIF compare-target +] | |
1582 | ||
656fdd47 PB |
1583 | # Rules to renew the timestamp on a stage and all the following ones |
1584 | [+ IF prev +]touch-stage[+prev+]:: touch-stage[+id+] [+ ENDIF prev +] | |
1585 | touch-stage[+id+]:: | |
1586 | @[ -f configure-stage[+id+]-gcc ] && \ | |
1587 | echo '$(STAMP) configure-stage[+id+]-gcc' && \ | |
1588 | $(STAMP) configure-stage[+id+]-gcc; \ | |
1589 | [ -f all-stage[+id+]-gcc ] && \ | |
1590 | echo '$(STAMP) all-stage[+id+]-gcc' && \ | |
1591 | $(STAMP) all-stage[+id+]-gcc; \ | |
1592 | : | |
1593 | ||
1594 | # After building a stage, touch the following ones | |
1595 | [+ IF prev +]restage[+prev+]:: touch-stage[+id+] [+ ENDIF prev +] | |
1596 | restage[+id+]:: | |
dfdffa2c PB |
1597 | rm -rf all-stage[+id+]-gcc [+ |
1598 | IF compare-target +][+compare-target+] [+ ENDIF compare-target +] | |
656fdd47 | 1599 | $(MAKE) $(RECURSE_FLAGS_TO_PASS) [+ |
dfdffa2c PB |
1600 | IF compare-target +][+compare-target+] [+ |
1601 | ELSE +] all-stage[+id+]-gcc [+ ENDIF compare-target +] | |
1602 | ||
1603 | [+ IF cleanstrap-target +] | |
1604 | .PHONY: [+cleanstrap-target+] | |
1605 | [+cleanstrap-target+]: distclean-stage1 [+bootstrap-target+] | |
1606 | [+ ENDIF cleanstrap-target +] | |
1607 | ||
1608 | [+ ENDFOR bootstrap-stage +] | |
656fdd47 PB |
1609 | |
1610 | stagefeedback-start:: | |
1611 | @r=`${PWD_COMMAND}`; export r; \ | |
1612 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
1613 | cd stageprofile-gcc && \ | |
1614 | { find . -type d | sort | sed 's,.*,$(SHELL) '"$$s"'/mkinstalldirs "../gcc/&",' | $(SHELL); } && \ | |
1615 | { find . -name '*.*da' | sed 's,.*,$(LN) -f "&" "../gcc/&",' | $(SHELL); } | |
1616 | ||
1617 | profiledbootstrap: all-bootstrap configure-gcc | |
1618 | @r=`${PWD_COMMAND}`; export r; \ | |
1619 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
1620 | $(SET_LIB_PATH) \ | |
1621 | $(GCC_HOST_EXPORTS) \ | |
1622 | echo "Bootstrapping the compiler"; \ | |
1623 | $(MAKE) stageprofile-bubble distclean-stagefeedback stageprofile-start | |
1624 | @r=`${PWD_COMMAND}`; export r; \ | |
1625 | s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ | |
1626 | $(SET_LIB_PATH) \ | |
1627 | echo "Building runtime libraries and training compiler"; \ | |
1628 | $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all | |
1629 | @r=`${PWD_COMMAND}`; export r; \ | |
1630 | s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ | |
1631 | $(SET_LIB_PATH) \ | |
1632 | $(GCC_HOST_EXPORTS) \ | |
1633 | echo "Building feedback based compiler"; \ | |
1634 | $(MAKE) stagefeedback-bubble stagefeedback-end | |
1635 | ||
319cab08 | 1636 | @endif gcc-bootstrap |
b8908782 | 1637 | |
ae831be5 NN |
1638 | # -------------------------------------- |
1639 | # Dependencies between different modules | |
1640 | # -------------------------------------- | |
405ea7a0 | 1641 | |
ae831be5 NN |
1642 | # There are two types of dependencies here: 'hard' dependencies, where one |
1643 | # module simply won't build without the other; and 'soft' dependencies, where | |
1644 | # if the depended-on module is missing, the depending module will do without | |
1645 | # or find a substitute somewhere (perhaps installed). Soft dependencies | |
1646 | # are specified by depending on a 'maybe-' target. If you're not sure, | |
1647 | # it's safer to use a soft dependency. | |
1648 | ||
1649 | # Host modules specific to gcc. | |
e2b9e2dc | 1650 | # GCC needs to identify certain tools. |
e5c3f801 NN |
1651 | # GCC also needs the information exported by the intl configure script. |
1652 | configure-gcc: maybe-configure-intl maybe-configure-binutils maybe-configure-gas maybe-configure-ld maybe-configure-bison maybe-configure-flex | |
04cf1b77 PB |
1653 | all-gcc: maybe-all-libiberty maybe-all-intl maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib maybe-all-libbanshee maybe-all-libcpp |
1654 | configure-libcpp: maybe-configure-libiberty maybe-configure-intl | |
1655 | all-libcpp: maybe-all-libiberty maybe-all-intl | |
ae831be5 NN |
1656 | # This is a slightly kludgy method of getting dependencies on |
1657 | # all-build-libiberty correct; it would be better to build it every time. | |
04cf1b77 | 1658 | all-gcc: maybe-all-build-libiberty |
b8908782 | 1659 | all-bootstrap: [+ FOR host_modules +][+ IF bootstrap +]maybe-all-[+module+] [+ ENDIF bootstrap +][+ ENDFOR host_modules +] |
ae831be5 NN |
1660 | |
1661 | # Host modules specific to gdb. | |
e2b9e2dc | 1662 | # GDB needs to know that the simulator is being built. |
8f32e830 | 1663 | configure-gdb: maybe-configure-itcl maybe-configure-tcl maybe-configure-tk maybe-configure-sim |
ae831be5 NN |
1664 | GDB_TK = @GDB_TK@ |
1665 | all-gdb: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-mmalloc maybe-all-readline maybe-all-bison maybe-all-byacc maybe-all-sim $(gdbnlmrequirements) $(GDB_TK) | |
1666 | install-gdb: maybe-install-tcl maybe-install-tk maybe-install-itcl maybe-install-tix maybe-install-libgui | |
59da4fe6 | 1667 | configure-libgui: maybe-configure-tcl maybe-configure-tk |
ae831be5 NN |
1668 | all-libgui: maybe-all-tcl maybe-all-tk maybe-all-itcl |
1669 | ||
1670 | # Host modules specific to binutils. | |
b4a77b47 | 1671 | configure-bfd: configure-libiberty |
930314a4 NN |
1672 | all-bfd: maybe-all-libiberty maybe-all-intl |
1673 | all-binutils: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-flex maybe-all-bison maybe-all-byacc maybe-all-intl | |
ae831be5 NN |
1674 | # We put install-opcodes before install-binutils because the installed |
1675 | # binutils might be on PATH, and they might need the shared opcodes | |
1676 | # library. | |
1677 | install-binutils: maybe-install-opcodes | |
cf662e21 AJ |
1678 | # libopcodes depends on libbfd |
1679 | install-opcodes: maybe-install-bfd | |
ae831be5 NN |
1680 | all-gas: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-intl |
1681 | all-gprof: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-intl | |
1682 | all-ld: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-bison maybe-all-byacc maybe-all-flex maybe-all-intl | |
1683 | all-opcodes: maybe-all-bfd maybe-all-libiberty | |
1684 | ||
1685 | # Other host modules in the 'src' repository. | |
930314a4 | 1686 | all-dejagnu: maybe-all-tcl maybe-all-expect maybe-all-tk |
b4a77b47 | 1687 | configure-expect: maybe-configure-tcl maybe-configure-tk |
930314a4 | 1688 | all-expect: maybe-all-tcl maybe-all-tk |
b4a77b47 | 1689 | configure-itcl: maybe-configure-tcl maybe-configure-tk |
ae831be5 NN |
1690 | all-itcl: maybe-all-tcl maybe-all-tk |
1691 | # We put install-tcl before install-itcl because itcl wants to run a | |
1692 | # program on installation which uses the Tcl libraries. | |
1693 | install-itcl: maybe-install-tcl | |
122bfa92 | 1694 | all-sid: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-tcl maybe-all-tk |
ae831be5 | 1695 | install-sid: maybe-install-tcl maybe-install-tk |
a36d530e | 1696 | all-sim: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-readline maybe-configure-gdb |
b4a77b47 | 1697 | configure-tk: maybe-configure-tcl |
ae831be5 | 1698 | all-tk: maybe-all-tcl |
b4a77b47 | 1699 | configure-tix: maybe-configure-tcl maybe-configure-tk |
ae831be5 NN |
1700 | all-tix: maybe-all-tcl maybe-all-tk |
1701 | all-texinfo: maybe-all-libiberty | |
1702 | ||
1703 | # Other host modules. Warning, these are not well tested. | |
1704 | all-autoconf: maybe-all-m4 maybe-all-texinfo | |
1705 | all-automake: maybe-all-m4 maybe-all-texinfo | |
1706 | all-bison: maybe-all-texinfo | |
1707 | all-diff: maybe-all-libiberty | |
1708 | all-fastjar: maybe-all-zlib maybe-all-libiberty | |
930314a4 NN |
1709 | all-fileutils: maybe-all-libiberty |
1710 | all-flex: maybe-all-libiberty maybe-all-bison maybe-all-byacc | |
930314a4 NN |
1711 | all-gzip: maybe-all-libiberty |
1712 | all-hello: maybe-all-libiberty | |
930314a4 | 1713 | all-m4: maybe-all-libiberty maybe-all-texinfo |
b9abda6a | 1714 | all-make: maybe-all-libiberty maybe-all-intl |
930314a4 NN |
1715 | all-patch: maybe-all-libiberty |
1716 | all-prms: maybe-all-libiberty | |
930314a4 NN |
1717 | all-recode: maybe-all-libiberty |
1718 | all-sed: maybe-all-libiberty | |
1719 | all-send-pr: maybe-all-prms | |
930314a4 | 1720 | all-tar: maybe-all-libiberty |
930314a4 | 1721 | all-uudecode: maybe-all-libiberty |
ae831be5 NN |
1722 | |
1723 | ALL_GCC = maybe-all-gcc | |
1724 | ALL_GCC_C = $(ALL_GCC) maybe-all-target-newlib maybe-all-target-libgloss | |
1725 | ALL_GCC_CXX = $(ALL_GCC_C) maybe-all-target-libstdc++-v3 | |
1726 | ||
1727 | # Target modules specific to gcc. | |
b4a77b47 DD |
1728 | configure-target-boehm-gc: $(ALL_GCC_C) maybe-configure-target-qthreads |
1729 | configure-target-fastjar: maybe-configure-target-zlib | |
930314a4 | 1730 | all-target-fastjar: maybe-all-target-zlib maybe-all-target-libiberty |
3dee29da | 1731 | configure-target-libada: $(ALL_GCC_C) |
4b1cb4fe | 1732 | configure-target-libgfortran: $(ALL_GCC_C) |
b4a77b47 DD |
1733 | configure-target-libffi: $(ALL_GCC_C) |
1734 | configure-target-libjava: $(ALL_GCC_C) maybe-configure-target-zlib maybe-configure-target-boehm-gc maybe-configure-target-qthreads maybe-configure-target-libffi | |
ae831be5 | 1735 | all-target-libjava: maybe-all-fastjar maybe-all-target-zlib maybe-all-target-boehm-gc maybe-all-target-qthreads maybe-all-target-libffi |
b4a77b47 | 1736 | configure-target-libobjc: $(ALL_GCC_C) |
ae831be5 | 1737 | all-target-libobjc: maybe-all-target-libiberty |
b4a77b47 | 1738 | configure-target-libstdc++-v3: $(ALL_GCC_C) |
ae831be5 | 1739 | all-target-libstdc++-v3: maybe-all-target-libiberty |
b4a77b47 | 1740 | configure-target-zlib: $(ALL_GCC_C) |
a9590527 | 1741 | |
ae831be5 | 1742 | # Target modules in the 'src' repository. |
b4a77b47 DD |
1743 | configure-target-examples: $(ALL_GCC_C) |
1744 | configure-target-libgloss: $(ALL_GCC) | |
ae831be5 | 1745 | all-target-libgloss: maybe-configure-target-newlib |
3a12db16 | 1746 | configure-target-libiberty: $(ALL_GCC) |
b4a77b47 DD |
1747 | configure-target-libtermcap: $(ALL_GCC_C) |
1748 | configure-target-newlib: $(ALL_GCC) | |
7dda0df6 | 1749 | configure-target-rda: $(ALL_GCC_C) |
b4a77b47 | 1750 | configure-target-winsup: $(ALL_GCC_C) |
ae831be5 | 1751 | all-target-winsup: maybe-all-target-libiberty maybe-all-target-libtermcap |
a9590527 | 1752 | |
ae831be5 | 1753 | # Other target modules. Warning, these are not well tested. |
b4a77b47 | 1754 | configure-target-gperf: $(ALL_GCC_CXX) |
ae831be5 | 1755 | all-target-gperf: maybe-all-target-libiberty maybe-all-target-libstdc++-v3 |
b4a77b47 | 1756 | configure-target-qthreads: $(ALL_GCC_C) |
907a7241 | 1757 | |
a2cc058a NN |
1758 | # Serialization dependencies. Host configures don't work well in parallel to |
1759 | # each other, due to contention over config.cache. Target configures and | |
1760 | # build configures are similar. | |
1761 | @serialization_dependencies@ | |
1762 | ||
15723a45 NN |
1763 | # -------------------------------- |
1764 | # Regenerating top level configury | |
1765 | # -------------------------------- | |
405ea7a0 | 1766 | |
1086bc09 NN |
1767 | # Multilib.out tells target dirs what multilibs they should build. |
1768 | # There is really only one copy. We use the 'timestamp' method to | |
1769 | # work around various timestamp bugs on some systems. | |
1770 | # We use move-if-change so that it's only considered updated when it | |
1771 | # actually changes, because it has to depend on a phony target. | |
e6bfb94a | 1772 | multilib.out: maybe-all-gcc |
b40e3958 | 1773 | @r=`${PWD_COMMAND}`; export r; \ |
1086bc09 NN |
1774 | echo "Checking multilib configuration..."; \ |
1775 | $(CC_FOR_TARGET) --print-multi-lib > multilib.tmp 2> /dev/null ; \ | |
1776 | $(SHELL) $(srcdir)/move-if-change multilib.tmp multilib.out ; \ | |
1086bc09 | 1777 | |
405ea7a0 | 1778 | # Rebuilding Makefile.in, using autogen. |
43be203f | 1779 | AUTOGEN = autogen |
6b784d9f | 1780 | $(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def |
43be203f | 1781 | cd $(srcdir) && $(AUTOGEN) Makefile.def |
405ea7a0 | 1782 | |
a0da8069 | 1783 | # Rebuilding Makefile. |
43be203f AO |
1784 | Makefile: $(srcdir)/Makefile.in config.status |
1785 | CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status | |
1786 | ||
1787 | config.status: configure $(gcc_version_trigger) | |
10ecffb9 | 1788 | CONFIG_SHELL="$(SHELL)" $(SHELL) ./config.status --recheck |
405ea7a0 | 1789 | |
a0da8069 | 1790 | # Rebuilding configure. |
43be203f | 1791 | AUTOCONF = autoconf |
6b784d9f | 1792 | $(srcdir)/configure: @MAINT@ $(srcdir)/configure.in $(srcdir)/config/acx.m4 |
43be203f | 1793 | cd $(srcdir) && $(AUTOCONF) |
405ea7a0 | 1794 | |
3728fade NN |
1795 | # ------------------------------ |
1796 | # Special directives to GNU Make | |
1797 | # ------------------------------ | |
1798 | ||
3728fade NN |
1799 | # Don't pass command-line variables to submakes. |
1800 | .NOEXPORT: | |
1801 | MAKEOVERRIDES= | |
1802 | ||
405ea7a0 | 1803 | # end of Makefile.in |