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