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