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