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