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