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