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