OSDN Git Service

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