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