OSDN Git Service

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