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