OSDN Git Service

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