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