OSDN Git Service

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