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