OSDN Git Service

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