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