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