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