OSDN Git Service

2002-09-25 Nathanael Nerode <neroden@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / Makefile.tpl
1 [+ AutoGen5 template
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 BZIPPROG = bzip2
131 MD5PROG = md5sum
132
133 # These values are substituted by configure.
134 DEFAULT_YACC = @DEFAULT_YACC@
135 DEFAULT_LEX = @DEFAULT_LEX@
136 DEFAULT_M4 = @DEFAULT_M4@
137
138 BISON = `if [ -f $$r/bison/bison ] ; then \
139             echo $$r/bison/bison -L $$s/bison/ ; \
140          else \
141             echo bison ; \
142          fi`
143
144 YACC = `if [ -f $$r/bison/bison ] ; then \
145             echo $$r/bison/bison -y -L $$s/bison/ ; \
146         elif [ -f $$r/byacc/byacc ] ; then \
147             echo $$r/byacc/byacc ; \
148         else \
149             echo ${DEFAULT_YACC} ; \
150         fi`
151
152 LEX = `if [ -f $$r/flex/flex ] ; \
153         then echo $$r/flex/flex ; \
154         else echo ${DEFAULT_LEX} ; fi`
155
156 M4 = `if [ -f $$r/m4/m4 ] ; \
157         then echo $$r/m4/m4 ; \
158         else echo ${DEFAULT_M4} ; fi`
159
160 # For an installed makeinfo, we require it to be from texinfo 4 or
161 # higher, else we use the "missing" dummy.
162 MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
163         then echo $$r/texinfo/makeinfo/makeinfo ; \
164         else if (makeinfo --version \
165           | egrep 'texinfo[^0-9]*([1-3][0-9]|[4-9])') >/dev/null 2>&1; \
166         then echo makeinfo; else echo $$s/missing makeinfo; fi; fi`
167
168 # This just becomes part of the MAKEINFO definition passed down to
169 # sub-makes.  It lets flags be given on the command line while still
170 # using the makeinfo from the object tree.
171 MAKEINFOFLAGS =
172
173 EXPECT = `if [ -f $$r/expect/expect ] ; \
174         then echo $$r/expect/expect ; \
175         else echo expect ; fi`
176
177 RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \
178         then echo $$s/dejagnu/runtest ; \
179         else echo runtest ; fi`
180
181
182 # compilers to use to create programs which must be run in the build
183 # environment.
184 CC_FOR_BUILD = $(CC)
185 CXX_FOR_BUILD = $(CXX)
186
187 SUBDIRS = "this is set via configure, don't edit this"
188 OTHERS = 
189
190 # This is set by the configure script to the list of directories which
191 # should be built using the target tools.
192 TARGET_CONFIGDIRS = @target_configdirs@
193
194 # Target libraries are put under this directory:
195 # Changed by configure to $(target_alias) if cross.
196 TARGET_SUBDIR = @target_subdir@
197
198 BUILD_CONFIGDIRS = libiberty
199 BUILD_SUBDIR = @build_subdir@
200
201 # This is set by the configure script to the arguments to use when configuring
202 # directories built for the target.
203 TARGET_CONFIGARGS = @target_configargs@
204
205 # This is set by the configure script to the arguments to use when configuring
206 # directories built for the build system.
207 BUILD_CONFIGARGS = @build_configargs@
208
209 # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
210 # was used.
211 SET_LIB_PATH =
212
213 # This is the name of the environment variable used for the path to
214 # the libraries.  This may be changed by configure.in.
215 RPATH_ENVVAR = LD_LIBRARY_PATH
216
217 # This is the list of directories that may be needed in RPATH_ENVVAR
218 # so that programs built for the host machine work.
219 HOST_LIB_PATH = $$r/bfd:$$r/opcodes
220
221 # This is the list of directories that may be needed in RPATH_ENVVAR
222 # so that prorgams built for the target machine work.
223 TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:
224
225 # configure.in sets SET_LIB_PATH to this if --enable-shared was used.
226 # Some platforms don't like blank entries, so we remove duplicate,
227 # leading and trailing colons.
228 REALLY_SET_LIB_PATH = \
229   $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
230
231 ALL = all.normal
232 INSTALL_TARGET = installdirs \
233         install-gcc \
234         $(INSTALL_MODULES) \
235         $(INSTALL_TARGET_MODULES) \
236         $(INSTALL_X11_MODULES) \
237         $(INSTALL_DOSREL)
238
239 INSTALL_TARGET_CROSS = installdirs \
240         install-gcc-cross \
241         $(INSTALL_MODULES) \
242         $(INSTALL_TARGET_MODULES) \
243         $(INSTALL_X11_MODULES) \
244         $(INSTALL_DOSREL)
245
246 # Should be substed by configure.in
247 FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
248 CC_FOR_TARGET = @CC_FOR_TARGET@
249 CXX_FOR_TARGET = @CXX_FOR_TARGET@
250 CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
251 GCJ_FOR_TARGET = @GCJ_FOR_TARGET@
252
253 # If GCC_FOR_TARGET is not overriden on the command line, then this
254 # variable is passed down to the gcc Makefile, where it is used to
255 # build libgcc2.a.  We define it here so that it can itself be
256 # overridden on the command line.
257 GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET)
258
259 AS_FOR_TARGET = ` \
260   if [ -f $$r/gas/as-new ] ; then \
261     echo $$r/gas/as-new ; \
262   elif [ -f $$r/gcc/xgcc ]; then \
263     $(CC_FOR_TARGET) -print-prog-name=as ; \
264   else \
265     if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
266       echo $(AS); \
267     else \
268        t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \
269     fi; \
270   fi`
271
272 LD_FOR_TARGET = ` \
273   if [ -f $$r/ld/ld-new ] ; then \
274     echo $$r/ld/ld-new ; \
275   elif [ -f $$r/gcc/xgcc ]; then \
276     $(CC_FOR_TARGET) -print-prog-name=ld ; \
277   else \
278     if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
279       echo $(LD); \
280     else \
281        t='$(program_transform_name)'; echo ld | sed -e 's/x/x/' $$t ; \
282     fi; \
283   fi`
284
285 DLLTOOL_FOR_TARGET = ` \
286   if [ -f $$r/binutils/dlltool ] ; then \
287     echo $$r/binutils/dlltool ; \
288   else \
289     if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
290       echo $(DLLTOOL); \
291     else \
292        t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \
293     fi; \
294   fi`
295
296 WINDRES_FOR_TARGET = ` \
297   if [ -f $$r/binutils/windres ] ; then \
298     echo $$r/binutils/windres ; \
299   else \
300     if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
301       echo $(WINDRES); \
302     else \
303        t='$(program_transform_name)'; echo windres | sed -e 's/x/x/' $$t ; \
304     fi; \
305   fi`
306
307 AR_FOR_TARGET = ` \
308   if [ -f $$r/binutils/ar ] ; then \
309     echo $$r/binutils/ar ; \
310   else \
311     if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
312       echo $(AR); \
313     else \
314        t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
315     fi; \
316   fi`
317
318 RANLIB_FOR_TARGET = ` \
319   if [ -f $$r/binutils/ranlib ] ; then \
320     echo $$r/binutils/ranlib ; \
321   else \
322     if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
323       if [ x'$(RANLIB)' != x ]; then \
324          echo $(RANLIB); \
325       else \
326          echo ranlib; \
327       fi; \
328     else \
329        t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
330     fi; \
331   fi`
332
333 NM_FOR_TARGET = ` \
334   if [ -f $$r/binutils/nm-new ] ; then \
335     echo $$r/binutils/nm-new ; \
336   elif [ -f $$r/gcc/xgcc ]; then \
337     $(CC_FOR_TARGET) -print-prog-name=nm ; \
338   else \
339     if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
340       echo $(NM); \
341     else \
342        t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
343     fi; \
344   fi`
345
346 # The first rule in the file had better be this one.  Don't put any above it.
347 # This lives here to allow makefile fragments to contain dependencies.
348 all: all.normal
349 .PHONY: all
350
351 # These can be overridden by config/mt-*.
352 # The _TARGET_ is because they're specified in mt-foo.
353 # The _HOST_ is because they're programs that run on the host.
354 EXTRA_TARGET_HOST_ALL_MODULES =
355 EXTRA_TARGET_HOST_INSTALL_MODULES =
356 EXTRA_TARGET_HOST_CHECK_MODULES =
357
358 #### host and target specific makefile fragments come in here.
359 ###
360
361 # Flags to pass down to all sub-makes.
362 # Please keep these in alphabetical order.
363 BASE_FLAGS_TO_PASS = \
364         "AR_FLAGS=$(AR_FLAGS)" \
365         "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
366         "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
367         "BISON=$(BISON)" \
368         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
369         "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
370         "CFLAGS=$(CFLAGS)" \
371         "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
372         "GCJ_FOR_TARGET=$(GCJ_FOR_TARGET)" \
373         "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
374         "CXXFLAGS=$(CXXFLAGS)" \
375         "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
376         "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
377         "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
378         "INSTALL=$(INSTALL)" \
379         "INSTALL_DATA=$(INSTALL_DATA)" \
380         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
381         "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
382         "LDFLAGS=$(LDFLAGS)" \
383         "LEX=$(LEX)" \
384         "LD_FOR_TARGET=$(LD_FOR_TARGET)" \
385         "LIBCFLAGS=$(LIBCFLAGS)" \
386         "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
387         "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
388         "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
389         "M4=$(M4)" \
390         "MAKE=$(MAKE)" \
391         "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
392         "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
393         "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
394         "RPATH_ENVVAR=$(RPATH_ENVVAR)" \
395         "SHELL=$(SHELL)" \
396         "EXPECT=$(EXPECT)" \
397         "RUNTEST=$(RUNTEST)" \
398         "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
399         "TARGET_SUBDIR=$(TARGET_SUBDIR)" \
400         "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \
401         "YACC=$(YACC)" \
402         "bindir=$(bindir)" \
403         "datadir=$(datadir)" \
404         "exec_prefix=$(exec_prefix)" \
405         "includedir=$(includedir)" \
406         "infodir=$(infodir)" \
407         "libdir=$(libdir)" \
408         "libexecdir=$(libexecdir)" \
409         "lispdir=$(lispdir)" \
410         "libstdcxx_incdir=$(libstdcxx_incdir)" \
411         "libsubdir=$(libsubdir)" \
412         "localstatedir=$(localstatedir)" \
413         "mandir=$(mandir)" \
414         "oldincludedir=$(oldincludedir)" \
415         "prefix=$(prefix)" \
416         "sbindir=$(sbindir)" \
417         "sharedstatedir=$(sharedstatedir)" \
418         "sysconfdir=$(sysconfdir)" \
419         "tooldir=$(tooldir)" \
420         "build_tooldir=$(build_tooldir)" \
421         "gxx_include_dir=$(gxx_include_dir)" \
422         "gcc_version=$(gcc_version)" \
423         "gcc_version_trigger=$(gcc_version_trigger)" \
424         "target_alias=$(target_alias)" 
425
426 # For any flags above that may contain shell code that varies from one
427 # target library to another.  When doing recursive invocations of the
428 # top-level Makefile, we don't want the outer make to evaluate them,
429 # so we pass these variables down unchanged.  They must not contain
430 # single nor double quotes.
431 RECURSE_FLAGS = \
432         CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)'
433
434 # Flags to pass down to most sub-makes, in which we're building with
435 # the host environment.
436 # If any variables are added here, they must be added to do-*, below.
437 EXTRA_HOST_FLAGS = \
438         'AR=$(AR)' \
439         'AS=$(AS)' \
440         'CC=$(CC)' \
441         'CXX=$(CXX)' \
442         'DLLTOOL=$(DLLTOOL)' \
443         'LD=$(LD)' \
444         'NM=$(NM)' \
445         "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \
446         'WINDRES=$(WINDRES)'
447
448 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
449
450 # Flags that are concerned with the location of the X11 include files
451 # and library files
452 #
453 # NOTE: until the top-level is getting the values via autoconf, it only
454 # causes problems to have this top-level Makefile overriding the autoconf-set
455 # values in child directories.  Only variables that don't conflict with
456 # autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
457 #
458 X11_FLAGS_TO_PASS = \
459         'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
460         'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
461
462 # Flags to pass down to makes which are built with the target environment.
463 # The double $ decreases the length of the command line; the variables
464 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
465 # If any variables are added here, they must be added to do-*, below.
466 EXTRA_TARGET_FLAGS = \
467         'AR=$$(AR_FOR_TARGET)' \
468         'AS=$$(AS_FOR_TARGET)' \
469         'CC=$$(CC_FOR_TARGET)' \
470         'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
471         'CXX=$$(CXX_FOR_TARGET)' \
472         'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
473         'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
474         'LD=$$(LD_FOR_TARGET)' \
475         'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
476         'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
477         'NM=$$(NM_FOR_TARGET)' \
478         'RANLIB=$$(RANLIB_FOR_TARGET)' \
479         'WINDRES=$$(WINDRES_FOR_TARGET)'
480
481 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
482
483 # Flags to pass down to gcc.  gcc builds a library, libgcc.a, so it
484 # unfortunately needs the native compiler and the target ar and
485 # ranlib.
486 # If any variables are added here, they must be added to do-*, below.
487 # The HOST_* variables are a special case, which are used for the gcc
488 # cross-building scheme.
489 EXTRA_GCC_FLAGS = \
490         'AR=$(AR)' \
491         'AS=$(AS)' \
492         'CC=$(CC)' \
493         'CXX=$(CXX)' \
494         'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
495         'HOST_CC=$(CC_FOR_BUILD)' \
496         'BUILD_PREFIX=$(BUILD_PREFIX)' \
497         'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \
498         'NM=$(NM)' \
499         "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \
500         'WINDRES=$$(WINDRES_FOR_TARGET)' \
501         "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
502         "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
503         "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s/.*=$$/XFOO=/`" \
504         "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s/.*=$$/XFOO=/`" \
505         "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s/.*=$$/XFOO=/`" \
506         "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
507         "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
508         "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \
509         "`echo 'ENQUIRE=$(ENQUIRE)' | sed -e s/.*=$$/XFOO=/`" \
510         "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
511         "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`"
512
513 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
514
515 # This is a list of the targets for all of the modules which are compiled
516 # using the build machine's native compiler.  Configure edits the second
517 # macro for build!=host builds.
518 ALL_BUILD_MODULES_LIST = \
519         all-build-libiberty
520 ALL_BUILD_MODULES = @all_build_modules@
521
522 # This is a list of the configure targets for all of the modules which
523 # are compiled using the native tools.
524 CONFIGURE_BUILD_MODULES = \
525         configure-build-libiberty
526
527 # This is a list of the targets for all of the modules which are compiled
528 # using $(FLAGS_TO_PASS).
529 ALL_MODULES = [+ FOR host_modules +]\
530         all-[+module+] [+ ENDFOR host_modules +]\
531         $(EXTRA_TARGET_HOST_ALL_MODULES)
532
533 # This is a list of the check targets for all of the modules which are
534 # compiled using $(FLAGS_TO_PASS).
535 #
536 # The list is in two parts.  The first lists those tools which
537 # are tested as part of the host's native tool-chain, and not
538 # tested in a cross configuration.
539 NATIVE_CHECK_MODULES = \
540         check-bison \
541         check-byacc \
542         check-fastjar \
543         check-flex \
544         check-zip
545
546 CROSS_CHECK_MODULES = [+ FOR host_modules +][+ IF no_check  +][+ ELIF no_check_cross +][+ ELSE x +]\
547         check-[+module+] [+ ENDIF no_check +][+ ENDFOR host_modules +]\
548         $(EXTRA_TARGET_HOST_CHECK_MODULES)
549
550 CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
551
552 # This is a list of the install targets for all of the modules which are
553 # compiled using $(FLAGS_TO_PASS).
554 # We put install-opcodes before install-binutils because the installed
555 # binutils might be on PATH, and they might need the shared opcodes
556 # library.
557 # We put install-tcl before install-itcl because itcl wants to run a
558 # program on installation which uses the Tcl libraries.
559 INSTALL_MODULES = [+ FOR host_modules+][+ IF no_install +][+ ELSE no_install +]\
560         install-[+module+] [+ ENDIF no_install +][+ ENDFOR host_modules +]\
561         $(EXTRA_TARGET_HOST_INSTALL_MODULES)
562
563 # This is a list of the targets for all of the modules which are compiled
564 # using $(X11_FLAGS_TO_PASS).
565 ALL_X11_MODULES = \
566         all-gdb \
567         all-expect \
568         all-guile \
569         all-tclX \
570         all-tk \
571         all-tix
572
573 # This is a list of the check targets for all of the modules which are
574 # compiled using $(X11_FLAGS_TO_PASS).
575 CHECK_X11_MODULES = \
576         check-gdb \
577         check-guile \
578         check-expect \
579         check-tclX \
580         check-tk \
581         check-tix
582
583 # This is a list of the install targets for all the modules which are
584 # compiled using $(X11_FLAGS_TO_PASS).
585 INSTALL_X11_MODULES = \
586         install-gdb \
587         install-guile \
588         install-expect \
589         install-tclX \
590         install-tk \
591         install-tix
592
593 # This is a list of the targets for all of the modules which are compiled
594 # using $(TARGET_FLAGS_TO_PASS).
595 ALL_TARGET_MODULES = [+ FOR target_modules +]\
596         all-target-[+module+] [+ ENDFOR target_modules +]
597
598 # This is a list of the configure targets for all of the modules which
599 # are compiled using the target tools.
600 CONFIGURE_TARGET_MODULES = [+ FOR target_modules +]\
601         configure-target-[+module+] [+ ENDFOR target_modules +]
602
603 # This is a list of the check targets for all of the modules which are
604 # compiled using $(TARGET_FLAGS_TO_PASS).
605 CHECK_TARGET_MODULES = [+ FOR target_modules +][+ IF no_check +][+ ELSE check +]\
606         check-target-[+module+] [+ ENDIF no_check +][+ ENDFOR target_modules +]
607
608 # This is a list of the install targets for all of the modules which are
609 # compiled using $(TARGET_FLAGS_TO_PASS).
610 INSTALL_TARGET_MODULES = [+ FOR target_modules +][+ IF no_install +][+ ELSE install +]\
611         install-target-[+module+] [+ ENDIF no_install +][+ ENDFOR target_modules +]
612
613 # This is a list of the targets for which we can do a clean-{target}.
614 CLEAN_MODULES = [+ FOR host_modules +][+ IF no_clean +][+ ELSE no_clean +]\
615         clean-[+module+] [+ ENDIF no_clean +][+ ENDFOR host_modules +]
616
617 # All of the target modules that can be cleaned
618 CLEAN_TARGET_MODULES = [+ FOR target_modules +][+ IF no_clean +][+ ELSE clean +]\
619         clean-target-[+module+] [+ ENDIF no_clean +][+ ENDFOR target_modules +]
620
621 # All of the x11 modules that can be cleaned
622 CLEAN_X11_MODULES = \
623         clean-gdb \
624         clean-expect \
625         clean-guile \
626         clean-tclX \
627         clean-tk \
628         clean-tix
629
630 # The target built for a native build.
631 .PHONY: all.normal
632 all.normal: \
633         $(ALL_BUILD_MODULES) \
634         $(ALL_MODULES) \
635         $(ALL_X11_MODULES) \
636         $(ALL_TARGET_MODULES) \
637         all-gcc
638
639 # Do a target for all the subdirectories.  A ``make do-X'' will do a
640 # ``make X'' in all subdirectories (because, in general, there is a
641 # dependency (below) of X upon do-X, a ``make X'' will also do this,
642 # but it may do additional work as well).
643 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
644 # because it is so large that it can easily overflow the command line
645 # length limit on some systems.
646 DO_X = \
647         do-clean \
648         do-distclean \
649         do-dvi \
650         do-info \
651         do-install-info \
652         do-installcheck \
653         do-mostlyclean \
654         do-maintainer-clean \
655         do-TAGS
656 .PHONY: $(DO_X)
657 $(DO_X):
658         @target=`echo $@ | sed -e 's/^do-//'`; \
659         r=`${PWD}`; export r; \
660         s=`cd $(srcdir); ${PWD}`; export s; \
661         $(SET_LIB_PATH) \
662         for i in $(SUBDIRS) -dummy-; do \
663           if [ -f ./$$i/Makefile ]; then \
664             case $$i in \
665             gcc) \
666               for flag in $(EXTRA_GCC_FLAGS); do \
667                 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
668               done; \
669               ;; \
670             *) \
671               for flag in $(EXTRA_HOST_FLAGS); do \
672                 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
673               done; \
674               ;; \
675             esac ; \
676             if (cd ./$$i; \
677                 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
678                         "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
679                         "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
680                         "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
681                         $${target}); \
682             then true; else exit 1; fi; \
683           else true; fi; \
684         done
685         @target=`echo $@ | sed -e 's/^do-//'`; \
686         r=`${PWD}`; export r; \
687         s=`cd $(srcdir); ${PWD}`; export s; \
688         $(SET_LIB_PATH) \
689         for i in $(TARGET_CONFIGDIRS) -dummy-; do \
690           if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \
691             for flag in $(EXTRA_TARGET_FLAGS); do \
692                 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
693             done; \
694             if (cd $(TARGET_SUBDIR)/$$i; \
695                 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
696                         "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
697                         "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
698                         "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
699                         $${target}); \
700             then true; else exit 1; fi; \
701           else true; fi; \
702         done
703
704 # Here are the targets which correspond to the do-X targets.
705
706 .PHONY: info installcheck dvi install-info
707 .PHONY: clean distclean mostlyclean maintainer-clean realclean
708 .PHONY: local-clean local-distclean local-maintainer-clean
709 info: do-info
710 installcheck: do-installcheck
711 dvi: do-dvi
712
713 # Make sure makeinfo is built before we do a `make info'.
714 do-info: all-texinfo
715
716 install-info: do-install-info dir.info
717         s=`cd $(srcdir); ${PWD}`; export s; \
718         if [ -f dir.info ] ; then \
719           $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
720         else true ; fi
721
722 local-clean:
723         -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
724
725 local-distclean:
726         -rm -f Makefile config.status config.cache mh-frag mt-frag
727         -if [ "$(TARGET_SUBDIR)" != "." ]; then \
728           rm -rf $(TARGET_SUBDIR); \
729         else true; fi
730         -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile
731         -rm -f texinfo/doc/Makefile texinfo/po/POTFILES
732         -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null
733         -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null
734         -rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null
735
736 local-maintainer-clean:
737         @echo "This command is intended for maintainers to use;"
738         @echo "it deletes files that may require special tools to rebuild."
739
740 clean: do-clean local-clean
741 mostlyclean: do-mostlyclean local-clean
742 distclean: do-distclean local-clean local-distclean
743 maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean 
744 maintainer-clean: local-distclean
745 realclean: maintainer-clean
746
747 # This rule is used to clean specific modules.
748 .PHONY: $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc
749 $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc:
750         @dir=`echo $@ | sed -e 's/clean-//'`; \
751         if [ -f ./$${dir}/Makefile ] ; then \
752           r=`${PWD}`; export r; \
753           s=`cd $(srcdir); ${PWD}`; export s; \
754           $(SET_LIB_PATH) \
755           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) clean); \
756         else \
757           true; \
758         fi
759
760 .PHONY: $(CLEAN_TARGET_MODULES)
761 $(CLEAN_TARGET_MODULES):
762         @dir=`echo $@ | sed -e 's/clean-target-//'`; \
763         rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
764         if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
765           r=`${PWD}`; export r; \
766           s=`cd $(srcdir); ${PWD}`; export s; \
767           $(SET_LIB_PATH) \
768           (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \
769         else \
770           true; \
771         fi
772
773 clean-target: $(CLEAN_TARGET_MODULES) clean-target-libgcc
774 clean-target-libgcc:
775         test ! -d gcc/libgcc || \
776         (cd gcc/libgcc && find . -type d -print) | \
777         while read d; do rm -f gcc/$$d/libgcc.a || : ; done
778         -rm -rf gcc/libgcc
779
780 # Check target.
781
782 .PHONY: check do-check
783 check:
784         $(MAKE) do-check NOTPARALLEL=parallel-ok
785
786 do-check: $(CHECK_MODULES) \
787         $(CHECK_TARGET_MODULES) \
788         $(CHECK_X11_MODULES) \
789         check-gcc
790
791 # Automated reporting of test results.
792
793 warning.log: build.log
794         $(srcdir)/contrib/warn_summary build.log > $@
795
796 mail-report.log:
797         if test x'$(BOOT_CFLAGS)' != x''; then \
798             BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
799         fi; \
800         $(srcdir)/contrib/test_summary -t >$@
801         chmod +x $@
802         echo If you really want to send e-mail, run ./$@ now
803
804 mail-report-with-warnings.log: warning.log
805         if test x'$(BOOT_CFLAGS)' != x''; then \
806             BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
807         fi; \
808         $(srcdir)/contrib/test_summary -t -i warning.log >$@
809         chmod +x $@
810         echo If you really want to send e-mail, run ./$@ now
811
812 # Installation targets.
813
814 .PHONY: install install-cross uninstall source-vault binary-vault vault-install
815 install: $(INSTALL_TARGET) 
816 install-cross: $(INSTALL_TARGET_CROSS) 
817
818 uninstall:
819         @echo "the uninstall target is not supported in this tree"
820
821 source-vault:
822         $(MAKE) -f ./release/Build-A-Release \
823                 host=$(host_alias) source-vault
824
825 binary-vault:
826         $(MAKE) -f ./release/Build-A-Release \
827                 host=$(host_alias) target=$(target_alias)
828
829 vault-install:
830         @if [ -f ./release/vault-install ] ; then \
831           ./release/vault-install $(host_alias) $(target_alias) ; \
832         else \
833           true ; \
834         fi
835
836 .PHONY: install.all
837 install.all: install-no-fixedincludes
838         @if [ -f ./gcc/Makefile ] ; then \
839                 r=`${PWD}` ; export r ; \
840                 $(SET_LIB_PATH) \
841                 (cd ./gcc; \
842                 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
843         else \
844                 true ; \
845         fi
846
847 # install-no-fixedincludes is used because Cygnus can not distribute
848 # the fixed header files.
849 .PHONY: install-no-fixedincludes
850 install-no-fixedincludes: \
851         installdirs \
852         $(INSTALL_MODULES) \
853         $(INSTALL_TARGET_MODULES) \
854         $(INSTALL_X11_MODULES) \
855         gcc-no-fixedincludes 
856
857 # Install the gcc headers files, but not the fixed include files,
858 # which Cygnus is not allowed to distribute.  This rule is very
859 # dependent on the workings of the gcc Makefile.in.
860 .PHONY: gcc-no-fixedincludes
861 gcc-no-fixedincludes:
862         @if [ -f ./gcc/Makefile ]; then \
863           rm -rf gcc/tmp-include; \
864           mv gcc/include gcc/tmp-include 2>/dev/null; \
865           mkdir gcc/include; \
866           cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
867           touch gcc/stmp-fixinc gcc/include/fixed; \
868           rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
869           r=`${PWD}`; export r; \
870           s=`cd $(srcdir); ${PWD}` ; export s; \
871           $(SET_LIB_PATH) \
872           (cd ./gcc; \
873            $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
874           rm -rf gcc/include; \
875           mv gcc/tmp-include gcc/include 2>/dev/null; \
876         else true; fi
877
878 # This rule is used to build the modules which are built with the
879 # build machine's native compiler.
880 .PHONY: $(ALL_BUILD_MODULES)
881 $(ALL_BUILD_MODULES):
882         dir=`echo $@ | sed -e 's/all-build-//'`; \
883         if [ -f ./$${dir}/Makefile ] ; then \
884           r=`${PWD}`; export r; \
885           s=`cd $(srcdir); ${PWD}`; export s; \
886           (cd $(BUILD_SUBDIR)/$${dir} && $(MAKE) all); \
887         else \
888           true; \
889         fi
890
891 # This rule is used to configure the modules which are built with the
892 # native tools.
893 .PHONY: $(CONFIGURE_BUILD_MODULES)
894 $(CONFIGURE_BUILD_MODULES):
895         @dir=`echo $@ | sed -e 's/configure-build-//'`; \
896         if [ ! -d $(BUILD_SUBDIR) ]; then \
897           true; \
898         elif [ -f $(BUILD_SUBDIR)/$${dir}/Makefile ] ; then \
899           true; \
900         elif echo " $(BUILD_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
901           if [ -d $(srcdir)/$${dir} ]; then \
902             [ -d $(BUILD_SUBDIR)/$${dir} ] || mkdir $(BUILD_SUBDIR)/$${dir};\
903             r=`${PWD}`; export r; \
904             s=`cd $(srcdir); ${PWD}`; export s; \
905             AR="$(AR_FOR_BUILD)"; export AR; \
906             AS="$(AS_FOR_BUILD)"; export AS; \
907             CC="$(CC_FOR_BUILD)"; export CC; \
908             CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
909             CXX="$(CXX_FOR_BUILD)"; export CXX; \
910             CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
911             GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
912             DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
913             LD="$(LD_FOR_BUILD)"; export LD; \
914             LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
915             NM="$(NM_FOR_BUILD)"; export NM; \
916             RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
917             WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
918             echo Configuring in $(BUILD_SUBDIR)/$${dir}; \
919             cd "$(BUILD_SUBDIR)/$${dir}" || exit 1; \
920             case $(srcdir) in \
921             /* | [A-Za-z]:[\\/]*) \
922               topdir=$(srcdir) ;; \
923             *) \
924               case "$(BUILD_SUBDIR)" in \
925               .) topdir="../$(srcdir)" ;; \
926               *) topdir="../../$(srcdir)" ;; \
927               esac ;; \
928             esac; \
929             if [ "$(srcdir)" = "." ] ; then \
930               if [ "$(BUILD_SUBDIR)" != "." ] ; then \
931                 if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
932                   if [ -f Makefile ]; then \
933                     if $(MAKE) distclean; then \
934                       true; \
935                     else \
936                       exit 1; \
937                     fi; \
938                   else \
939                     true; \
940                   fi; \
941                 else \
942                   exit 1; \
943                 fi; \
944               else \
945                 true; \
946               fi; \
947               srcdiroption="--srcdir=."; \
948               libsrcdir="."; \
949             else \
950               srcdiroption="--srcdir=$${topdir}/$${dir}"; \
951               libsrcdir="$$s/$${dir}"; \
952             fi; \
953             if [ -f $${libsrcdir}/configure ] ; then \
954               rm -f no-such-file skip-this-dir; \
955               CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
956                 $(BUILD_CONFIGARGS) $${srcdiroption} \
957                 --with-build-subdir="$(BUILD_SUBDIR)"; \
958             else \
959               rm -f no-such-file skip-this-dir; \
960               CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
961                 $(BUILD_CONFIGARGS) $${srcdiroption} \
962                 --with-build-subdir="$(BUILD_SUBDIR)"; \
963             fi || exit 1; \
964             if [ -f skip-this-dir ] ; then \
965               sh skip-this-dir; \
966               rm -f skip-this-dir; \
967               cd ..; rmdir $${dir} || true; \
968             else \
969               true; \
970             fi; \
971           else \
972             true; \
973           fi; \
974         else \
975           true; \
976         fi
977
978 # This rule is used to build the modules which use FLAGS_TO_PASS.  To
979 # build a target all-X means to cd to X and make all.
980 #
981 # all-gui, and all-libproc are handled specially because
982 # they are still experimental, and if they fail to build, that
983 # shouldn't stop "make all".
984 .PHONY: $(ALL_MODULES) all-gui all-libproc
985 $(ALL_MODULES) all-gui all-libproc:
986         @dir=`echo $@ | sed -e 's/all-//'`; \
987         if [ -f ./$${dir}/Makefile ] ; then \
988           r=`${PWD}`; export r; \
989           s=`cd $(srcdir); ${PWD}`; export s; \
990           $(SET_LIB_PATH) \
991           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
992         else \
993           true; \
994         fi
995
996 # These rules are used to check the modules which use FLAGS_TO_PASS.
997 # To build a target check-X means to cd to X and make check.  Some
998 # modules are only tested in a native toolchain.
999
1000 .PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
1001 $(NATIVE_CHECK_MODULES):
1002         @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
1003           dir=`echo $@ | sed -e 's/check-//'`; \
1004           if [ -f ./$${dir}/Makefile ] ; then \
1005             r=`${PWD}`; export r; \
1006             s=`cd $(srcdir); ${PWD}`; export s; \
1007             $(SET_LIB_PATH) \
1008             (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1009           else \
1010             true; \
1011           fi; \
1012         fi
1013
1014 $(CROSS_CHECK_MODULES):
1015         @dir=`echo $@ | sed -e 's/check-//'`; \
1016         if [ -f ./$${dir}/Makefile ] ; then \
1017           r=`${PWD}`; export r; \
1018           s=`cd $(srcdir); ${PWD}`; export s; \
1019           $(SET_LIB_PATH) \
1020           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1021         else \
1022           true; \
1023         fi
1024
1025 # This rule is used to install the modules which use FLAGS_TO_PASS.
1026 # To build a target install-X means to cd to X and make install.
1027 .PHONY: $(INSTALL_MODULES)
1028 $(INSTALL_MODULES): installdirs
1029         @dir=`echo $@ | sed -e 's/install-//'`; \
1030         if [ -f ./$${dir}/Makefile ] ; then \
1031           r=`${PWD}`; export r; \
1032           s=`cd $(srcdir); ${PWD}`; export s; \
1033           $(SET_LIB_PATH) \
1034           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1035         else \
1036           true; \
1037         fi
1038
1039 # This rule is used to configure the modules which are built with the
1040 # target tools.
1041 .PHONY: $(CONFIGURE_TARGET_MODULES)
1042 $(CONFIGURE_TARGET_MODULES):
1043         @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1044         if [ -d $(TARGET_SUBDIR)/$${dir} ]; then \
1045           r=`${PWD}`; export r; \
1046           $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/$${dir}/tmpmulti.out 2> /dev/null; \
1047           if [ -s $(TARGET_SUBDIR)/$${dir}/tmpmulti.out ]; then \
1048             if [ -f $(TARGET_SUBDIR)/$${dir}/multilib.out ]; then \
1049               if cmp $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out > /dev/null; then \
1050                 rm -f $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
1051               else \
1052                 echo "Multilibs changed for $${dir}, reconfiguring"; \
1053                 rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/Makefile; \
1054                 mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1055               fi; \
1056             else \
1057               mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1058             fi; \
1059           fi; \
1060         fi; exit 0      # break command into two pieces
1061         @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1062         if [ ! -d $(TARGET_SUBDIR) ]; then \
1063           true; \
1064         elif [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1065           true; \
1066         elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
1067           if [ -d $(srcdir)/$${dir} ]; then \
1068             [ -d $(TARGET_SUBDIR)/$${dir} ] || mkdir $(TARGET_SUBDIR)/$${dir};\
1069             r=`${PWD}`; export r; \
1070             s=`cd $(srcdir); ${PWD}`; export s; \
1071             $(SET_LIB_PATH) \
1072             AR="$(AR_FOR_TARGET)"; export AR; \
1073             AS="$(AS_FOR_TARGET)"; export AS; \
1074             CC="$(CC_FOR_TARGET)"; export CC; \
1075             CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
1076             CXX="$(CXX_FOR_TARGET)"; export CXX; \
1077             CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
1078             GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
1079             DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
1080             LD="$(LD_FOR_TARGET)"; export LD; \
1081             LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
1082             NM="$(NM_FOR_TARGET)"; export NM; \
1083             RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
1084             WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
1085             echo Configuring in $(TARGET_SUBDIR)/$${dir}; \
1086             cd "$(TARGET_SUBDIR)/$${dir}" || exit 1; \
1087             case $(srcdir) in \
1088             /* | [A-Za-z]:[\\/]*) \
1089               topdir=$(srcdir) ;; \
1090             *) \
1091               case "$(TARGET_SUBDIR)" in \
1092               .) topdir="../$(srcdir)" ;; \
1093               *) topdir="../../$(srcdir)" ;; \
1094               esac ;; \
1095             esac; \
1096             if [ "$(srcdir)" = "." ] ; then \
1097               if [ "$(TARGET_SUBDIR)" != "." ] ; then \
1098                 if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
1099                   if [ -f Makefile ]; then \
1100                     if $(MAKE) distclean; then \
1101                       true; \
1102                     else \
1103                       exit 1; \
1104                     fi; \
1105                   else \
1106                     true; \
1107                   fi; \
1108                 else \
1109                   exit 1; \
1110                 fi; \
1111               else \
1112                 true; \
1113               fi; \
1114               srcdiroption="--srcdir=."; \
1115               libsrcdir="."; \
1116             else \
1117               srcdiroption="--srcdir=$${topdir}/$${dir}"; \
1118               libsrcdir="$$s/$${dir}"; \
1119             fi; \
1120             if [ -f $${libsrcdir}/configure ] ; then \
1121               rm -f no-such-file skip-this-dir; \
1122               CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
1123                 $(TARGET_CONFIGARGS) $${srcdiroption} \
1124                 --with-target-subdir="$(TARGET_SUBDIR)"; \
1125             else \
1126               rm -f no-such-file skip-this-dir; \
1127               CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
1128                 $(TARGET_CONFIGARGS) $${srcdiroption} \
1129                 --with-target-subdir="$(TARGET_SUBDIR)"; \
1130             fi || exit 1; \
1131             if [ -f skip-this-dir ] ; then \
1132               sh skip-this-dir; \
1133               rm -f skip-this-dir; \
1134               cd ..; rmdir $${dir} || true; \
1135             else \
1136               true; \
1137             fi; \
1138           else \
1139             true; \
1140           fi; \
1141         else \
1142           true; \
1143         fi
1144
1145 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
1146 # To build a target all-X means to cd to X and make all.
1147 .PHONY: $(ALL_TARGET_MODULES)
1148 $(ALL_TARGET_MODULES):
1149         @dir=`echo $@ | sed -e 's/all-target-//'`; \
1150         if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1151           r=`${PWD}`; export r; \
1152           s=`cd $(srcdir); ${PWD}`; export s; \
1153           $(SET_LIB_PATH) \
1154           (cd $(TARGET_SUBDIR)/$${dir}; \
1155             $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
1156         else \
1157           true; \
1158         fi
1159
1160 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
1161 # To build a target install-X means to cd to X and make install.
1162 .PHONY: $(CHECK_TARGET_MODULES)
1163 $(CHECK_TARGET_MODULES):
1164         @dir=`echo $@ | sed -e 's/check-target-//'`; \
1165         if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1166           r=`${PWD}`; export r; \
1167           s=`cd $(srcdir); ${PWD}`; export s; \
1168           $(SET_LIB_PATH) \
1169           (cd $(TARGET_SUBDIR)/$${dir}; \
1170             $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
1171         else \
1172           true; \
1173         fi
1174
1175 # This rule is used to install the modules which use
1176 # TARGET_FLAGS_TO_PASS.  To build a target install-X means to cd to X
1177 # and make install.
1178 .PHONY: $(INSTALL_TARGET_MODULES)
1179 $(INSTALL_TARGET_MODULES): installdirs
1180         @dir=`echo $@ | sed -e 's/install-target-//'`; \
1181         if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1182           r=`${PWD}`; export r; \
1183           s=`cd $(srcdir); ${PWD}`; export s; \
1184           $(SET_LIB_PATH) \
1185           (cd $(TARGET_SUBDIR)/$${dir}; \
1186             $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
1187         else \
1188           true; \
1189         fi
1190
1191 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
1192 # To build a target all-X means to cd to X and make all.
1193 .PHONY: $(ALL_X11_MODULES)
1194 $(ALL_X11_MODULES):
1195         @dir=`echo $@ | sed -e 's/all-//'`; \
1196         if [ -f ./$${dir}/Makefile ] ; then \
1197           r=`${PWD}`; export r; \
1198           s=`cd $(srcdir); ${PWD}`; export s; \
1199           $(SET_LIB_PATH) \
1200           (cd $${dir}; \
1201            $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
1202         else \
1203           true; \
1204         fi
1205
1206 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
1207 # To build a target check-X means to cd to X and make all.
1208 .PHONY: $(CHECK_X11_MODULES)
1209 $(CHECK_X11_MODULES):
1210         @dir=`echo $@ | sed -e 's/check-//'`; \
1211         if [ -f ./$${dir}/Makefile ] ; then \
1212           r=`${PWD}`; export r; \
1213           s=`cd $(srcdir); ${PWD}`; export s; \
1214           $(SET_LIB_PATH) \
1215           (cd $${dir}; \
1216            $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
1217         else \
1218           true; \
1219         fi
1220
1221 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
1222 # To build a target install-X means to cd to X and make install.
1223 .PHONY: $(INSTALL_X11_MODULES)
1224 $(INSTALL_X11_MODULES): installdirs
1225         @dir=`echo $@ | sed -e 's/install-//'`; \
1226         if [ -f ./$${dir}/Makefile ] ; then \
1227           r=`${PWD}`; export r; \
1228           s=`cd $(srcdir); ${PWD}`; export s; \
1229           $(SET_LIB_PATH) \
1230           (cd $${dir}; \
1231            $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
1232         else \
1233           true; \
1234         fi
1235
1236 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
1237 .PHONY: all-gcc
1238 all-gcc:
1239         @if [ -f ./gcc/Makefile ] ; then \
1240           r=`${PWD}`; export r; \
1241           s=`cd $(srcdir); ${PWD}`; export s; \
1242           $(SET_LIB_PATH) \
1243           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
1244         else \
1245           true; \
1246         fi
1247
1248 # Building GCC uses some tools for rebuilding "source" files
1249 # like texinfo, bison/byacc, etc.  So we must depend on those.
1250 #
1251 # While building GCC, it may be necessary to run various target
1252 # programs like the assembler, linker, etc.  So we depend on
1253 # those too.
1254 #
1255 # In theory, on an SMP all those dependencies can be resolved
1256 # in parallel.
1257 #
1258 .PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean
1259 bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean: all-bootstrap
1260         @r=`${PWD}`; export r; \
1261         s=`cd $(srcdir); ${PWD}`; export s; \
1262         $(SET_LIB_PATH) \
1263         echo "Bootstrapping the compiler"; \
1264         cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@
1265         @r=`${PWD}`; export r; \
1266         s=`cd $(srcdir); ${PWD}`; export s; \
1267         case "$@" in \
1268           *bootstrap4-lean ) \
1269                         msg="Comparing stage3 and stage4 of the compiler"; \
1270                         compare=compare3-lean ;; \
1271           *bootstrap4 ) msg="Comparing stage3 and stage4 of the compiler"; \
1272                         compare=compare3 ;; \
1273           *-lean )      msg="Comparing stage2 and stage3 of the compiler"; \
1274                         compare=compare-lean ;; \
1275           * )           msg="Comparing stage2 and stage3 of the compiler"; \
1276                         compare=compare ;; \
1277         esac; \
1278         $(SET_LIB_PATH) \
1279         echo "$$msg"; \
1280         cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
1281         @r=`${PWD}`; export r; \
1282         s=`cd $(srcdir); ${PWD}` ; export s; \
1283         $(SET_LIB_PATH) \
1284         echo "Building runtime libraries"; \
1285         $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
1286
1287 .PHONY: cross
1288 cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
1289         @r=`${PWD}`; export r; \
1290         s=`cd $(srcdir); ${PWD}`; export s; \
1291         $(SET_LIB_PATH) \
1292         echo "Building the C and C++ compiler"; \
1293         cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
1294         @r=`${PWD}`; export r; \
1295         s=`cd $(srcdir); ${PWD}` ; export s; \
1296         $(SET_LIB_PATH) \
1297         echo "Building runtime libraries"; \
1298         $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \
1299           LANGUAGES="c c++" all
1300
1301 .PHONY: check-gcc
1302 check-gcc:
1303         @if [ -f ./gcc/Makefile ] ; then \
1304           r=`${PWD}`; export r; \
1305           s=`cd $(srcdir); ${PWD}`; export s; \
1306           $(SET_LIB_PATH) \
1307           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
1308         else \
1309           true; \
1310         fi
1311
1312 .PHONY: check-c++
1313 check-c++:
1314         @if [ -f ./gcc/Makefile ] ; then \
1315           r=`${PWD}`; export r; \
1316           s=`cd $(srcdir); ${PWD}`; export s; \
1317           $(SET_LIB_PATH) \
1318           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \
1319           $(MAKE) check-target-libstdc++-v3; \
1320         else \
1321           true; \
1322         fi 
1323
1324 .PHONY: install-gcc
1325 install-gcc:
1326         @if [ -f ./gcc/Makefile ] ; then \
1327           r=`${PWD}`; export r; \
1328           s=`cd $(srcdir); ${PWD}`; export s; \
1329           $(SET_LIB_PATH) \
1330           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1331         else \
1332           true; \
1333         fi
1334
1335 .PHONY: install-gcc-cross
1336 install-gcc-cross:
1337         @if [ -f ./gcc/Makefile ] ; then \
1338           r=`${PWD}`; export r; \
1339           s=`cd $(srcdir); ${PWD}`; export s; \
1340           $(SET_LIB_PATH) \
1341           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" install); \
1342         else \
1343           true; \
1344         fi
1345 # EXPERIMENTAL STUFF
1346 # This rule is used to install the modules which use FLAGS_TO_PASS.
1347 # To build a target install-X means to cd to X and make install.
1348 .PHONY: install-dosrel
1349 install-dosrel: installdirs info
1350         @dir=`echo $@ | sed -e 's/install-//'`; \
1351         if [ -f ./$${dir}/Makefile ] ; then \
1352           r=`${PWD}`; export r; \
1353           s=`cd $(srcdir); ${PWD}`; export s; \
1354           $(SET_LIB_PATH) \
1355           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1356         else \
1357           true; \
1358         fi
1359
1360 install-dosrel-fake:
1361
1362 ALL_GCC = all-gcc
1363 ALL_GCC_C = $(ALL_GCC) all-target-newlib all-target-libgloss
1364 ALL_GCC_CXX = $(ALL_GCC_C) all-target-libstdc++-v3
1365
1366 # This is a list of inter-dependencies among modules.
1367 all-ash:
1368 all-autoconf: all-m4 all-texinfo
1369 all-automake: all-m4 all-texinfo
1370 all-bash:
1371 all-bfd: all-libiberty all-intl
1372 all-binutils: all-libiberty all-opcodes all-bfd all-flex all-bison all-byacc all-intl
1373 all-bison: all-texinfo
1374 configure-target-boehm-gc: $(ALL_GCC_C) configure-target-qthreads
1375 all-byacc:
1376 all-bzip2:
1377 all-db:
1378 all-dejagnu: all-tcl all-expect all-tk
1379 all-diff: all-libiberty
1380 all-etc:
1381 configure-target-examples: $(ALL_GCC_C)
1382 all-expect: all-tcl all-tk
1383 all-fileutils: all-libiberty
1384 all-findutils:
1385 all-find:
1386 all-flex: all-libiberty all-bison all-byacc
1387 all-gas: all-libiberty all-opcodes all-bfd all-intl
1388 all-gawk:
1389 all-gcc: all-bison all-byacc all-binutils all-gas all-ld all-zlib
1390 all-bootstrap: all-libiberty all-texinfo all-bison all-byacc all-binutils all-gas all-ld all-zlib
1391 GDB_TK = @GDB_TK@
1392 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-bison all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
1393 all-gettext:
1394 all-gnuserv:
1395 configure-target-gperf: $(ALL_GCC_CXX)
1396 all-target-gperf: all-target-libiberty all-target-libstdc++-v3
1397 all-gprof: all-libiberty all-bfd all-opcodes all-intl
1398 all-grep: all-libiberty
1399 all-gui: all-gdb all-libproc
1400 all-guile:
1401 all-gzip: all-libiberty
1402 all-hello: all-libiberty
1403 all-indent:
1404 all-intl:
1405 all-itcl: all-tcl all-tk
1406 all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex all-intl
1407 configure-target-libgloss: $(ALL_GCC)
1408 all-target-libgloss: configure-target-newlib
1409 all-libgui: all-tcl all-tk all-itcl
1410 all-libiberty:
1411
1412 all-build-libiberty: configure-build-libiberty
1413
1414 configure-target-libffi: $(ALL_GCC_C) 
1415 configure-target-libjava: $(ALL_GCC_C) configure-target-zlib configure-target-boehm-gc configure-target-qthreads configure-target-libffi
1416 all-target-libjava: all-fastjar all-target-zlib all-target-boehm-gc all-target-qthreads all-target-libffi
1417 configure-target-libstdc++-v3: $(ALL_GCC_C)
1418 all-target-libstdc++-v3: all-target-libiberty
1419 all-libtool:
1420 configure-target-libf2c: $(ALL_GCC_C)
1421 all-target-libf2c: all-target-libiberty
1422 configure-target-libobjc: $(ALL_GCC_C)
1423 all-target-libobjc: all-target-libiberty
1424 all-m4: all-libiberty all-texinfo
1425 all-make: all-libiberty
1426 all-mmalloc:
1427 configure-target-newlib: $(ALL_GCC)
1428 configure-target-libtermcap: $(ALL_GCC_C)
1429 all-opcodes: all-bfd all-libiberty
1430 all-patch: all-libiberty
1431 all-perl:
1432 all-prms: all-libiberty
1433 configure-target-qthreads: $(ALL_GCC_C)
1434 all-rcs:
1435 all-readline:
1436 all-recode: all-libiberty
1437 all-sed: all-libiberty
1438 all-send-pr: all-prms
1439 all-shellutils:
1440 all-sid: all-tcl all-tk
1441 all-sim: all-libiberty all-bfd all-opcodes all-readline
1442 all-snavigator: all-tcl all-tk all-itcl all-tix all-db all-grep all-libgui
1443 all-tar: all-libiberty
1444 all-tcl:
1445 all-tclX: all-tcl all-tk
1446 all-tk: all-tcl
1447 all-texinfo: all-libiberty
1448 all-textutils:
1449 all-time:
1450 all-tix: all-tcl all-tk
1451 all-wdiff:
1452 configure-target-winsup: $(ALL_GCC_C)
1453 all-target-winsup: all-target-libiberty all-target-libtermcap
1454 all-uudecode: all-libiberty
1455 all-zip:
1456 all-zlib:
1457 configure-target-zlib: $(ALL_GCC_C)
1458 all-fastjar: all-zlib all-libiberty
1459 configure-target-fastjar: configure-target-zlib
1460 all-target-fastjar: configure-target-fastjar all-target-zlib all-target-libiberty
1461 configure-target-libiberty: $(ALL_GCC_C)
1462 all-target: $(ALL_TARGET_MODULES)
1463 install-target: $(INSTALL_TARGET_MODULES)
1464 install-gdb: install-tcl install-tk install-itcl install-tix install-libgui
1465 install-sid: install-tcl install-tk
1466
1467 # Dependencies of all-target-foo on configure-target-foo.
1468 [+ FOR target_modules +]all-target-[+module+]: configure-target-[+module+]
1469 [+ ENDFOR target_modules +]
1470
1471 ### other supporting targets
1472
1473 MAKEDIRS= \
1474         $(DESTDIR)$(prefix) \
1475         $(DESTDIR)$(exec_prefix)
1476 .PHONY: installdirs
1477 installdirs: mkinstalldirs
1478         $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
1479
1480 dir.info: do-install-info
1481         if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
1482           $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
1483           mv -f dir.info.new dir.info ; \
1484         else true ; \
1485         fi
1486
1487 dist:
1488         @echo "Building a full distribution of this tree isn't done"
1489         @echo "via 'make dist'.  Check out the etc/ subdirectory" 
1490
1491 etags tags: TAGS
1492
1493 # Right now this just builds TAGS in each subdirectory.  emacs19 has the
1494 # ability to use several tags files at once, so there is probably no need
1495 # to combine them into one big TAGS file (like CVS 1.3 does).  We could
1496 # (if we felt like it) have this Makefile write a piece of elisp which
1497 # the user could load to tell emacs19 where all the TAGS files we just
1498 # built are.
1499 TAGS: do-TAGS
1500
1501 # Rebuilding Makefile.in, using autogen.
1502 $(srcdir)/Makefile.in: # $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def
1503         cd $(srcdir) && autogen Makefile.def
1504
1505 # with the gnu make, this is done automatically.
1506
1507 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag) $(gcc_version_trigger)
1508         $(SHELL) ./config.status
1509
1510 #
1511 # Support for building net releases
1512
1513 # Files in devo used in any net release.
1514 # ChangeLog omitted because it may refer to files which are not in this
1515 # distribution (perhaps it would be better to include it anyway).
1516 DEVO_SUPPORT= README Makefile.in configure configure.in \
1517         config.guess config.if config.sub config move-if-change \
1518         mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \
1519         COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
1520         mkinstalldirs ltconfig ltmain.sh missing ylwrap \
1521         libtool.m4 gettext.m4 ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh
1522
1523 # Files in devo/etc used in any net release.
1524 # ChangeLog omitted because it may refer to files which are not in this
1525 # distribution (perhaps it would be better to include it anyway).
1526 ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
1527         make-stds.texi standards.info* configure.texi configure.info* \
1528         configbuild.* configdev.*
1529
1530
1531 # When you use `make setup-dirs' or `make taz' you should always redefine
1532 # this macro.
1533 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1534
1535 # NOTE: No double quotes in the below.  It is used within shell script
1536 # as VER="$(VER)"
1537 VER = ` if grep 'AM_INIT_AUTOMAKE.*BFD_VERSION' $(TOOL)/configure.in >/dev/null 2>&1; then \
1538           sed < bfd/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
1539         elif grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
1540           sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
1541         elif test -f $(TOOL)/version.in; then \
1542           head -1 $(TOOL)/version.in; \
1543         elif grep VERSION $(TOOL)/Makefile.in > /dev/null 2>&1; then \
1544           sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \
1545         else \
1546           echo VERSION; \
1547         fi`
1548 PACKAGE = $(TOOL)
1549
1550 .PHONY: taz
1551 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1552         $(MAKE) -f Makefile.in do-proto-toplev \
1553                 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1554                 MD5PROG="$(MD5PROG)" \
1555                 SUPPORT_FILES="$(SUPPORT_FILES)"
1556         $(MAKE) -f Makefile.in do-md5sum \
1557                 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1558                 MD5PROG="$(MD5PROG)" \
1559                 SUPPORT_FILES="$(SUPPORT_FILES)"
1560         $(MAKE) -f Makefile.in do-tar \
1561                 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1562                 MD5PROG="$(MD5PROG)" \
1563                 SUPPORT_FILES="$(SUPPORT_FILES)"
1564         $(MAKE) -f Makefile.in do-bz2 \
1565                 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1566                 MD5PROG="$(MD5PROG)" \
1567                 SUPPORT_FILES="$(SUPPORT_FILES)"
1568
1569 .PHONY: gdb-tar
1570 gdb-tar: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1571         $(MAKE) -f Makefile.in do-proto-toplev \
1572                 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1573                 MD5PROG="$(MD5PROG)" \
1574                 SUPPORT_FILES="$(SUPPORT_FILES)"
1575         $(MAKE) -f Makefile.in do-md5sum \
1576                 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1577                 MD5PROG="$(MD5PROG)" \
1578                 SUPPORT_FILES="$(SUPPORT_FILES)"
1579         $(MAKE) -f Makefile.in do-djunpack \
1580                 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1581                 MD5PROG="$(MD5PROG)" \
1582                 SUPPORT_FILES="$(SUPPORT_FILES)"
1583         $(MAKE) -f Makefile.in do-tar \
1584                 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1585                 MD5PROG="$(MD5PROG)" \
1586                 SUPPORT_FILES="$(SUPPORT_FILES)"
1587
1588 .PHONY: gdb-taz
1589 gdb-taz: gdb-tar $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1590         $(MAKE) -f Makefile.in gdb-tar \
1591                 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1592                 MD5PROG="$(MD5PROG)" \
1593                 SUPPORT_FILES="$(SUPPORT_FILES)"
1594         $(MAKE) -f Makefile.in do-bz2 \
1595                 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1596                 MD5PROG="$(MD5PROG)" \
1597                 SUPPORT_FILES="$(SUPPORT_FILES)"
1598
1599 .PHONY: do-proto-toplev
1600 do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1601         echo "==> Making $(PACKAGE)-$(VER)/"
1602         # Take out texinfo from a few places.
1603         sed -e '/^all\.normal: /s/\all-texinfo //' \
1604             -e '/^      install-texinfo /d' \
1605         <Makefile.in >tmp
1606         mv -f tmp Makefile.in
1607         #
1608         ./configure sun4
1609         [ -z "$(CONFIGURE_TARGET_MODULES)" ] \
1610           || $(MAKE) $(CONFIGURE_TARGET_MODULES) \
1611             ALL_GCC="" ALL_GCC_C="" ALL_GCC_CXX="" \
1612             CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
1613         # Make links, and run "make diststuff" or "make info" when needed.
1614         rm -rf proto-toplev ; mkdir proto-toplev
1615         set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1616         for d in $$dirs ; do \
1617           if [ -d $$d ]; then \
1618             if [ ! -f $$d/Makefile ] ; then true ; \
1619             elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
1620                 (cd $$d ; $(MAKE) diststuff ) || exit 1 ; \
1621             elif grep '^info:' $$d/Makefile >/dev/null ; then \
1622                 (cd $$d ; $(MAKE) info ) || exit 1 ; \
1623             fi ; \
1624             if [ -d $$d/proto-$$d.dir ]; then \
1625               ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1626             else \
1627               ln -s ../$$d proto-toplev/$$d ; \
1628             fi ; \
1629           else ln -s ../$$d proto-toplev/$$d ; fi ; \
1630         done
1631         cd etc && $(MAKE) info
1632         $(MAKE) distclean
1633         #
1634         mkdir proto-toplev/etc
1635         (cd proto-toplev/etc; \
1636          for i in $(ETC_SUPPORT); do \
1637                 ln -s ../../etc/$$i . ; \
1638          done)
1639         #
1640         # Take out texinfo from configurable dirs
1641         rm proto-toplev/configure.in
1642         sed -e '/^host_tools=/s/texinfo //' \
1643             <configure.in >proto-toplev/configure.in
1644         #
1645         mkdir proto-toplev/texinfo
1646         ln -s ../../texinfo/texinfo.tex         proto-toplev/texinfo/
1647         if test -r texinfo/util/tex3patch ; then \
1648           mkdir proto-toplev/texinfo/util && \
1649           ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
1650         else true; fi
1651         chmod -R og=u . || chmod og=u `find . -print`
1652         #
1653         # Create .gmo files from .po files.
1654         for f in `find . -name '*.po' -type f -print`; do \
1655              msgfmt -o `echo $$f | sed -e 's/\.po$$/.gmo/'` $$f ; \
1656         done
1657         #
1658         -rm -f $(PACKAGE)-$(VER)
1659         ln -s proto-toplev $(PACKAGE)-$(VER)
1660
1661 .PHONY: do-tar
1662 do-tar:
1663         echo "==> Making $(PACKAGE)-$(VER).tar"
1664         -rm -f $(PACKAGE)-$(VER).tar
1665         find $(PACKAGE)-$(VER) -follow -name CVS -prune -o -type f -print \
1666                 | tar cTfh - $(PACKAGE)-$(VER).tar
1667
1668 .PHONY: do-bz2
1669 do-bz2:
1670         echo "==> Bzipping $(PACKAGE)-$(VER).tar.bz2"
1671         -rm -f $(PACKAGE)-$(VER).tar.bz2
1672         $(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar
1673
1674 .PHONY: do-md5sum
1675 do-md5sum:
1676         echo "==> Adding md5 checksum to top-level directory"
1677         cd proto-toplev && find * -follow -name CVS -prune -o -type f -print \
1678                 | xargs $(MD5PROG) > ../md5.sum
1679         mv md5.sum proto-toplev
1680
1681 .PHONY: do-djunpack
1682 do-djunpack:
1683         echo "==> Adding updated djunpack.bat to top-level directory"
1684         echo - 's /gdb-[0-9\.]*/gdb-'"$(VER)"'/'
1685         sed < djunpack.bat > djunpack.new \
1686                 -e 's/gdb-[0-9][0-9\.]*/gdb-'"$(VER)"'/'
1687         mv djunpack.new djunpack.bat
1688         -rm -f proto-toplev/djunpack.bat
1689         ln -s ../djunpack.bat proto-toplev/djunpack.bat
1690
1691 TEXINFO_SUPPORT= texinfo/texinfo.tex
1692 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1693
1694 .PHONY: gas.tar.bz2
1695 GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep
1696 gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1697         $(MAKE) -f Makefile.in taz TOOL=gas \
1698                 MD5PROG="$(MD5PROG)" \
1699                 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1700
1701 # The FSF "binutils" release includes gprof and ld.
1702 .PHONY: binutils.tar.bz2
1703 BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms mkdep
1704 binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1705         $(MAKE) -f Makefile.in taz TOOL=binutils \
1706                 MD5PROG="$(MD5PROG)" \
1707                 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
1708
1709 .PHONY: gas+binutils.tar.bz2
1710 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1711 gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1712         $(MAKE) -f Makefile.in taz TOOL=gas \
1713                 MD5PROG="$(MD5PROG)" \
1714                 SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
1715
1716 GNATS_SUPPORT_DIRS=include libiberty send-pr
1717 gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
1718         $(MAKE) -f  Makefile.in taz TOOL=gnats \
1719                 MD5PROG="$(MD5PROG)" \
1720                 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1721
1722 .PHONY: gdb.tar.bz2
1723 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils intl
1724 gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1725         $(MAKE) -f Makefile.in gdb-taz TOOL=gdb \
1726                 MD5PROG="$(MD5PROG)" \
1727                 SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
1728 .PHONY: gdb.tar
1729 gdb.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1730         $(MAKE) -f Makefile.in gdb-tar TOOL=gdb \
1731                 MD5PROG="$(MD5PROG)" \
1732                 SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
1733
1734 DEJAGNU_SUPPORT_DIRS=  tcl expect libiberty
1735 .PHONY: dejagnu.tar.bz2
1736 dejagnu.tar.bz2: $(DIST_SUPPORT) $(DEJAGNU_SUPPORT_DIRS) dejagnu
1737         $(MAKE) -f Makefile.in taz TOOL=dejagnu \
1738                 MD5PROG="$(MD5PROG)" \
1739                 SUPPORT_FILES="$(DEJAGNU_SUPPORT_DIRS)"
1740
1741 .PHONY: gdb+dejagnu.tar.bz2
1742 GDBD_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl expect dejagnu
1743 gdb+dejagnu.tar.bz2: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb
1744         $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE=gdb+dejagnu \
1745                 MD5PROG="$(MD5PROG)" \
1746                 SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"
1747 .PHONY: gdb+dejagnu.tar
1748 gdb+dejagnu.tar: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb
1749         $(MAKE) -f Makefile.in gdb-tar TOOL=gdb PACKAGE=gdb+dejagnu \
1750                 MD5PROG="$(MD5PROG)" \
1751                 SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"
1752
1753 .PHONY: insight.tar.bz2
1754 INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl tix libgui
1755 insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1756         $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE=insight \
1757                 MD5PROG="$(MD5PROG)" \
1758                 SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
1759 .PHONY: insight.tar
1760 insight.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1761         $(MAKE) -f Makefile.in gdb-tar TOOL=gdb PACKAGE=insight \
1762                 MD5PROG="$(MD5PROG)" \
1763                 SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
1764
1765 .PHONY: insight+dejagnu.tar.bz2
1766 INSIGHTD_SUPPORT_DIRS= $(INSIGHT_SUPPORT_DIRS) expect dejagnu
1767 insight+dejagnu.tar.bz2: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
1768         $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE="insight+dejagnu" \
1769                 MD5PROG="$(MD5PROG)" \
1770                 SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"
1771 .PHONY: insight+dejagnu.tar
1772 insight+dejagnu.tar: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
1773         $(MAKE) -f Makefile.in gdb-tar TOOL=gdb PACKAGE="insight+dejagnu" \
1774                 MD5PROG="$(MD5PROG)" \
1775                 SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"
1776
1777 .PHONY: newlib.tar.bz2
1778 NEWLIB_SUPPORT_DIRS=libgloss
1779 # taz configures for the sun4 target which won't configure newlib.
1780 # We need newlib configured so that the .info files are made.
1781 # Unfortunately, it is not enough to just configure newlib separately:
1782 # taz will build the .info files but since SUBDIRS won't contain newlib,
1783 # distclean won't be run (leaving Makefile, config.status, and the tmp files
1784 # used in building the .info files, eg: *.def, *.ref).
1785 # The problem isn't solvable however without a lot of extra work because
1786 # target libraries are built in subdir $(target_alias) which gets nuked during
1787 # the make distclean.  For now punt on the issue of shipping newlib info files
1788 # with newlib net releases and wait for a day when some native target (sun4?)
1789 # supports newlib (if only minimally).
1790 newlib.tar.bz2: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
1791         $(MAKE) -f Makefile.in taz TOOL=newlib \
1792                 MD5PROG="$(MD5PROG)" \
1793                 SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
1794                 DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
1795
1796 .NOEXPORT:
1797 MAKEOVERRIDES=
1798
1799 # end of Makefile.in