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