]>
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, | |
61b56b2e | 9 | # 1999, 2000, 2001, 2002, 2003 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 | |
23 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
24 | # | |
25 | ||
4977bab6 ZW |
26 | VPATH=@srcdir@ |
27 | links=@configlinks@ | |
28 | ||
29 | build_alias=@build_alias@ | |
30 | build_cpu=@build_cpu@ | |
31 | build_vendor=@build_vendor@ | |
32 | build_os=@build_os@ | |
33 | build_canonical=@build_cpu@-@build_vendor@-@build_os@ | |
34 | host_alias=@host_alias@ | |
35 | host_cpu=@host_cpu@ | |
36 | host_vendor=@host_vendor@ | |
37 | host_os=@host_os@ | |
38 | host_canonical=@host_cpu@-@host_vendor@-@host_os@ | |
39 | target_alias=@target_alias@ | |
40 | target_cpu=@target_cpu@ | |
41 | target_vendor=@target_vendor@ | |
42 | target_os=@target_os@ | |
43 | target_canonical=@target_cpu@-@target_vendor@-@target_os@ | |
44 | ||
45 | enable_shared = @enable_shared@ | |
46 | enable_threads = @enable_threads@ | |
47 | enable_version_specific_runtime_libs = @enable_version_specific_runtime_libs@ | |
48 | # The file containing GCC's version number. | |
49 | gcc_version_trigger = @gcc_version_trigger@ | |
50 | gcc_version = @gcc_version@ | |
51 | ||
3dfabf63 NN |
52 | # The gcc driver likes to know the arguments it was configured with. |
53 | TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@ | |
54 | ||
0dffceed NN |
55 | srcdir = @srcdir@ |
56 | ||
57 | prefix = @prefix@ | |
58 | exec_prefix = @exec_prefix@ | |
59 | ||
60 | bindir = @bindir@ | |
61 | sbindir = @sbindir@ | |
62 | libexecdir = @libexecdir@ | |
63 | datadir = @datadir@ | |
64 | sysconfdir = @sysconfdir@ | |
65 | sharedstatedir = @sharedstatedir@ | |
66 | localstatedir = @localstatedir@ | |
67 | libdir = @libdir@ | |
68 | includedir = @includedir@ | |
69 | oldincludedir = @oldincludedir@ | |
70 | infodir = @infodir@ | |
71 | mandir = @mandir@ | |
f0895142 AS |
72 | gxx_include_dir = @gxx_include_dir@ |
73 | libstdcxx_incdir = @libstdcxx_incdir@ | |
95ddd785 | 74 | |
0dffceed NN |
75 | tooldir = @tooldir@ |
76 | build_tooldir = @build_tooldir@ | |
95ddd785 | 77 | |
0dffceed | 78 | program_transform_name = @program_transform_name@ |
95ddd785 NN |
79 | |
80 | man1dir = $(mandir)/man1 | |
81 | man2dir = $(mandir)/man2 | |
82 | man3dir = $(mandir)/man3 | |
83 | man4dir = $(mandir)/man4 | |
84 | man5dir = $(mandir)/man5 | |
85 | man6dir = $(mandir)/man6 | |
86 | man7dir = $(mandir)/man7 | |
87 | man8dir = $(mandir)/man8 | |
88 | man9dir = $(mandir)/man9 | |
95ddd785 NN |
89 | # Directory in which the compiler finds executables, libraries, etc. |
90 | libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version) | |
91 | GDB_NLM_DEPS = | |
92 | ||
0dffceed | 93 | SHELL = @config_shell@ |
95ddd785 NN |
94 | |
95 | # pwd command to use. Allow user to override default by setting PWDCMD in | |
96 | # the environment to account for automounters. The make variable must not | |
97 | # be called PWDCMD, otherwise the value set here is passed to make | |
98 | # subprocesses and overrides the setting from the user's environment. | |
99 | PWD = $${PWDCMD-pwd} | |
100 | ||
101 | # INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a | |
102 | # cygwin host. | |
103 | INSTALL_PROGRAM_ARGS = | |
104 | ||
105 | INSTALL = $(SHELL) $$s/install-sh -c | |
106 | INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS) | |
107 | INSTALL_SCRIPT = $(INSTALL) | |
108 | INSTALL_DATA = $(INSTALL) -m 644 | |
109 | ||
4977bab6 ZW |
110 | AS = @AS@ |
111 | AR = @AR@ | |
95ddd785 | 112 | AR_FLAGS = rc |
70f91f50 | 113 | RANLIB = @RANLIB@ |
4977bab6 | 114 | CC = @CC@ |
95ddd785 NN |
115 | |
116 | # Special variables passed down in EXTRA_GCC_FLAGS. They are defined | |
117 | # here so that they can be overridden by Makefile fragments. | |
4977bab6 ZW |
118 | BUILD_CC = $(CC_FOR_BUILD) |
119 | BUILD_PREFIX = @BUILD_PREFIX@ | |
120 | BUILD_PREFIX_1 = @BUILD_PREFIX_1@ | |
95ddd785 | 121 | |
4977bab6 ZW |
122 | CFLAGS = @CFLAGS@ |
123 | CXXFLAGS = @CXXFLAGS@ | |
95ddd785 NN |
124 | |
125 | LDFLAGS = | |
126 | LIBCFLAGS = $(CFLAGS) | |
127 | CFLAGS_FOR_BUILD = $(CFLAGS) | |
128 | # During gcc bootstrap, if we use some random cc for stage1 then | |
129 | # CFLAGS will be just -g. We want to ensure that TARGET libraries | |
130 | # (which we know are built with gcc) are built with optimizations so | |
131 | # prepend -O2 when setting CFLAGS_FOR_TARGET. | |
132 | CFLAGS_FOR_TARGET = -O2 $(CFLAGS) | |
133 | LDFLAGS_FOR_TARGET = | |
134 | LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) | |
135 | PICFLAG = | |
136 | PICFLAG_FOR_TARGET = | |
137 | ||
4977bab6 | 138 | CXX = @CXX@ |
95ddd785 NN |
139 | |
140 | # Use -O2 to stress test the compiler. | |
141 | LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates | |
142 | CXXFLAGS_FOR_TARGET = $(CXXFLAGS) | |
143 | LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates | |
144 | ||
4977bab6 ZW |
145 | DLLTOOL = @DLLTOOL@ |
146 | WINDRES = @WINDRES@ | |
95ddd785 | 147 | |
4977bab6 | 148 | NM = @NM@ |
95ddd785 | 149 | |
4977bab6 | 150 | LD = @LD@ |
95ddd785 | 151 | |
95ddd785 | 152 | # These values are substituted by configure. |
0dffceed NN |
153 | DEFAULT_YACC = @DEFAULT_YACC@ |
154 | DEFAULT_LEX = @DEFAULT_LEX@ | |
155 | DEFAULT_M4 = @DEFAULT_M4@ | |
95ddd785 | 156 | |
4977bab6 ZW |
157 | BISON=@BISON@ |
158 | USUAL_BISON = `if [ -f $$r/bison/bison ] ; then \ | |
95ddd785 NN |
159 | echo $$r/bison/bison -L $$s/bison/ ; \ |
160 | else \ | |
161 | echo bison ; \ | |
162 | fi` | |
163 | ||
4977bab6 ZW |
164 | YACC=@YACC@ |
165 | USUAL_YACC = `if [ -f $$r/bison/bison ] ; then \ | |
95ddd785 NN |
166 | echo $$r/bison/bison -y -L $$s/bison/ ; \ |
167 | elif [ -f $$r/byacc/byacc ] ; then \ | |
168 | echo $$r/byacc/byacc ; \ | |
169 | else \ | |
170 | echo ${DEFAULT_YACC} ; \ | |
171 | fi` | |
172 | ||
4977bab6 ZW |
173 | LEX=@LEX@ |
174 | USUAL_LEX = `if [ -f $$r/flex/flex ] ; \ | |
95ddd785 NN |
175 | then echo $$r/flex/flex ; \ |
176 | else echo ${DEFAULT_LEX} ; fi` | |
177 | ||
178 | M4 = `if [ -f $$r/m4/m4 ] ; \ | |
179 | then echo $$r/m4/m4 ; \ | |
180 | else echo ${DEFAULT_M4} ; fi` | |
181 | ||
182 | # For an installed makeinfo, we require it to be from texinfo 4 or | |
183 | # higher, else we use the "missing" dummy. | |
4977bab6 ZW |
184 | MAKEINFO=@MAKEINFO@ |
185 | USUAL_MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \ | |
95ddd785 NN |
186 | then echo $$r/texinfo/makeinfo/makeinfo ; \ |
187 | else if (makeinfo --version \ | |
188 | | egrep 'texinfo[^0-9]*([1-3][0-9]|[4-9])') >/dev/null 2>&1; \ | |
189 | then echo makeinfo; else echo $$s/missing makeinfo; fi; fi` | |
190 | ||
191 | # This just becomes part of the MAKEINFO definition passed down to | |
192 | # sub-makes. It lets flags be given on the command line while still | |
193 | # using the makeinfo from the object tree. | |
194 | MAKEINFOFLAGS = | |
195 | ||
196 | EXPECT = `if [ -f $$r/expect/expect ] ; \ | |
197 | then echo $$r/expect/expect ; \ | |
198 | else echo expect ; fi` | |
199 | ||
200 | RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \ | |
201 | then echo $$s/dejagnu/runtest ; \ | |
202 | else echo runtest ; fi` | |
203 | ||
204 | ||
205 | # compilers to use to create programs which must be run in the build | |
206 | # environment. | |
4977bab6 | 207 | CC_FOR_BUILD = @CC_FOR_BUILD@ |
95ddd785 NN |
208 | CXX_FOR_BUILD = $(CXX) |
209 | ||
dd30b57d | 210 | SUBDIRS = @configdirs@ |
95ddd785 NN |
211 | |
212 | # This is set by the configure script to the list of directories which | |
213 | # should be built using the target tools. | |
ec0461f6 | 214 | TARGET_CONFIGDIRS = @target_configdirs@ |
95ddd785 NN |
215 | |
216 | # Target libraries are put under this directory: | |
217 | # Changed by configure to $(target_alias) if cross. | |
ec0461f6 | 218 | TARGET_SUBDIR = @target_subdir@ |
95ddd785 NN |
219 | |
220 | BUILD_CONFIGDIRS = libiberty | |
ec0461f6 | 221 | BUILD_SUBDIR = @build_subdir@ |
95ddd785 | 222 | |
95ddd785 NN |
223 | # This is set by the configure script to the arguments to use when configuring |
224 | # directories built for the build system. | |
ec0461f6 | 225 | BUILD_CONFIGARGS = @build_configargs@ |
95ddd785 | 226 | |
4977bab6 ZW |
227 | # This is set by the configure script to the arguments to use when configuring |
228 | # directories built for the host system. | |
229 | HOST_CONFIGARGS = @host_configargs@ | |
230 | ||
231 | # This is set by the configure script to the arguments to use when configuring | |
232 | # directories built for the target. | |
233 | TARGET_CONFIGARGS = @target_configargs@ | |
234 | ||
95ddd785 NN |
235 | # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared |
236 | # was used. | |
aba8a494 | 237 | SET_LIB_PATH = @SET_LIB_PATH@ |
95ddd785 NN |
238 | |
239 | # This is the name of the environment variable used for the path to | |
240 | # the libraries. This may be changed by configure.in. | |
fe3d5b7f | 241 | RPATH_ENVVAR = @RPATH_ENVVAR@ |
95ddd785 NN |
242 | |
243 | # This is the list of directories that may be needed in RPATH_ENVVAR | |
244 | # so that programs built for the host machine work. | |
245 | HOST_LIB_PATH = $$r/bfd:$$r/opcodes | |
246 | ||
247 | # This is the list of directories that may be needed in RPATH_ENVVAR | |
248 | # so that prorgams built for the target machine work. | |
249 | TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs: | |
250 | ||
251 | # configure.in sets SET_LIB_PATH to this if --enable-shared was used. | |
252 | # Some platforms don't like blank entries, so we remove duplicate, | |
253 | # leading and trailing colons. | |
254 | REALLY_SET_LIB_PATH = \ | |
255 | $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); | |
256 | ||
95ddd785 | 257 | # Should be substed by configure.in |
ec0461f6 NN |
258 | FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@ |
259 | CC_FOR_TARGET = @CC_FOR_TARGET@ | |
260 | CXX_FOR_TARGET = @CXX_FOR_TARGET@ | |
4977bab6 | 261 | RAW_CXX_FOR_TARGET = @RAW_CXX_FOR_TARGET@ |
ec0461f6 | 262 | CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@ |
4977bab6 | 263 | RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@ |
ec0461f6 | 264 | GCJ_FOR_TARGET = @GCJ_FOR_TARGET@ |
95ddd785 NN |
265 | |
266 | # If GCC_FOR_TARGET is not overriden on the command line, then this | |
267 | # variable is passed down to the gcc Makefile, where it is used to | |
268 | # build libgcc2.a. We define it here so that it can itself be | |
269 | # overridden on the command line. | |
4977bab6 ZW |
270 | GCC_FOR_TARGET=@GCC_FOR_TARGET@ |
271 | USUAL_GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET) | |
95ddd785 | 272 | |
4977bab6 ZW |
273 | AS_FOR_TARGET=@AS_FOR_TARGET@ |
274 | USUAL_AS_FOR_TARGET = ` \ | |
95ddd785 NN |
275 | if [ -f $$r/gas/as-new ] ; then \ |
276 | echo $$r/gas/as-new ; \ | |
277 | elif [ -f $$r/gcc/xgcc ]; then \ | |
278 | $(CC_FOR_TARGET) -print-prog-name=as ; \ | |
279 | else \ | |
280 | if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ | |
281 | echo $(AS); \ | |
282 | else \ | |
e245b0ea | 283 | echo as | sed '$(program_transform_name)' ; \ |
95ddd785 NN |
284 | fi; \ |
285 | fi` | |
286 | ||
4977bab6 ZW |
287 | LD_FOR_TARGET=@LD_FOR_TARGET@ |
288 | USUAL_LD_FOR_TARGET = ` \ | |
95ddd785 NN |
289 | if [ -f $$r/ld/ld-new ] ; then \ |
290 | echo $$r/ld/ld-new ; \ | |
291 | elif [ -f $$r/gcc/xgcc ]; then \ | |
292 | $(CC_FOR_TARGET) -print-prog-name=ld ; \ | |
293 | else \ | |
294 | if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ | |
295 | echo $(LD); \ | |
296 | else \ | |
e245b0ea | 297 | echo ld | sed '$(program_transform_name)' ; \ |
95ddd785 NN |
298 | fi; \ |
299 | fi` | |
300 | ||
4977bab6 ZW |
301 | DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@ |
302 | USUAL_DLLTOOL_FOR_TARGET = ` \ | |
95ddd785 NN |
303 | if [ -f $$r/binutils/dlltool ] ; then \ |
304 | echo $$r/binutils/dlltool ; \ | |
305 | else \ | |
306 | if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ | |
307 | echo $(DLLTOOL); \ | |
308 | else \ | |
e245b0ea | 309 | echo dlltool | sed '$(program_transform_name)' ; \ |
95ddd785 NN |
310 | fi; \ |
311 | fi` | |
312 | ||
4977bab6 ZW |
313 | WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@ |
314 | USUAL_WINDRES_FOR_TARGET = ` \ | |
95ddd785 NN |
315 | if [ -f $$r/binutils/windres ] ; then \ |
316 | echo $$r/binutils/windres ; \ | |
317 | else \ | |
318 | if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ | |
319 | echo $(WINDRES); \ | |
320 | else \ | |
e245b0ea | 321 | echo windres | sed '$(program_transform_name)' ; \ |
95ddd785 NN |
322 | fi; \ |
323 | fi` | |
324 | ||
4977bab6 ZW |
325 | AR_FOR_TARGET=@AR_FOR_TARGET@ |
326 | USUAL_AR_FOR_TARGET = ` \ | |
95ddd785 NN |
327 | if [ -f $$r/binutils/ar ] ; then \ |
328 | echo $$r/binutils/ar ; \ | |
329 | else \ | |
330 | if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ | |
331 | echo $(AR); \ | |
332 | else \ | |
e245b0ea | 333 | echo ar | sed '$(program_transform_name)' ; \ |
95ddd785 NN |
334 | fi; \ |
335 | fi` | |
336 | ||
4977bab6 ZW |
337 | RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@ |
338 | USUAL_RANLIB_FOR_TARGET = ` \ | |
95ddd785 NN |
339 | if [ -f $$r/binutils/ranlib ] ; then \ |
340 | echo $$r/binutils/ranlib ; \ | |
341 | else \ | |
342 | if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ | |
343 | if [ x'$(RANLIB)' != x ]; then \ | |
344 | echo $(RANLIB); \ | |
345 | else \ | |
346 | echo ranlib; \ | |
347 | fi; \ | |
348 | else \ | |
e245b0ea | 349 | echo ranlib | sed '$(program_transform_name)' ; \ |
95ddd785 NN |
350 | fi; \ |
351 | fi` | |
352 | ||
4977bab6 ZW |
353 | NM_FOR_TARGET=@NM_FOR_TARGET@ |
354 | USUAL_NM_FOR_TARGET = ` \ | |
95ddd785 NN |
355 | if [ -f $$r/binutils/nm-new ] ; then \ |
356 | echo $$r/binutils/nm-new ; \ | |
357 | elif [ -f $$r/gcc/xgcc ]; then \ | |
358 | $(CC_FOR_TARGET) -print-prog-name=nm ; \ | |
359 | else \ | |
360 | if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ | |
361 | echo $(NM); \ | |
362 | else \ | |
e245b0ea | 363 | echo nm | sed '$(program_transform_name)' ; \ |
95ddd785 NN |
364 | fi; \ |
365 | fi` | |
366 | ||
367 | # The first rule in the file had better be this one. Don't put any above it. | |
368 | # This lives here to allow makefile fragments to contain dependencies. | |
369 | all: all.normal | |
370 | .PHONY: all | |
371 | ||
95ddd785 | 372 | #### host and target specific makefile fragments come in here. |
671aa708 NN |
373 | @target_makefile_frag@ |
374 | @alphaieee_frag@ | |
375 | @ospace_frag@ | |
376 | @host_makefile_frag@ | |
95ddd785 NN |
377 | ### |
378 | ||
379 | # Flags to pass down to all sub-makes. | |
380 | # Please keep these in alphabetical order. | |
381 | BASE_FLAGS_TO_PASS = \ | |
382 | "AR_FLAGS=$(AR_FLAGS)" \ | |
383 | "AR_FOR_TARGET=$(AR_FOR_TARGET)" \ | |
384 | "AS_FOR_TARGET=$(AS_FOR_TARGET)" \ | |
385 | "BISON=$(BISON)" \ | |
386 | "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ | |
387 | "CC_FOR_TARGET=$(CC_FOR_TARGET)" \ | |
388 | "CFLAGS=$(CFLAGS)" \ | |
389 | "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \ | |
390 | "GCJ_FOR_TARGET=$(GCJ_FOR_TARGET)" \ | |
391 | "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \ | |
392 | "CXXFLAGS=$(CXXFLAGS)" \ | |
393 | "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \ | |
394 | "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \ | |
3fbe8e4a | 395 | "DESTDIR=$(DESTDIR)" \ |
95ddd785 NN |
396 | "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \ |
397 | "INSTALL=$(INSTALL)" \ | |
398 | "INSTALL_DATA=$(INSTALL_DATA)" \ | |
399 | "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ | |
400 | "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ | |
401 | "LDFLAGS=$(LDFLAGS)" \ | |
402 | "LEX=$(LEX)" \ | |
403 | "LD_FOR_TARGET=$(LD_FOR_TARGET)" \ | |
404 | "LIBCFLAGS=$(LIBCFLAGS)" \ | |
405 | "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ | |
406 | "LIBCXXFLAGS=$(LIBCXXFLAGS)" \ | |
407 | "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \ | |
408 | "M4=$(M4)" \ | |
409 | "MAKE=$(MAKE)" \ | |
410 | "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \ | |
411 | "NM_FOR_TARGET=$(NM_FOR_TARGET)" \ | |
412 | "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \ | |
413 | "RPATH_ENVVAR=$(RPATH_ENVVAR)" \ | |
414 | "SHELL=$(SHELL)" \ | |
415 | "EXPECT=$(EXPECT)" \ | |
416 | "RUNTEST=$(RUNTEST)" \ | |
417 | "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ | |
418 | "TARGET_SUBDIR=$(TARGET_SUBDIR)" \ | |
419 | "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \ | |
420 | "YACC=$(YACC)" \ | |
421 | "bindir=$(bindir)" \ | |
422 | "datadir=$(datadir)" \ | |
423 | "exec_prefix=$(exec_prefix)" \ | |
424 | "includedir=$(includedir)" \ | |
425 | "infodir=$(infodir)" \ | |
426 | "libdir=$(libdir)" \ | |
427 | "libexecdir=$(libexecdir)" \ | |
428 | "lispdir=$(lispdir)" \ | |
429 | "libstdcxx_incdir=$(libstdcxx_incdir)" \ | |
430 | "libsubdir=$(libsubdir)" \ | |
431 | "localstatedir=$(localstatedir)" \ | |
432 | "mandir=$(mandir)" \ | |
433 | "oldincludedir=$(oldincludedir)" \ | |
434 | "prefix=$(prefix)" \ | |
435 | "sbindir=$(sbindir)" \ | |
436 | "sharedstatedir=$(sharedstatedir)" \ | |
437 | "sysconfdir=$(sysconfdir)" \ | |
438 | "tooldir=$(tooldir)" \ | |
439 | "build_tooldir=$(build_tooldir)" \ | |
440 | "gxx_include_dir=$(gxx_include_dir)" \ | |
441 | "gcc_version=$(gcc_version)" \ | |
442 | "gcc_version_trigger=$(gcc_version_trigger)" \ | |
443 | "target_alias=$(target_alias)" | |
444 | ||
445 | # For any flags above that may contain shell code that varies from one | |
446 | # target library to another. When doing recursive invocations of the | |
447 | # top-level Makefile, we don't want the outer make to evaluate them, | |
448 | # so we pass these variables down unchanged. They must not contain | |
449 | # single nor double quotes. | |
450 | RECURSE_FLAGS = \ | |
4977bab6 ZW |
451 | CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \ |
452 | RAW_CXX_FOR_TARGET='$(RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \ | |
95ddd785 NN |
453 | |
454 | # Flags to pass down to most sub-makes, in which we're building with | |
455 | # the host environment. | |
456 | # If any variables are added here, they must be added to do-*, below. | |
457 | EXTRA_HOST_FLAGS = \ | |
458 | 'AR=$(AR)' \ | |
459 | 'AS=$(AS)' \ | |
460 | 'CC=$(CC)' \ | |
461 | 'CXX=$(CXX)' \ | |
462 | 'DLLTOOL=$(DLLTOOL)' \ | |
463 | 'LD=$(LD)' \ | |
464 | 'NM=$(NM)' \ | |
465 | "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \ | |
466 | 'WINDRES=$(WINDRES)' | |
467 | ||
468 | FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) | |
469 | ||
470 | # Flags that are concerned with the location of the X11 include files | |
471 | # and library files | |
472 | # | |
473 | # NOTE: until the top-level is getting the values via autoconf, it only | |
474 | # causes problems to have this top-level Makefile overriding the autoconf-set | |
475 | # values in child directories. Only variables that don't conflict with | |
476 | # autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now. | |
477 | # | |
478 | X11_FLAGS_TO_PASS = \ | |
479 | 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \ | |
480 | 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)' | |
481 | ||
482 | # Flags to pass down to makes which are built with the target environment. | |
483 | # The double $ decreases the length of the command line; the variables | |
484 | # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. | |
485 | # If any variables are added here, they must be added to do-*, below. | |
486 | EXTRA_TARGET_FLAGS = \ | |
487 | 'AR=$$(AR_FOR_TARGET)' \ | |
488 | 'AS=$$(AS_FOR_TARGET)' \ | |
489 | 'CC=$$(CC_FOR_TARGET)' \ | |
490 | 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \ | |
491 | 'CXX=$$(CXX_FOR_TARGET)' \ | |
492 | 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \ | |
493 | 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \ | |
494 | 'LD=$$(LD_FOR_TARGET)' \ | |
495 | 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \ | |
496 | 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \ | |
497 | 'NM=$$(NM_FOR_TARGET)' \ | |
498 | 'RANLIB=$$(RANLIB_FOR_TARGET)' \ | |
499 | 'WINDRES=$$(WINDRES_FOR_TARGET)' | |
500 | ||
501 | TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) | |
502 | ||
503 | # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it | |
504 | # unfortunately needs the native compiler and the target ar and | |
505 | # ranlib. | |
506 | # If any variables are added here, they must be added to do-*, below. | |
507 | # The HOST_* variables are a special case, which are used for the gcc | |
508 | # cross-building scheme. | |
509 | EXTRA_GCC_FLAGS = \ | |
510 | 'AR=$(AR)' \ | |
511 | 'AS=$(AS)' \ | |
512 | 'CC=$(CC)' \ | |
513 | 'CXX=$(CXX)' \ | |
514 | 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \ | |
4977bab6 | 515 | 'BUILD_CC=$(CC_FOR_BUILD)' \ |
95ddd785 NN |
516 | 'BUILD_PREFIX=$(BUILD_PREFIX)' \ |
517 | 'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \ | |
518 | 'NM=$(NM)' \ | |
519 | "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \ | |
520 | 'WINDRES=$$(WINDRES_FOR_TARGET)' \ | |
521 | "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \ | |
522 | "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ | |
523 | "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s/.*=$$/XFOO=/`" \ | |
524 | "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s/.*=$$/XFOO=/`" \ | |
525 | "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s/.*=$$/XFOO=/`" \ | |
526 | "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ | |
527 | "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ | |
528 | "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \ | |
529 | "`echo 'ENQUIRE=$(ENQUIRE)' | sed -e s/.*=$$/XFOO=/`" \ | |
530 | "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ | |
531 | "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" | |
532 | ||
533 | GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) | |
534 | ||
4977bab6 ZW |
535 | configure-host: @configure_host_modules@ |
536 | configure-target: @configure_target_modules@ | |
95ddd785 NN |
537 | |
538 | # This is a list of the targets for which we can do a clean-{target}. | |
d3ac17c9 BK |
539 | CLEAN_MODULES =[+ |
540 | FOR host_modules +][+ | |
4977bab6 | 541 | IF (not (or (exist? "no_clean") (exist? "with_x"))) +] \ |
d3ac17c9 BK |
542 | clean-[+module+][+ |
543 | ENDIF no_clean +][+ | |
544 | ENDFOR host_modules +] | |
95ddd785 NN |
545 | |
546 | # All of the target modules that can be cleaned | |
d3ac17c9 BK |
547 | CLEAN_TARGET_MODULES =[+ |
548 | FOR target_modules +][+ | |
549 | IF (not (exist? "no_clean")) +] \ | |
550 | clean-target-[+module+][+ | |
551 | ENDIF no_clean +][+ | |
552 | ENDFOR target_modules +] | |
95ddd785 NN |
553 | |
554 | # All of the x11 modules that can be cleaned | |
4977bab6 ZW |
555 | CLEAN_X11_MODULES = [+ FOR host_modules +][+ IF with_x +]\ |
556 | clean-[+module+] [+ ENDIF with_x +][+ ENDFOR host_modules +] | |
95ddd785 NN |
557 | |
558 | # The target built for a native build. | |
4977bab6 | 559 | # This list only includes modules actually being configured and built. |
95ddd785 | 560 | .PHONY: all.normal |
4977bab6 ZW |
561 | all.normal: @all_build_modules@ \ |
562 | @all_host_modules@ \ | |
563 | @all_target_modules@ | |
564 | ||
565 | all-host: @all_host_modules@ | |
566 | all-target: @all_target_modules@ | |
95ddd785 NN |
567 | |
568 | # Do a target for all the subdirectories. A ``make do-X'' will do a | |
569 | # ``make X'' in all subdirectories (because, in general, there is a | |
570 | # dependency (below) of X upon do-X, a ``make X'' will also do this, | |
571 | # but it may do additional work as well). | |
572 | # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once, | |
573 | # because it is so large that it can easily overflow the command line | |
574 | # length limit on some systems. | |
4977bab6 ZW |
575 | [+ FOR recursive_targets +] |
576 | .PHONY: do-[+target+] | |
577 | do-[+target+]: | |
578 | @r=`${PWD}`; export r; \ | |
95ddd785 NN |
579 | s=`cd $(srcdir); ${PWD}`; export s; \ |
580 | $(SET_LIB_PATH) \ | |
581 | for i in $(SUBDIRS) -dummy-; do \ | |
582 | if [ -f ./$$i/Makefile ]; then \ | |
583 | case $$i in \ | |
584 | gcc) \ | |
585 | for flag in $(EXTRA_GCC_FLAGS); do \ | |
586 | eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | |
587 | done; \ | |
588 | ;; \ | |
589 | *) \ | |
590 | for flag in $(EXTRA_HOST_FLAGS); do \ | |
591 | eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | |
592 | done; \ | |
593 | ;; \ | |
594 | esac ; \ | |
88b5521b | 595 | (cd ./$$i && \ |
95ddd785 NN |
596 | $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ |
597 | "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | |
598 | "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ | |
599 | "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ | |
88b5521b NN |
600 | [+target+]) \ |
601 | || exit 1; \ | |
95ddd785 NN |
602 | else true; fi; \ |
603 | done | |
4977bab6 | 604 | # Break into two pieces |
95ddd785 NN |
605 | r=`${PWD}`; export r; \ |
606 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
607 | $(SET_LIB_PATH) \ | |
608 | for i in $(TARGET_CONFIGDIRS) -dummy-; do \ | |
609 | if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \ | |
610 | for flag in $(EXTRA_TARGET_FLAGS); do \ | |
611 | eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ | |
612 | done; \ | |
88b5521b | 613 | (cd $(TARGET_SUBDIR)/$$i && \ |
95ddd785 NN |
614 | $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ |
615 | "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ | |
616 | "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ | |
617 | "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ | |
88b5521b NN |
618 | [+target+]) \ |
619 | || exit 1; \ | |
95ddd785 NN |
620 | else true; fi; \ |
621 | done | |
4977bab6 ZW |
622 | [+ ENDFOR recursive_targets +] |
623 | ||
95ddd785 NN |
624 | |
625 | # Here are the targets which correspond to the do-X targets. | |
626 | ||
627 | .PHONY: info installcheck dvi install-info | |
628 | .PHONY: clean distclean mostlyclean maintainer-clean realclean | |
629 | .PHONY: local-clean local-distclean local-maintainer-clean | |
630 | info: do-info | |
631 | installcheck: do-installcheck | |
632 | dvi: do-dvi | |
633 | ||
212f6dd0 NN |
634 | # Make sure makeinfo is built before we do a `make info', if we're |
635 | # in fact building texinfo. | |
636 | do-info: maybe-all-texinfo | |
95ddd785 NN |
637 | |
638 | install-info: do-install-info dir.info | |
639 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
640 | if [ -f dir.info ] ; then \ | |
3fbe8e4a | 641 | $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \ |
95ddd785 NN |
642 | else true ; fi |
643 | ||
644 | local-clean: | |
645 | -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log | |
646 | ||
647 | local-distclean: | |
648 | -rm -f Makefile config.status config.cache mh-frag mt-frag | |
ade82b16 | 649 | -rm -f multilib.out multilib.tmp maybedep.tmp serdep.tmp |
95ddd785 NN |
650 | -if [ "$(TARGET_SUBDIR)" != "." ]; then \ |
651 | rm -rf $(TARGET_SUBDIR); \ | |
652 | else true; fi | |
653 | -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile | |
654 | -rm -f texinfo/doc/Makefile texinfo/po/POTFILES | |
655 | -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null | |
656 | -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null | |
657 | -rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null | |
658 | ||
659 | local-maintainer-clean: | |
660 | @echo "This command is intended for maintainers to use;" | |
661 | @echo "it deletes files that may require special tools to rebuild." | |
662 | ||
663 | clean: do-clean local-clean | |
664 | mostlyclean: do-mostlyclean local-clean | |
665 | distclean: do-distclean local-clean local-distclean | |
666 | maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean | |
667 | maintainer-clean: local-distclean | |
668 | realclean: maintainer-clean | |
669 | ||
670 | # This rule is used to clean specific modules. | |
671 | .PHONY: $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc | |
672 | $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc: | |
673 | @dir=`echo $@ | sed -e 's/clean-//'`; \ | |
674 | if [ -f ./$${dir}/Makefile ] ; then \ | |
675 | r=`${PWD}`; export r; \ | |
676 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
677 | $(SET_LIB_PATH) \ | |
88b5521b | 678 | (cd $${dir} && $(MAKE) $(FLAGS_TO_PASS) clean); \ |
95ddd785 NN |
679 | else \ |
680 | true; \ | |
681 | fi | |
682 | ||
683 | .PHONY: $(CLEAN_TARGET_MODULES) | |
684 | $(CLEAN_TARGET_MODULES): | |
685 | @dir=`echo $@ | sed -e 's/clean-target-//'`; \ | |
686 | rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \ | |
687 | if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \ | |
688 | r=`${PWD}`; export r; \ | |
689 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
690 | $(SET_LIB_PATH) \ | |
88b5521b | 691 | (cd $(TARGET_SUBDIR)/$${dir} && $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \ |
95ddd785 NN |
692 | else \ |
693 | true; \ | |
694 | fi | |
695 | ||
696 | clean-target: $(CLEAN_TARGET_MODULES) clean-target-libgcc | |
697 | clean-target-libgcc: | |
698 | test ! -d gcc/libgcc || \ | |
699 | (cd gcc/libgcc && find . -type d -print) | \ | |
700 | while read d; do rm -f gcc/$$d/libgcc.a || : ; done | |
701 | -rm -rf gcc/libgcc | |
702 | ||
703 | # Check target. | |
704 | ||
705 | .PHONY: check do-check | |
706 | check: | |
707 | $(MAKE) do-check NOTPARALLEL=parallel-ok | |
708 | ||
4977bab6 ZW |
709 | # Only include modules actually being configured and built. |
710 | do-check: @check_host_modules@ \ | |
711 | @check_target_modules@ | |
95ddd785 NN |
712 | |
713 | # Automated reporting of test results. | |
714 | ||
715 | warning.log: build.log | |
716 | $(srcdir)/contrib/warn_summary build.log > $@ | |
717 | ||
718 | mail-report.log: | |
719 | if test x'$(BOOT_CFLAGS)' != x''; then \ | |
720 | BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \ | |
721 | fi; \ | |
722 | $(srcdir)/contrib/test_summary -t >$@ | |
723 | chmod +x $@ | |
724 | echo If you really want to send e-mail, run ./$@ now | |
725 | ||
726 | mail-report-with-warnings.log: warning.log | |
727 | if test x'$(BOOT_CFLAGS)' != x''; then \ | |
728 | BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \ | |
729 | fi; \ | |
730 | $(srcdir)/contrib/test_summary -t -i warning.log >$@ | |
731 | chmod +x $@ | |
732 | echo If you really want to send e-mail, run ./$@ now | |
733 | ||
734 | # Installation targets. | |
735 | ||
4977bab6 ZW |
736 | .PHONY: install uninstall |
737 | install: installdirs @install_host_modules@ @install_target_modules@ | |
738 | ||
739 | install-target: @install_target_modules@ | |
95ddd785 NN |
740 | |
741 | uninstall: | |
742 | @echo "the uninstall target is not supported in this tree" | |
743 | ||
95ddd785 NN |
744 | .PHONY: install.all |
745 | install.all: install-no-fixedincludes | |
746 | @if [ -f ./gcc/Makefile ] ; then \ | |
747 | r=`${PWD}` ; export r ; \ | |
748 | $(SET_LIB_PATH) \ | |
88b5521b | 749 | (cd ./gcc && \ |
95ddd785 NN |
750 | $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \ |
751 | else \ | |
752 | true ; \ | |
753 | fi | |
754 | ||
755 | # install-no-fixedincludes is used because Cygnus can not distribute | |
756 | # the fixed header files. | |
757 | .PHONY: install-no-fixedincludes | |
4977bab6 ZW |
758 | install-no-fixedincludes: installdirs @install_host_modules_nogcc@ \ |
759 | @install_target_modules@ gcc-no-fixedincludes | |
95ddd785 | 760 | |
4977bab6 | 761 | ### other supporting targets |
95ddd785 | 762 | |
4977bab6 ZW |
763 | MAKEDIRS= \ |
764 | $(DESTDIR)$(prefix) \ | |
765 | $(DESTDIR)$(exec_prefix) | |
766 | .PHONY: installdirs | |
767 | installdirs: mkinstalldirs | |
768 | $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS) | |
769 | ||
770 | dir.info: do-install-info | |
771 | if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \ | |
3fbe8e4a | 772 | $(srcdir)/texinfo/gen-info-dir $(DESTDIR)$(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \ |
4977bab6 ZW |
773 | mv -f dir.info.new dir.info ; \ |
774 | else true ; \ | |
95ddd785 NN |
775 | fi |
776 | ||
4977bab6 ZW |
777 | dist: |
778 | @echo "Building a full distribution of this tree isn't done" | |
779 | @echo "via 'make dist'. Check out the etc/ subdirectory" | |
780 | ||
781 | etags tags: TAGS | |
782 | ||
783 | # Right now this just builds TAGS in each subdirectory. emacs19 has the | |
784 | # ability to use several tags files at once, so there is probably no need | |
785 | # to combine them into one big TAGS file (like CVS 1.3 does). We could | |
786 | # (if we felt like it) have this Makefile write a piece of elisp which | |
787 | # the user could load to tell emacs19 where all the TAGS files we just | |
788 | # built are. | |
789 | TAGS: do-TAGS | |
790 | ||
4977bab6 ZW |
791 | # -------------------------------------- |
792 | # Modules which run on the build machine | |
793 | # -------------------------------------- | |
794 | [+ FOR build_modules +] | |
795 | .PHONY: configure-build-[+module+] maybe-configure-build-[+module+] | |
796 | maybe-configure-build-[+module+]: | |
ade82b16 AO |
797 | configure-build-[+module+]: |
798 | @test ! -f $(BUILD_SUBDIR)/[+module+]/Makefile || exit 0; \ | |
799 | [ -d $(BUILD_SUBDIR)/[+module+] ] || \ | |
800 | mkdir $(BUILD_SUBDIR)/[+module+];\ | |
95ddd785 NN |
801 | r=`${PWD}`; export r; \ |
802 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
803 | AR="$(AR_FOR_BUILD)"; export AR; \ | |
804 | AS="$(AS_FOR_BUILD)"; export AS; \ | |
805 | CC="$(CC_FOR_BUILD)"; export CC; \ | |
806 | CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ | |
807 | CXX="$(CXX_FOR_BUILD)"; export CXX; \ | |
808 | CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ | |
809 | GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \ | |
810 | DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \ | |
811 | LD="$(LD_FOR_BUILD)"; export LD; \ | |
812 | LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \ | |
813 | NM="$(NM_FOR_BUILD)"; export NM; \ | |
814 | RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \ | |
815 | WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \ | |
4977bab6 ZW |
816 | echo Configuring in $(BUILD_SUBDIR)/[+module+]; \ |
817 | cd "$(BUILD_SUBDIR)/[+module+]" || exit 1; \ | |
95ddd785 NN |
818 | case $(srcdir) in \ |
819 | /* | [A-Za-z]:[\\/]*) \ | |
820 | topdir=$(srcdir) ;; \ | |
821 | *) \ | |
822 | case "$(BUILD_SUBDIR)" in \ | |
823 | .) topdir="../$(srcdir)" ;; \ | |
824 | *) topdir="../../$(srcdir)" ;; \ | |
825 | esac ;; \ | |
826 | esac; \ | |
827 | if [ "$(srcdir)" = "." ] ; then \ | |
828 | if [ "$(BUILD_SUBDIR)" != "." ] ; then \ | |
4977bab6 | 829 | if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \ |
95ddd785 NN |
830 | if [ -f Makefile ]; then \ |
831 | if $(MAKE) distclean; then \ | |
832 | true; \ | |
833 | else \ | |
834 | exit 1; \ | |
835 | fi; \ | |
836 | else \ | |
837 | true; \ | |
838 | fi; \ | |
839 | else \ | |
840 | exit 1; \ | |
841 | fi; \ | |
842 | else \ | |
843 | true; \ | |
844 | fi; \ | |
845 | srcdiroption="--srcdir=."; \ | |
846 | libsrcdir="."; \ | |
847 | else \ | |
4977bab6 ZW |
848 | srcdiroption="--srcdir=$${topdir}/[+module+]"; \ |
849 | libsrcdir="$$s/[+module+]"; \ | |
95ddd785 | 850 | fi; \ |
4977bab6 ZW |
851 | rm -f no-such-file || : ; \ |
852 | CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ | |
853 | $(BUILD_CONFIGARGS) $${srcdiroption} \ | |
854 | --with-build-subdir="$(BUILD_SUBDIR)" \ | |
855 | || exit 1 | |
856 | ||
857 | .PHONY: all-build-[+module+] maybe-all-build-[+module+] | |
858 | maybe-all-build-[+module+]: | |
859 | all-build-[+module+]: configure-build-[+module+] | |
860 | @r=`${PWD}`; export r; \ | |
861 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
862 | (cd $(BUILD_SUBDIR)/[+module+] && $(MAKE) all) | |
863 | [+ ENDFOR build_modules +] | |
864 | ||
865 | # -------------------------------------- | |
866 | # Modules which run on the host machine | |
867 | # -------------------------------------- | |
868 | [+ FOR host_modules +] | |
869 | .PHONY: configure-[+module+] maybe-configure-[+module+] | |
870 | maybe-configure-[+module+]: | |
ade82b16 AO |
871 | configure-[+module+]: |
872 | @test ! -f [+module+]/Makefile || exit 0; \ | |
873 | [ -d [+module+] ] || mkdir [+module+]; \ | |
4977bab6 ZW |
874 | r=`${PWD}`; export r; \ |
875 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
876 | CC="$(CC)"; export CC; \ | |
877 | CFLAGS="$(CFLAGS)"; export CFLAGS; \ | |
878 | CXX="$(CXX)"; export CXX; \ | |
879 | CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ | |
880 | if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ | |
881 | AR="$(AR)"; export AR; \ | |
882 | AS="$(AS)"; export AS; \ | |
883 | CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ | |
884 | DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ | |
885 | LD="$(LD)"; export LD; \ | |
886 | NM="$(NM)"; export NM; \ | |
887 | RANLIB="$(RANLIB)"; export RANLIB; \ | |
888 | WINDRES="$(WINDRES)"; export WINDRES; \ | |
889 | OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ | |
890 | OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ | |
891 | fi; \ | |
892 | echo Configuring in [+module+]; \ | |
893 | cd [+module+] || exit 1; \ | |
894 | case $(srcdir) in \ | |
895 | \.) \ | |
896 | srcdiroption="--srcdir=."; \ | |
897 | libsrcdir=".";; \ | |
898 | /* | [A-Za-z]:[\\/]*) \ | |
899 | srcdiroption="--srcdir=$(srcdir)/[+module+]"; \ | |
900 | libsrcdir="$$s/[+module+]";; \ | |
901 | *) \ | |
902 | srcdiroption="--srcdir=../$(srcdir)/[+module+]"; \ | |
903 | libsrcdir="$$s/[+module+]";; \ | |
904 | esac; \ | |
905 | $(SHELL) $${libsrcdir}/configure \ | |
906 | $(HOST_CONFIGARGS) $${srcdiroption} \ | |
907 | || exit 1 | |
95ddd785 | 908 | |
4977bab6 ZW |
909 | .PHONY: all-[+module+] maybe-all-[+module+] |
910 | maybe-all-[+module+]: | |
911 | all-[+module+]: configure-[+module+] | |
912 | @r=`${PWD}`; export r; \ | |
95ddd785 NN |
913 | s=`cd $(srcdir); ${PWD}`; export s; \ |
914 | $(SET_LIB_PATH) \ | |
88b5521b | 915 | (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ |
4977bab6 ZW |
916 | IF with_x |
917 | +] $(X11_FLAGS_TO_PASS)[+ | |
918 | ENDIF with_x +] all) | |
919 | ||
920 | [+ IF no_check +] | |
921 | .PHONY: check-[+module+] | |
922 | check-[+module+]: | |
923 | [+ ELIF no_check_cross +] | |
924 | .PHONY: check-[+module+] | |
925 | # This module is only tested in a native toolchain. | |
926 | check-[+module+]: | |
95ddd785 | 927 | @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ |
95ddd785 NN |
928 | r=`${PWD}`; export r; \ |
929 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
930 | $(SET_LIB_PATH) \ | |
88b5521b | 931 | (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ |
4977bab6 ZW |
932 | IF with_x |
933 | +] $(X11_FLAGS_TO_PASS)[+ | |
934 | ENDIF with_x +] check); \ | |
95ddd785 | 935 | fi |
4977bab6 ZW |
936 | [+ ELSE check +] |
937 | .PHONY: check-[+module+] | |
938 | check-[+module+]: | |
939 | @r=`${PWD}`; export r; \ | |
95ddd785 NN |
940 | s=`cd $(srcdir); ${PWD}`; export s; \ |
941 | $(SET_LIB_PATH) \ | |
88b5521b | 942 | (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ |
4977bab6 ZW |
943 | IF with_x |
944 | +] $(X11_FLAGS_TO_PASS)[+ | |
945 | ENDIF with_x +] check) | |
946 | [+ ENDIF no_check +] | |
947 | ||
948 | [+ IF no_install +] | |
949 | .PHONY: install-[+module+] maybe-install-[+module+] | |
950 | maybe-install-[+module+]: | |
951 | install-[+module+]: | |
952 | [+ ELSE install +] | |
953 | .PHONY: install-[+module+] maybe-install-[+module+] | |
954 | maybe-install-[+module+]: | |
955 | install-[+module+]: installdirs | |
956 | @r=`${PWD}`; export r; \ | |
95ddd785 NN |
957 | s=`cd $(srcdir); ${PWD}`; export s; \ |
958 | $(SET_LIB_PATH) \ | |
88b5521b | 959 | (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ |
4977bab6 ZW |
960 | IF with_x |
961 | +] $(X11_FLAGS_TO_PASS)[+ | |
962 | ENDIF with_x +] install) | |
963 | [+ ENDIF no_install +] | |
964 | [+ ENDFOR host_modules +] | |
965 | ||
966 | # --------------------------------------- | |
967 | # Modules which run on the target machine | |
968 | # --------------------------------------- | |
969 | [+ FOR target_modules +] | |
970 | .PHONY: configure-target-[+module+] maybe-configure-target-[+module+] | |
971 | maybe-configure-target-[+module+]: | |
4977bab6 | 972 | |
88b5521b NN |
973 | # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. |
974 | $(TARGET_SUBDIR)/[+module+]/multilib.out: multilib.out | |
ade82b16 AO |
975 | @[ -d $(TARGET_SUBDIR)/[+module+] ] || \ |
976 | mkdir $(TARGET_SUBDIR)/[+module+]; \ | |
977 | rm -f $(TARGET_SUBDIR)/[+module+]/Makefile || : ; \ | |
88b5521b | 978 | cp multilib.out $(TARGET_SUBDIR)/[+module+]/multilib.out |
95ddd785 | 979 | |
ade82b16 AO |
980 | configure-target-[+module+]: $(TARGET_SUBDIR)/[+module+]/multilib.out |
981 | @test ! -f $(TARGET_SUBDIR)/[+module+]/Makefile || exit 0; \ | |
982 | [ -d $(TARGET_SUBDIR)/[+module+] ] || \ | |
983 | mkdir $(TARGET_SUBDIR)/[+module+];\ | |
95ddd785 NN |
984 | r=`${PWD}`; export r; \ |
985 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
986 | $(SET_LIB_PATH) \ | |
987 | AR="$(AR_FOR_TARGET)"; export AR; \ | |
988 | AS="$(AS_FOR_TARGET)"; export AS; \ | |
989 | CC="$(CC_FOR_TARGET)"; export CC; \ | |
e9f2dc3b SM |
990 | CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ |
991 | CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \[+ | |
4977bab6 ZW |
992 | IF raw_cxx +] |
993 | CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ | |
994 | CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \[+ | |
995 | ELSE normal_cxx +] | |
996 | CXX="$(CXX_FOR_TARGET)"; export CXX; \[+ | |
997 | ENDIF raw_cxx +] | |
95ddd785 NN |
998 | CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ |
999 | GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ | |
1000 | DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ | |
1001 | LD="$(LD_FOR_TARGET)"; export LD; \ | |
1002 | LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ | |
1003 | NM="$(NM_FOR_TARGET)"; export NM; \ | |
1004 | RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ | |
1005 | WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ | |
4977bab6 ZW |
1006 | echo Configuring in $(TARGET_SUBDIR)/[+module+]; \ |
1007 | cd "$(TARGET_SUBDIR)/[+module+]" || exit 1; \ | |
95ddd785 NN |
1008 | case $(srcdir) in \ |
1009 | /* | [A-Za-z]:[\\/]*) \ | |
1010 | topdir=$(srcdir) ;; \ | |
1011 | *) \ | |
1012 | case "$(TARGET_SUBDIR)" in \ | |
1013 | .) topdir="../$(srcdir)" ;; \ | |
1014 | *) topdir="../../$(srcdir)" ;; \ | |
1015 | esac ;; \ | |
1016 | esac; \ | |
1017 | if [ "$(srcdir)" = "." ] ; then \ | |
1018 | if [ "$(TARGET_SUBDIR)" != "." ] ; then \ | |
4977bab6 | 1019 | if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \ |
95ddd785 NN |
1020 | if [ -f Makefile ]; then \ |
1021 | if $(MAKE) distclean; then \ | |
1022 | true; \ | |
1023 | else \ | |
1024 | exit 1; \ | |
1025 | fi; \ | |
1026 | else \ | |
1027 | true; \ | |
1028 | fi; \ | |
1029 | else \ | |
1030 | exit 1; \ | |
1031 | fi; \ | |
1032 | else \ | |
1033 | true; \ | |
1034 | fi; \ | |
1035 | srcdiroption="--srcdir=."; \ | |
1036 | libsrcdir="."; \ | |
1037 | else \ | |
4977bab6 ZW |
1038 | srcdiroption="--srcdir=$${topdir}/[+module+]"; \ |
1039 | libsrcdir="$$s/[+module+]"; \ | |
95ddd785 | 1040 | fi; \ |
4977bab6 ZW |
1041 | rm -f no-such-file || : ; \ |
1042 | CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ | |
1043 | $(TARGET_CONFIGARGS) $${srcdiroption} \ | |
1044 | --with-target-subdir="$(TARGET_SUBDIR)" \ | |
1045 | || exit 1 | |
1046 | ||
1047 | .PHONY: all-target-[+module+] maybe-all-target-[+module+] | |
1048 | maybe-all-target-[+module+]: | |
1049 | all-target-[+module+]: configure-target-[+module+] | |
1050 | @r=`${PWD}`; export r; \ | |
95ddd785 NN |
1051 | s=`cd $(srcdir); ${PWD}`; export s; \ |
1052 | $(SET_LIB_PATH) \ | |
88b5521b | 1053 | (cd $(TARGET_SUBDIR)/[+module+] && \ |
4977bab6 ZW |
1054 | $(MAKE) $(TARGET_FLAGS_TO_PASS) [+ |
1055 | IF raw_cxx | |
1056 | +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ | |
1057 | ENDIF raw_cxx | |
1058 | +] all) | |
1059 | [+ IF no_check +] | |
1060 | # Dummy target for uncheckable module. | |
1061 | .PHONY: check-target-[+module+] | |
1062 | check-target-[+module+]: | |
1063 | [+ ELSE check +] | |
1064 | .PHONY: check-target-[+module+] | |
1065 | check-target-[+module+]: | |
1066 | @r=`${PWD}`; export r; \ | |
95ddd785 NN |
1067 | s=`cd $(srcdir); ${PWD}`; export s; \ |
1068 | $(SET_LIB_PATH) \ | |
88b5521b | 1069 | (cd $(TARGET_SUBDIR)/[+module+] && \ |
4977bab6 ZW |
1070 | $(MAKE) $(TARGET_FLAGS_TO_PASS) [+ |
1071 | IF raw_cxx | |
1072 | +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ | |
1073 | ENDIF raw_cxx | |
1074 | +] check) | |
1075 | [+ ENDIF no_check +] | |
1076 | [+ IF no_install +] | |
1077 | .PHONY: install-target-[+module+] maybe-install-target-[+module+] | |
1078 | maybe-install-target-[+module+]: | |
1079 | # Dummy target for uninstallable. | |
1080 | install-target-[+module+]: | |
1081 | [+ ELSE install +] | |
1082 | .PHONY: install-target-[+module+] maybe-install-target-[+module+] | |
1083 | maybe-install-target-[+module+]: | |
1084 | install-target-[+module+]: installdirs | |
1085 | @r=`${PWD}`; export r; \ | |
95ddd785 NN |
1086 | s=`cd $(srcdir); ${PWD}`; export s; \ |
1087 | $(SET_LIB_PATH) \ | |
88b5521b | 1088 | (cd $(TARGET_SUBDIR)/[+module+] && \ |
4977bab6 ZW |
1089 | $(MAKE) $(TARGET_FLAGS_TO_PASS) install) |
1090 | [+ ENDIF no_install +] | |
1091 | [+ ENDFOR target_modules +] | |
95ddd785 | 1092 | |
4977bab6 ZW |
1093 | # ---------- |
1094 | # GCC module | |
1095 | # ---------- | |
95ddd785 | 1096 | |
4977bab6 ZW |
1097 | # Unfortunately, while gcc _should_ be a host module, |
1098 | # libgcc is a target module, and gen* programs are | |
1099 | # build modules. So GCC is a sort of hybrid. | |
95ddd785 NN |
1100 | |
1101 | # gcc is the only module which uses GCC_FLAGS_TO_PASS. | |
4977bab6 ZW |
1102 | .PHONY: configure-gcc maybe-configure-gcc |
1103 | maybe-configure-gcc: | |
ade82b16 AO |
1104 | configure-gcc: |
1105 | @test ! -f gcc/Makefile || exit 0; \ | |
1106 | [ -d gcc ] || mkdir gcc; \ | |
4977bab6 ZW |
1107 | r=`${PWD}`; export r; \ |
1108 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
1109 | CC="$(CC)"; export CC; \ | |
1110 | CFLAGS="$(CFLAGS)"; export CFLAGS; \ | |
1111 | CXX="$(CXX)"; export CXX; \ | |
1112 | CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ | |
3dfabf63 | 1113 | TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \ |
4977bab6 ZW |
1114 | if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ |
1115 | AR="$(AR)"; export AR; \ | |
1116 | AS="$(AS)"; export AS; \ | |
1117 | CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ | |
1118 | DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ | |
1119 | LD="$(LD)"; export LD; \ | |
1120 | NM="$(NM)"; export NM; \ | |
1121 | RANLIB="$(RANLIB)"; export RANLIB; \ | |
1122 | WINDRES="$(WINDRES)"; export WINDRES; \ | |
1123 | OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ | |
1124 | OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ | |
1125 | fi; \ | |
1126 | echo Configuring in gcc; \ | |
1127 | cd gcc || exit 1; \ | |
1128 | case $(srcdir) in \ | |
1129 | \.) \ | |
1130 | srcdiroption="--srcdir=."; \ | |
1131 | libsrcdir=".";; \ | |
1132 | /* | [A-Za-z]:[\\/]*) \ | |
1133 | srcdiroption="--srcdir=$(srcdir)/gcc"; \ | |
1134 | libsrcdir="$$s/gcc";; \ | |
1135 | *) \ | |
1136 | srcdiroption="--srcdir=../$(srcdir)/gcc"; \ | |
1137 | libsrcdir="$$s/gcc";; \ | |
1138 | esac; \ | |
1139 | $(SHELL) $${libsrcdir}/configure \ | |
1140 | $(HOST_CONFIGARGS) $${srcdiroption} \ | |
1141 | || exit 1 | |
1142 | ||
5ecf91d1 JM |
1143 | # Don't 'make all' in gcc if it's already been made by 'bootstrap'; that |
1144 | # causes trouble. This wart will be fixed eventually by moving | |
4977bab6 ZW |
1145 | # the bootstrap behavior to this file. |
1146 | .PHONY: all-gcc maybe-all-gcc | |
1147 | maybe-all-gcc: | |
1148 | all-gcc: configure-gcc | |
5ecf91d1 JM |
1149 | @if [ -f gcc/stage_last ] ; then \ |
1150 | r=`${PWD}`; export r; \ | |
1151 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
1152 | $(SET_LIB_PATH) \ | |
88b5521b | 1153 | (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) quickstrap); \ |
4977bab6 | 1154 | else \ |
95ddd785 NN |
1155 | r=`${PWD}`; export r; \ |
1156 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
1157 | $(SET_LIB_PATH) \ | |
88b5521b | 1158 | (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) all); \ |
95ddd785 NN |
1159 | fi |
1160 | ||
1161 | # Building GCC uses some tools for rebuilding "source" files | |
1162 | # like texinfo, bison/byacc, etc. So we must depend on those. | |
1163 | # | |
1164 | # While building GCC, it may be necessary to run various target | |
1165 | # programs like the assembler, linker, etc. So we depend on | |
1166 | # those too. | |
1167 | # | |
1168 | # In theory, on an SMP all those dependencies can be resolved | |
1169 | # in parallel. | |
1170 | # | |
e004b81f | 1171 | .PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap |
4977bab6 | 1172 | bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap: all-bootstrap configure-gcc |
95ddd785 NN |
1173 | @r=`${PWD}`; export r; \ |
1174 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
1175 | $(SET_LIB_PATH) \ | |
1176 | echo "Bootstrapping the compiler"; \ | |
1177 | cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@ | |
1178 | @r=`${PWD}`; export r; \ | |
1179 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
1180 | case "$@" in \ | |
1181 | *bootstrap4-lean ) \ | |
1182 | msg="Comparing stage3 and stage4 of the compiler"; \ | |
1183 | compare=compare3-lean ;; \ | |
1184 | *bootstrap4 ) msg="Comparing stage3 and stage4 of the compiler"; \ | |
1185 | compare=compare3 ;; \ | |
1186 | *-lean ) msg="Comparing stage2 and stage3 of the compiler"; \ | |
1187 | compare=compare-lean ;; \ | |
1188 | * ) msg="Comparing stage2 and stage3 of the compiler"; \ | |
1189 | compare=compare ;; \ | |
1190 | esac; \ | |
1191 | $(SET_LIB_PATH) \ | |
1192 | echo "$$msg"; \ | |
1193 | cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare | |
1194 | @r=`${PWD}`; export r; \ | |
1195 | s=`cd $(srcdir); ${PWD}` ; export s; \ | |
1196 | $(SET_LIB_PATH) \ | |
1197 | echo "Building runtime libraries"; \ | |
1198 | $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all | |
1199 | ||
1200 | .PHONY: cross | |
1201 | cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld | |
1202 | @r=`${PWD}`; export r; \ | |
1203 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
1204 | $(SET_LIB_PATH) \ | |
1205 | echo "Building the C and C++ compiler"; \ | |
1206 | cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" | |
1207 | @r=`${PWD}`; export r; \ | |
1208 | s=`cd $(srcdir); ${PWD}` ; export s; \ | |
1209 | $(SET_LIB_PATH) \ | |
1210 | echo "Building runtime libraries"; \ | |
1211 | $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \ | |
1212 | LANGUAGES="c c++" all | |
1213 | ||
1214 | .PHONY: check-gcc | |
1215 | check-gcc: | |
1216 | @if [ -f ./gcc/Makefile ] ; then \ | |
1217 | r=`${PWD}`; export r; \ | |
1218 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
1219 | $(SET_LIB_PATH) \ | |
88b5521b | 1220 | (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check); \ |
95ddd785 NN |
1221 | else \ |
1222 | true; \ | |
1223 | fi | |
1224 | ||
6248218a JM |
1225 | .PHONY: check-gcc-c++ |
1226 | check-gcc-c++: | |
95ddd785 NN |
1227 | @if [ -f ./gcc/Makefile ] ; then \ |
1228 | r=`${PWD}`; export r; \ | |
1229 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
1230 | $(SET_LIB_PATH) \ | |
88b5521b | 1231 | (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \ |
95ddd785 NN |
1232 | else \ |
1233 | true; \ | |
6248218a JM |
1234 | fi |
1235 | ||
1236 | .PHONY: check-c++ | |
30db8e17 JM |
1237 | check-c++: |
1238 | $(MAKE) check-target-libstdc++-v3 check-gcc-c++ NOTPARALLEL=parallel-ok | |
95ddd785 | 1239 | |
4977bab6 ZW |
1240 | .PHONY: install-gcc maybe-install-gcc |
1241 | maybe-install-gcc: | |
95ddd785 NN |
1242 | install-gcc: |
1243 | @if [ -f ./gcc/Makefile ] ; then \ | |
1244 | r=`${PWD}`; export r; \ | |
1245 | s=`cd $(srcdir); ${PWD}`; export s; \ | |
1246 | $(SET_LIB_PATH) \ | |
88b5521b | 1247 | (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ |
95ddd785 NN |
1248 | else \ |
1249 | true; \ | |
1250 | fi | |
1251 | ||
4977bab6 ZW |
1252 | # Install the gcc headers files, but not the fixed include files, |
1253 | # which Cygnus is not allowed to distribute. This rule is very | |
1254 | # dependent on the workings of the gcc Makefile.in. | |
1255 | .PHONY: gcc-no-fixedincludes | |
1256 | gcc-no-fixedincludes: | |
1257 | @if [ -f ./gcc/Makefile ]; then \ | |
1258 | rm -rf gcc/tmp-include; \ | |
1259 | mv gcc/include gcc/tmp-include 2>/dev/null; \ | |
1260 | mkdir gcc/include; \ | |
1261 | cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \ | |
1262 | touch gcc/stmp-fixinc gcc/include/fixed; \ | |
1263 | rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \ | |
95ddd785 | 1264 | r=`${PWD}`; export r; \ |
4977bab6 | 1265 | s=`cd $(srcdir); ${PWD}` ; export s; \ |
95ddd785 | 1266 | $(SET_LIB_PATH) \ |
88b5521b | 1267 | (cd ./gcc && \ |
4977bab6 ZW |
1268 | $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ |
1269 | rm -rf gcc/include; \ | |
1270 | mv gcc/tmp-include gcc/include 2>/dev/null; \ | |
1271 | else true; fi | |
95ddd785 | 1272 | |
4977bab6 ZW |
1273 | # -------------------------------------- |
1274 | # Dependencies between different modules | |
1275 | # -------------------------------------- | |
1276 | ||
1277 | # There are two types of dependencies here: 'hard' dependencies, where one | |
1278 | # module simply won't build without the other; and 'soft' dependencies, where | |
1279 | # if the depended-on module is missing, the depending module will do without | |
1280 | # or find a substitute somewhere (perhaps installed). Soft dependencies | |
1281 | # are specified by depending on a 'maybe-' target. If you're not sure, | |
1282 | # it's safer to use a soft dependency. | |
1283 | ||
1284 | # Host modules specific to gcc. | |
1285 | # GCC needs to identify certain tools. | |
1286 | configure-gcc: maybe-configure-binutils maybe-configure-gas maybe-configure-ld maybe-configure-bison maybe-configure-flex | |
1287 | all-gcc: maybe-all-libiberty maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib | |
1288 | # This is a slightly kludgy method of getting dependencies on | |
1289 | # all-build-libiberty correct; it would be better to build it every time. | |
1290 | all-gcc: maybe-all-build-libiberty | |
1291 | all-bootstrap: maybe-all-libiberty maybe-all-texinfo maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib | |
1292 | ||
1293 | # Host modules specific to gdb. | |
1294 | # GDB needs to know that the simulator is being built. | |
1295 | configure-gdb: maybe-configure-tcl maybe-configure-tk maybe-configure-sim | |
0dffceed | 1296 | GDB_TK = @GDB_TK@ |
4977bab6 ZW |
1297 | all-gdb: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-mmalloc maybe-all-readline maybe-all-bison maybe-all-byacc maybe-all-sim $(gdbnlmrequirements) $(GDB_TK) |
1298 | install-gdb: maybe-install-tcl maybe-install-tk maybe-install-itcl maybe-install-tix maybe-install-libgui | |
79308c5d | 1299 | configure-libgui: maybe-configure-tcl maybe-configure-tk |
4977bab6 ZW |
1300 | all-libgui: maybe-all-tcl maybe-all-tk maybe-all-itcl |
1301 | ||
1302 | # Host modules specific to binutils. | |
1303 | configure-bfd: configure-libiberty | |
1304 | all-bfd: maybe-all-libiberty maybe-all-intl | |
1305 | all-binutils: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-flex maybe-all-bison maybe-all-byacc maybe-all-intl | |
f5e0c73c NN |
1306 | # We put install-opcodes before install-binutils because the installed |
1307 | # binutils might be on PATH, and they might need the shared opcodes | |
1308 | # library. | |
4977bab6 ZW |
1309 | install-binutils: maybe-install-opcodes |
1310 | all-gas: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-intl | |
1311 | all-gprof: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-intl | |
1312 | all-ld: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-bison maybe-all-byacc maybe-all-flex maybe-all-intl | |
1313 | all-opcodes: maybe-all-bfd maybe-all-libiberty | |
1314 | ||
1315 | # Other host modules in the 'src' repository. | |
1316 | all-dejagnu: maybe-all-tcl maybe-all-expect maybe-all-tk | |
1317 | configure-expect: maybe-configure-tcl maybe-configure-tk | |
1318 | all-expect: maybe-all-tcl maybe-all-tk | |
1319 | configure-itcl: maybe-configure-tcl maybe-configure-tk | |
1320 | all-itcl: maybe-all-tcl maybe-all-tk | |
f5e0c73c NN |
1321 | # We put install-tcl before install-itcl because itcl wants to run a |
1322 | # program on installation which uses the Tcl libraries. | |
4977bab6 | 1323 | install-itcl: maybe-install-tcl |
ba49f6f1 | 1324 | all-sid: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-tcl maybe-all-tk |
4977bab6 ZW |
1325 | install-sid: maybe-install-tcl maybe-install-tk |
1326 | all-sim: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-readline maybe-configure-gdb | |
1327 | configure-tk: maybe-configure-tcl | |
1328 | all-tk: maybe-all-tcl | |
1329 | configure-tix: maybe-configure-tcl maybe-configure-tk | |
1330 | all-tix: maybe-all-tcl maybe-all-tk | |
1331 | all-texinfo: maybe-all-libiberty | |
1332 | ||
1333 | # Other host modules. Warning, these are not well tested. | |
1334 | all-autoconf: maybe-all-m4 maybe-all-texinfo | |
1335 | all-automake: maybe-all-m4 maybe-all-texinfo | |
1336 | all-bison: maybe-all-texinfo | |
1337 | all-diff: maybe-all-libiberty | |
1338 | all-fastjar: maybe-all-zlib maybe-all-libiberty | |
1339 | all-fileutils: maybe-all-libiberty | |
1340 | all-flex: maybe-all-libiberty maybe-all-bison maybe-all-byacc | |
4977bab6 ZW |
1341 | all-gzip: maybe-all-libiberty |
1342 | all-hello: maybe-all-libiberty | |
1343 | all-m4: maybe-all-libiberty maybe-all-texinfo | |
1344 | all-make: maybe-all-libiberty | |
1345 | all-patch: maybe-all-libiberty | |
1346 | all-prms: maybe-all-libiberty | |
1347 | all-recode: maybe-all-libiberty | |
1348 | all-sed: maybe-all-libiberty | |
1349 | all-send-pr: maybe-all-prms | |
4977bab6 ZW |
1350 | all-tar: maybe-all-libiberty |
1351 | all-uudecode: maybe-all-libiberty | |
1352 | ||
1353 | ALL_GCC = maybe-all-gcc | |
1354 | ALL_GCC_C = $(ALL_GCC) maybe-all-target-newlib maybe-all-target-libgloss | |
1355 | ALL_GCC_CXX = $(ALL_GCC_C) maybe-all-target-libstdc++-v3 | |
1356 | ||
1357 | # Target modules specific to gcc. | |
1358 | configure-target-boehm-gc: $(ALL_GCC_C) maybe-configure-target-qthreads | |
1359 | configure-target-fastjar: maybe-configure-target-zlib | |
1360 | all-target-fastjar: maybe-all-target-zlib maybe-all-target-libiberty | |
1361 | configure-target-libf2c: $(ALL_GCC_C) | |
1362 | all-target-libf2c: maybe-all-target-libiberty | |
1363 | configure-target-libffi: $(ALL_GCC_C) | |
1364 | configure-target-libjava: $(ALL_GCC_C) maybe-configure-target-zlib maybe-configure-target-boehm-gc maybe-configure-target-qthreads maybe-configure-target-libffi | |
1365 | all-target-libjava: maybe-all-fastjar maybe-all-target-zlib maybe-all-target-boehm-gc maybe-all-target-qthreads maybe-all-target-libffi | |
1366 | configure-target-libobjc: $(ALL_GCC_C) | |
1367 | all-target-libobjc: maybe-all-target-libiberty | |
1368 | configure-target-libstdc++-v3: $(ALL_GCC_C) | |
1369 | all-target-libstdc++-v3: maybe-all-target-libiberty | |
1370 | configure-target-zlib: $(ALL_GCC_C) | |
95ddd785 | 1371 | |
4977bab6 ZW |
1372 | # Target modules in the 'src' repository. |
1373 | configure-target-examples: $(ALL_GCC_C) | |
1374 | configure-target-libgloss: $(ALL_GCC) | |
1375 | all-target-libgloss: maybe-configure-target-newlib | |
1376 | configure-target-libiberty: $(ALL_GCC_C) | |
1377 | configure-target-libtermcap: $(ALL_GCC_C) | |
1378 | configure-target-newlib: $(ALL_GCC) | |
1379 | configure-target-rda: $(ALL_GCC_C) | |
1380 | configure-target-winsup: $(ALL_GCC_C) | |
1381 | all-target-winsup: maybe-all-target-libiberty maybe-all-target-libtermcap | |
95ddd785 | 1382 | |
4977bab6 ZW |
1383 | # Other target modules. Warning, these are not well tested. |
1384 | configure-target-gperf: $(ALL_GCC_CXX) | |
1385 | all-target-gperf: maybe-all-target-libiberty maybe-all-target-libstdc++-v3 | |
1386 | configure-target-qthreads: $(ALL_GCC_C) | |
95ddd785 | 1387 | |
4977bab6 ZW |
1388 | # Dependencies of maybe-foo on foo. These are used because, for example, |
1389 | # all-gcc only depends on all-gas if gas is present and being configured. | |
1390 | @maybe_dependencies@ | |
95ddd785 | 1391 | |
4977bab6 ZW |
1392 | # Serialization dependencies. Host configures don't work well in parallel to |
1393 | # each other, due to contention over config.cache. Target configures and | |
1394 | # build configures are similar. | |
1395 | @serialization_dependencies@ | |
95ddd785 | 1396 | |
4977bab6 ZW |
1397 | # -------------------------------- |
1398 | # Regenerating top level configury | |
1399 | # -------------------------------- | |
95ddd785 | 1400 | |
88b5521b NN |
1401 | # Multilib.out tells target dirs what multilibs they should build. |
1402 | # There is really only one copy. We use the 'timestamp' method to | |
1403 | # work around various timestamp bugs on some systems. | |
1404 | # We use move-if-change so that it's only considered updated when it | |
1405 | # actually changes, because it has to depend on a phony target. | |
ade82b16 | 1406 | multilib.out: maybe-all-gcc |
88b5521b NN |
1407 | @r=`${PWD}`; export r; \ |
1408 | echo "Checking multilib configuration..."; \ | |
1409 | $(CC_FOR_TARGET) --print-multi-lib > multilib.tmp 2> /dev/null ; \ | |
1410 | $(SHELL) $(srcdir)/move-if-change multilib.tmp multilib.out ; \ | |
88b5521b | 1411 | |
95ddd785 | 1412 | # Rebuilding Makefile.in, using autogen. |
e245b0ea | 1413 | AUTOGEN = autogen |
ee03dc5e | 1414 | $(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def |
e245b0ea | 1415 | cd $(srcdir) && $(AUTOGEN) Makefile.def |
95ddd785 | 1416 | |
671aa708 | 1417 | # Rebuilding Makefile. |
e245b0ea AO |
1418 | Makefile: $(srcdir)/Makefile.in config.status |
1419 | CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status | |
1420 | ||
1421 | config.status: configure $(gcc_version_trigger) | |
671aa708 | 1422 | $(SHELL) ./config.status --recheck |
95ddd785 | 1423 | |
671aa708 | 1424 | # Rebuilding configure. |
e245b0ea | 1425 | AUTOCONF = autoconf |
ee03dc5e | 1426 | $(srcdir)/configure: @MAINT@ $(srcdir)/configure.in $(srcdir)/config/acx.m4 |
e245b0ea | 1427 | cd $(srcdir) && $(AUTOCONF) |
95ddd785 | 1428 | # |
95ddd785 NN |
1429 | |
1430 | .NOEXPORT: | |
1431 | MAKEOVERRIDES= | |
1432 | ||
e245b0ea AO |
1433 | # Tell GNU make 3.79 not to run the top level in parallel. This |
1434 | # prevents contention for $builddir/$target/config.cache, as well | |
1435 | # as minimizing scatter in file system caches. | |
1436 | NOTPARALLEL = .NOTPARALLEL | |
1437 | $(NOTPARALLEL): | |
1438 | ||
95ddd785 | 1439 | # end of Makefile.in |