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