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