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