OSDN Git Service

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