daily update
[binutils.git] / Makefile.tpl
blob6ccb817f2ec92979e6f373f253d5af7d8a15ae19
1 [+ AutoGen5 template
2 in
3 +]
5 # Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'.
7 # Makefile for directory with subdirs to build.
8 #   Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
9 #   1999, 2000, 2001, 2002 Free Software Foundation
11 # This file is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2 of the License, or
14 # (at your option) any later version.
15
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 # GNU General Public License for more details.
20
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 # Tell GNU make 3.79 not to run the top level in parallel.  This 
27 # prevents contention for $builddir/$target/config.cache, as well
28 # as minimizing scatter in file system caches.
29 NOTPARALLEL = .NOTPARALLEL
30 $(NOTPARALLEL):
32 VPATH=@srcdir@
33 links=@configlinks@
35 build_alias=@build_alias@
36 build_cpu=@build_cpu@
37 build_vendor=@build_vendor@
38 build_os=@build_os@
39 build_canonical=@build_cpu@-@build_vendor@-@build_os@
40 host_alias=@host_alias@
41 host_cpu=@host_cpu@
42 host_vendor=@host_vendor@
43 host_os=@host_os@
44 host_canonical=@host_cpu@-@host_vendor@-@host_os@
45 target_alias=@target_alias@
46 target_cpu=@target_cpu@
47 target_vendor=@target_vendor@
48 target_os=@target_os@
49 target_canonical=@target_cpu@-@target_vendor@-@target_os@
51 enable_shared = @enable_shared@
52 enable_threads = @enable_threads@
53 enable_version_specific_runtime_libs = @enable_version_specific_runtime_libs@
54 # The file containing GCC's version number.
55 gcc_version_trigger = @gcc_version_trigger@
56 gcc_version = @gcc_version@
58 srcdir = @srcdir@
60 prefix = @prefix@
61 exec_prefix = @exec_prefix@
63 bindir = @bindir@
64 sbindir = @sbindir@
65 libexecdir = @libexecdir@
66 datadir = @datadir@
67 sysconfdir = @sysconfdir@
68 sharedstatedir = @sharedstatedir@
69 localstatedir = @localstatedir@
70 libdir = @libdir@
71 includedir = @includedir@
72 oldincludedir = @oldincludedir@
73 infodir = @infodir@
74 mandir = @mandir@
75 gxx_include_dir=@gxx_include_dir@
77 tooldir = @tooldir@
78 build_tooldir = @build_tooldir@
80 program_transform_name = @program_transform_name@
82 man1dir = $(mandir)/man1
83 man2dir = $(mandir)/man2
84 man3dir = $(mandir)/man3
85 man4dir = $(mandir)/man4
86 man5dir = $(mandir)/man5
87 man6dir = $(mandir)/man6
88 man7dir = $(mandir)/man7
89 man8dir = $(mandir)/man8
90 man9dir = $(mandir)/man9
91 # Directory in which the compiler finds executables, libraries, etc.
92 libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
93 GDB_NLM_DEPS = 
95 SHELL = @config_shell@
97 # pwd command to use.  Allow user to override default by setting PWDCMD in
98 # the environment to account for automounters.  The make variable must not
99 # be called PWDCMD, otherwise the value set here is passed to make
100 # subprocesses and overrides the setting from the user's environment.
101 PWD = $${PWDCMD-pwd}
103 # INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a
104 # cygwin host.
105 INSTALL_PROGRAM_ARGS =
107 INSTALL = $(SHELL) $$s/install-sh -c
108 INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS)
109 INSTALL_SCRIPT = $(INSTALL)
110 INSTALL_DATA = $(INSTALL) -m 644
112 AS = @AS@
113 AR = @AR@
114 AR_FLAGS = rc
115 CC = cc
117 # Special variables passed down in EXTRA_GCC_FLAGS.  They are defined
118 # here so that they can be overridden by Makefile fragments.
119 BUILD_CC = $(CC_FOR_BUILD)
120 BUILD_PREFIX = @BUILD_PREFIX@
121 BUILD_PREFIX_1 = @BUILD_PREFIX_1@
123 # These flag values are normally overridden by the configure script.
124 CFLAGS = -g
125 CXXFLAGS = -g -O2
127 LDFLAGS = 
128 LIBCFLAGS = $(CFLAGS)
129 CFLAGS_FOR_BUILD = $(CFLAGS)
130 # During gcc bootstrap, if we use some random cc for stage1 then
131 # CFLAGS will be just -g.  We want to ensure that TARGET libraries
132 # (which we know are built with gcc) are built with optimizations so
133 # prepend -O2 when setting CFLAGS_FOR_TARGET.
134 CFLAGS_FOR_TARGET = -O2 $(CFLAGS)
135 LDFLAGS_FOR_TARGET = 
136 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
137 PICFLAG = 
138 PICFLAG_FOR_TARGET = 
140 CXX = c++
142 # Use -O2 to stress test the compiler.
143 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
144 CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
145 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
147 DLLTOOL = @DLLTOOL@
148 WINDRES = @WINDRES@
150 NM = @NM@
152 LD = @LD@
154 # These values are substituted by configure.
155 DEFAULT_YACC = @DEFAULT_YACC@
156 DEFAULT_LEX = @DEFAULT_LEX@
157 DEFAULT_M4 = @DEFAULT_M4@
159 BISON=@BISON@
160 USUAL_BISON = `if [ -f $$r/bison/bison ] ; then \
161             echo $$r/bison/bison -L $$s/bison/ ; \
162          else \
163             echo bison ; \
164          fi`
166 YACC=@YACC@
167 USUAL_YACC = `if [ -f $$r/bison/bison ] ; then \
168             echo $$r/bison/bison -y -L $$s/bison/ ; \
169         elif [ -f $$r/byacc/byacc ] ; then \
170             echo $$r/byacc/byacc ; \
171         else \
172             echo ${DEFAULT_YACC} ; \
173         fi`
175 LEX=@LEX@
176 USUAL_LEX = `if [ -f $$r/flex/flex ] ; \
177         then echo $$r/flex/flex ; \
178         else echo ${DEFAULT_LEX} ; fi`
180 M4 = `if [ -f $$r/m4/m4 ] ; \
181         then echo $$r/m4/m4 ; \
182         else echo ${DEFAULT_M4} ; fi`
184 # For an installed makeinfo, we require it to be from texinfo 4 or
185 # higher, else we use the "missing" dummy.
186 MAKEINFO=@MAKEINFO@
187 USUAL_MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
188         then echo $$r/texinfo/makeinfo/makeinfo ; \
189         else if (makeinfo --version \
190           | egrep 'texinfo[^0-9]*([1-3][0-9]|[4-9])') >/dev/null 2>&1; \
191         then echo makeinfo; else echo $$s/missing makeinfo; fi; fi`
193 # This just becomes part of the MAKEINFO definition passed down to
194 # sub-makes.  It lets flags be given on the command line while still
195 # using the makeinfo from the object tree.
196 MAKEINFOFLAGS =
198 EXPECT = `if [ -f $$r/expect/expect ] ; \
199         then echo $$r/expect/expect ; \
200         else echo expect ; fi`
202 RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \
203         then echo $$s/dejagnu/runtest ; \
204         else echo runtest ; fi`
207 # compilers to use to create programs which must be run in the build
208 # environment.
209 CC_FOR_BUILD = @CC_FOR_BUILD@
210 CXX_FOR_BUILD = $(CXX)
212 SUBDIRS = @configdirs@
214 # This is set by the configure script to the list of directories which
215 # should be built using the target tools.
216 TARGET_CONFIGDIRS = @target_configdirs@
218 # Target libraries are put under this directory:
219 # Changed by configure to $(target_alias) if cross.
220 TARGET_SUBDIR = @target_subdir@
222 BUILD_CONFIGDIRS = libiberty
223 BUILD_SUBDIR = @build_subdir@
225 # This is set by the configure script to the arguments to use when configuring
226 # directories built for the target.
227 TARGET_CONFIGARGS = @target_configargs@
229 # This is set by the configure script to the arguments to use when configuring
230 # directories built for the build system.
231 BUILD_CONFIGARGS = @build_configargs@
233 # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
234 # was used.
235 SET_LIB_PATH = @SET_LIB_PATH@
237 # This is the name of the environment variable used for the path to
238 # the libraries.  This may be changed by configure.in.
239 RPATH_ENVVAR = @RPATH_ENVVAR@
241 # This is the list of directories that may be needed in RPATH_ENVVAR
242 # so that programs built for the host machine work.
243 HOST_LIB_PATH = $$r/bfd:$$r/opcodes
245 # This is the list of directories that may be needed in RPATH_ENVVAR
246 # so that prorgams built for the target machine work.
247 TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:
249 # configure.in sets SET_LIB_PATH to this if --enable-shared was used.
250 # Some platforms don't like blank entries, so we remove duplicate,
251 # leading and trailing colons.
252 REALLY_SET_LIB_PATH = \
253   $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
255 # Should be substed by configure.in
256 FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
257 CC_FOR_TARGET = @CC_FOR_TARGET@
258 CXX_FOR_TARGET = @CXX_FOR_TARGET@
259 CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
260 GCJ_FOR_TARGET = @GCJ_FOR_TARGET@
262 # If GCC_FOR_TARGET is not overriden on the command line, then this
263 # variable is passed down to the gcc Makefile, where it is used to
264 # build libgcc2.a.  We define it here so that it can itself be
265 # overridden on the command line.
266 GCC_FOR_TARGET=@GCC_FOR_TARGET@
267 USUAL_GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET)
269 AS_FOR_TARGET=@AS_FOR_TARGET@
270 USUAL_AS_FOR_TARGET = ` \
271   if [ -f $$r/gas/as-new ] ; then \
272     echo $$r/gas/as-new ; \
273   elif [ -f $$r/gcc/xgcc ]; then \
274     $(CC_FOR_TARGET) -print-prog-name=as ; \
275   else \
276     if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
277       echo $(AS); \
278     else \
279        t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \
280     fi; \
281   fi`
283 LD_FOR_TARGET=@LD_FOR_TARGET@
284 USUAL_LD_FOR_TARGET = ` \
285   if [ -f $$r/ld/ld-new ] ; then \
286     echo $$r/ld/ld-new ; \
287   elif [ -f $$r/gcc/xgcc ]; then \
288     $(CC_FOR_TARGET) -print-prog-name=ld ; \
289   else \
290     if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
291       echo $(LD); \
292     else \
293        t='$(program_transform_name)'; echo ld | sed -e 's/x/x/' $$t ; \
294     fi; \
295   fi`
297 DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
298 USUAL_DLLTOOL_FOR_TARGET = ` \
299   if [ -f $$r/binutils/dlltool ] ; then \
300     echo $$r/binutils/dlltool ; \
301   else \
302     if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
303       echo $(DLLTOOL); \
304     else \
305        t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \
306     fi; \
307   fi`
309 WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@
310 USUAL_WINDRES_FOR_TARGET = ` \
311   if [ -f $$r/binutils/windres ] ; then \
312     echo $$r/binutils/windres ; \
313   else \
314     if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
315       echo $(WINDRES); \
316     else \
317        t='$(program_transform_name)'; echo windres | sed -e 's/x/x/' $$t ; \
318     fi; \
319   fi`
321 AR_FOR_TARGET=@AR_FOR_TARGET@
322 USUAL_AR_FOR_TARGET = ` \
323   if [ -f $$r/binutils/ar ] ; then \
324     echo $$r/binutils/ar ; \
325   else \
326     if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
327       echo $(AR); \
328     else \
329        t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
330     fi; \
331   fi`
333 RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@
334 USUAL_RANLIB_FOR_TARGET = ` \
335   if [ -f $$r/binutils/ranlib ] ; then \
336     echo $$r/binutils/ranlib ; \
337   else \
338     if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
339       if [ x'$(RANLIB)' != x ]; then \
340          echo $(RANLIB); \
341       else \
342          echo ranlib; \
343       fi; \
344     else \
345        t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
346     fi; \
347   fi`
349 NM_FOR_TARGET=@NM_FOR_TARGET@
350 USUAL_NM_FOR_TARGET = ` \
351   if [ -f $$r/binutils/nm-new ] ; then \
352     echo $$r/binutils/nm-new ; \
353   elif [ -f $$r/gcc/xgcc ]; then \
354     $(CC_FOR_TARGET) -print-prog-name=nm ; \
355   else \
356     if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
357       echo $(NM); \
358     else \
359        t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
360     fi; \
361   fi`
363 # The first rule in the file had better be this one.  Don't put any above it.
364 # This lives here to allow makefile fragments to contain dependencies.
365 all: all.normal
366 .PHONY: all
368 #### host and target specific makefile fragments come in here.
371 # Flags to pass down to all sub-makes.
372 # Please keep these in alphabetical order.
373 BASE_FLAGS_TO_PASS = \
374         "AR_FLAGS=$(AR_FLAGS)" \
375         "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
376         "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
377         "BISON=$(BISON)" \
378         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
379         "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
380         "CFLAGS=$(CFLAGS)" \
381         "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
382         "GCJ_FOR_TARGET=$(GCJ_FOR_TARGET)" \
383         "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
384         "CXXFLAGS=$(CXXFLAGS)" \
385         "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
386         "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
387         "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
388         "INSTALL=$(INSTALL)" \
389         "INSTALL_DATA=$(INSTALL_DATA)" \
390         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
391         "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
392         "LDFLAGS=$(LDFLAGS)" \
393         "LEX=$(LEX)" \
394         "LD_FOR_TARGET=$(LD_FOR_TARGET)" \
395         "LIBCFLAGS=$(LIBCFLAGS)" \
396         "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
397         "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
398         "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
399         "M4=$(M4)" \
400         "MAKE=$(MAKE)" \
401         "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
402         "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
403         "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
404         "RPATH_ENVVAR=$(RPATH_ENVVAR)" \
405         "SHELL=$(SHELL)" \
406         "EXPECT=$(EXPECT)" \
407         "RUNTEST=$(RUNTEST)" \
408         "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
409         "TARGET_SUBDIR=$(TARGET_SUBDIR)" \
410         "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \
411         "YACC=$(YACC)" \
412         "bindir=$(bindir)" \
413         "datadir=$(datadir)" \
414         "exec_prefix=$(exec_prefix)" \
415         "includedir=$(includedir)" \
416         "infodir=$(infodir)" \
417         "libdir=$(libdir)" \
418         "libexecdir=$(libexecdir)" \
419         "lispdir=$(lispdir)" \
420         "libstdcxx_incdir=$(libstdcxx_incdir)" \
421         "libsubdir=$(libsubdir)" \
422         "localstatedir=$(localstatedir)" \
423         "mandir=$(mandir)" \
424         "oldincludedir=$(oldincludedir)" \
425         "prefix=$(prefix)" \
426         "sbindir=$(sbindir)" \
427         "sharedstatedir=$(sharedstatedir)" \
428         "sysconfdir=$(sysconfdir)" \
429         "tooldir=$(tooldir)" \
430         "build_tooldir=$(build_tooldir)" \
431         "gxx_include_dir=$(gxx_include_dir)" \
432         "gcc_version=$(gcc_version)" \
433         "gcc_version_trigger=$(gcc_version_trigger)" \
434         "target_alias=$(target_alias)" 
436 # For any flags above that may contain shell code that varies from one
437 # target library to another.  When doing recursive invocations of the
438 # top-level Makefile, we don't want the outer make to evaluate them,
439 # so we pass these variables down unchanged.  They must not contain
440 # single nor double quotes.
441 RECURSE_FLAGS = \
442         CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)'
444 # Flags to pass down to most sub-makes, in which we're building with
445 # the host environment.
446 # If any variables are added here, they must be added to do-*, below.
447 EXTRA_HOST_FLAGS = \
448         'AR=$(AR)' \
449         'AS=$(AS)' \
450         'CC=$(CC)' \
451         'CXX=$(CXX)' \
452         'DLLTOOL=$(DLLTOOL)' \
453         'LD=$(LD)' \
454         'NM=$(NM)' \
455         "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \
456         'WINDRES=$(WINDRES)'
458 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
460 # Flags that are concerned with the location of the X11 include files
461 # and library files
463 # NOTE: until the top-level is getting the values via autoconf, it only
464 # causes problems to have this top-level Makefile overriding the autoconf-set
465 # values in child directories.  Only variables that don't conflict with
466 # autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
468 X11_FLAGS_TO_PASS = \
469         'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
470         'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
472 # Flags to pass down to makes which are built with the target environment.
473 # The double $ decreases the length of the command line; the variables
474 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
475 # If any variables are added here, they must be added to do-*, below.
476 EXTRA_TARGET_FLAGS = \
477         'AR=$$(AR_FOR_TARGET)' \
478         'AS=$$(AS_FOR_TARGET)' \
479         'CC=$$(CC_FOR_TARGET)' \
480         'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
481         'CXX=$$(CXX_FOR_TARGET)' \
482         'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
483         'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
484         'LD=$$(LD_FOR_TARGET)' \
485         'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
486         'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
487         'NM=$$(NM_FOR_TARGET)' \
488         'RANLIB=$$(RANLIB_FOR_TARGET)' \
489         'WINDRES=$$(WINDRES_FOR_TARGET)'
491 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
493 # Flags to pass down to gcc.  gcc builds a library, libgcc.a, so it
494 # unfortunately needs the native compiler and the target ar and
495 # ranlib.
496 # If any variables are added here, they must be added to do-*, below.
497 # The HOST_* variables are a special case, which are used for the gcc
498 # cross-building scheme.
499 EXTRA_GCC_FLAGS = \
500         'AR=$(AR)' \
501         'AS=$(AS)' \
502         'CC=$(CC)' \
503         'CXX=$(CXX)' \
504         'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
505         'BUILD_CC=$(CC_FOR_BUILD)' \
506         'BUILD_PREFIX=$(BUILD_PREFIX)' \
507         'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \
508         'NM=$(NM)' \
509         "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \
510         'WINDRES=$$(WINDRES_FOR_TARGET)' \
511         "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
512         "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
513         "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s/.*=$$/XFOO=/`" \
514         "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s/.*=$$/XFOO=/`" \
515         "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s/.*=$$/XFOO=/`" \
516         "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
517         "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
518         "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \
519         "`echo 'ENQUIRE=$(ENQUIRE)' | sed -e s/.*=$$/XFOO=/`" \
520         "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
521         "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`"
523 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
525 # This is a list of the targets for all of the modules which are compiled
526 # using the build machine's native compiler.  Configure edits the second
527 # macro for build!=host builds.
528 ALL_BUILD_MODULES_LIST = \
529         all-build-libiberty
530 ALL_BUILD_MODULES = @all_build_modules@
532 # This is a list of the configure targets for all of the modules which
533 # are compiled using the native tools.
534 CONFIGURE_BUILD_MODULES = \
535         configure-build-libiberty
537 # This is a list of the configure targets for all of the modules which
538 # are compiled using the target tools.
539 CONFIGURE_TARGET_MODULES = [+ FOR target_modules +]\
540         configure-target-[+module+] [+ ENDFOR target_modules +]
542 configure-target: $(CONFIGURE_TARGET_MODULES)
544 # This is a list of the targets for which we can do a clean-{target}.
545 CLEAN_MODULES = [+ FOR host_modules +][+ IF no_clean +][+ ELIF with_x +][+ ELSE clean +]\
546         clean-[+module+] [+ ENDIF no_clean +][+ ENDFOR host_modules +]
548 # All of the target modules that can be cleaned
549 CLEAN_TARGET_MODULES = [+ FOR target_modules +][+ IF no_clean +][+ ELSE clean +]\
550         clean-target-[+module+] [+ ENDIF no_clean +][+ ENDFOR target_modules +]
552 # All of the x11 modules that can be cleaned
553 CLEAN_X11_MODULES = [+ FOR host_modules +][+ IF with_x +]\
554         clean-[+module+] [+ ENDIF with_x +][+ ENDFOR host_modules +]
556 # The target built for a native build.
557 # This list only includes modules actually being configured and built.
558 .PHONY: all.normal
559 all.normal: @all_build_modules@ \
560         @all_host_modules@ \
561         @all_target_modules@
563 all-target: @all_target_modules@
565 # Do a target for all the subdirectories.  A ``make do-X'' will do a
566 # ``make X'' in all subdirectories (because, in general, there is a
567 # dependency (below) of X upon do-X, a ``make X'' will also do this,
568 # but it may do additional work as well).
569 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
570 # because it is so large that it can easily overflow the command line
571 # length limit on some systems.
572 [+ FOR recursive_targets +]
573 .PHONY: do-[+target+]
574 do-[+target+]:
575         @r=`${PWD}`; export r; \
576         s=`cd $(srcdir); ${PWD}`; export s; \
577         $(SET_LIB_PATH) \
578         for i in $(SUBDIRS) -dummy-; do \
579           if [ -f ./$$i/Makefile ]; then \
580             case $$i in \
581             gcc) \
582               for flag in $(EXTRA_GCC_FLAGS); do \
583                 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
584               done; \
585               ;; \
586             *) \
587               for flag in $(EXTRA_HOST_FLAGS); do \
588                 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
589               done; \
590               ;; \
591             esac ; \
592             if (cd ./$$i; \
593                 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
594                         "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
595                         "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
596                         "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
597                         [+target+]); \
598             then true; else exit 1; fi; \
599           else true; fi; \
600         done
601         # Break into two pieces
602         r=`${PWD}`; export r; \
603         s=`cd $(srcdir); ${PWD}`; export s; \
604         $(SET_LIB_PATH) \
605         for i in $(TARGET_CONFIGDIRS) -dummy-; do \
606           if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \
607             for flag in $(EXTRA_TARGET_FLAGS); do \
608                 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
609             done; \
610             if (cd $(TARGET_SUBDIR)/$$i; \
611                 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
612                         "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
613                         "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
614                         "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
615                         [+target+]); \
616             then true; else exit 1; fi; \
617           else true; fi; \
618         done
619 [+ ENDFOR recursive_targets +]
622 # Here are the targets which correspond to the do-X targets.
624 .PHONY: info installcheck dvi install-info
625 .PHONY: clean distclean mostlyclean maintainer-clean realclean
626 .PHONY: local-clean local-distclean local-maintainer-clean
627 info: do-info
628 installcheck: do-installcheck
629 dvi: do-dvi
631 # Make sure makeinfo is built before we do a `make info'.
632 do-info: all-texinfo
634 install-info: do-install-info dir.info
635         s=`cd $(srcdir); ${PWD}`; export s; \
636         if [ -f dir.info ] ; then \
637           $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
638         else true ; fi
640 local-clean:
641         -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
643 local-distclean:
644         -rm -f Makefile config.status config.cache mh-frag mt-frag
645         -if [ "$(TARGET_SUBDIR)" != "." ]; then \
646           rm -rf $(TARGET_SUBDIR); \
647         else true; fi
648         -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile
649         -rm -f texinfo/doc/Makefile texinfo/po/POTFILES
650         -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null
651         -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null
652         -rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null
654 local-maintainer-clean:
655         @echo "This command is intended for maintainers to use;"
656         @echo "it deletes files that may require special tools to rebuild."
658 clean: do-clean local-clean
659 mostlyclean: do-mostlyclean local-clean
660 distclean: do-distclean local-clean local-distclean
661 maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean 
662 maintainer-clean: local-distclean
663 realclean: maintainer-clean
665 # This rule is used to clean specific modules.
666 .PHONY: $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc
667 $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc:
668         @dir=`echo $@ | sed -e 's/clean-//'`; \
669         if [ -f ./$${dir}/Makefile ] ; then \
670           r=`${PWD}`; export r; \
671           s=`cd $(srcdir); ${PWD}`; export s; \
672           $(SET_LIB_PATH) \
673           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) clean); \
674         else \
675           true; \
676         fi
678 .PHONY: $(CLEAN_TARGET_MODULES)
679 $(CLEAN_TARGET_MODULES):
680         @dir=`echo $@ | sed -e 's/clean-target-//'`; \
681         rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
682         if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
683           r=`${PWD}`; export r; \
684           s=`cd $(srcdir); ${PWD}`; export s; \
685           $(SET_LIB_PATH) \
686           (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \
687         else \
688           true; \
689         fi
691 clean-target: $(CLEAN_TARGET_MODULES) clean-target-libgcc
692 clean-target-libgcc:
693         test ! -d gcc/libgcc || \
694         (cd gcc/libgcc && find . -type d -print) | \
695         while read d; do rm -f gcc/$$d/libgcc.a || : ; done
696         -rm -rf gcc/libgcc
698 # Check target.
700 .PHONY: check do-check
701 check:
702         $(MAKE) do-check NOTPARALLEL=parallel-ok
704 # Only include modules actually being configured and built.
705 do-check: @check_host_modules@ \
706         @check_target_modules@
708 # Automated reporting of test results.
710 warning.log: build.log
711         $(srcdir)/contrib/warn_summary build.log > $@
713 mail-report.log:
714         if test x'$(BOOT_CFLAGS)' != x''; then \
715             BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
716         fi; \
717         $(srcdir)/contrib/test_summary -t >$@
718         chmod +x $@
719         echo If you really want to send e-mail, run ./$@ now
721 mail-report-with-warnings.log: warning.log
722         if test x'$(BOOT_CFLAGS)' != x''; then \
723             BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
724         fi; \
725         $(srcdir)/contrib/test_summary -t -i warning.log >$@
726         chmod +x $@
727         echo If you really want to send e-mail, run ./$@ now
729 # Installation targets.
731 .PHONY: install uninstall source-vault binary-vault vault-install
732 install: installdirs @install_host_modules@ @install_target_modules@
734 install-target: @install_target_modules@
736 uninstall:
737         @echo "the uninstall target is not supported in this tree"
739 source-vault:
740         $(MAKE) -f ./release/Build-A-Release \
741                 host=$(host_alias) source-vault
743 binary-vault:
744         $(MAKE) -f ./release/Build-A-Release \
745                 host=$(host_alias) target=$(target_alias)
747 vault-install:
748         @if [ -f ./release/vault-install ] ; then \
749           ./release/vault-install $(host_alias) $(target_alias) ; \
750         else \
751           true ; \
752         fi
754 .PHONY: install.all
755 install.all: install-no-fixedincludes
756         @if [ -f ./gcc/Makefile ] ; then \
757                 r=`${PWD}` ; export r ; \
758                 $(SET_LIB_PATH) \
759                 (cd ./gcc; \
760                 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
761         else \
762                 true ; \
763         fi
765 # install-no-fixedincludes is used because Cygnus can not distribute
766 # the fixed header files.
767 .PHONY: install-no-fixedincludes
768 install-no-fixedincludes: installdirs @install_host_modules_nogcc@ \
769         @install_target_modules@ gcc-no-fixedincludes
771 # Install the gcc headers files, but not the fixed include files,
772 # which Cygnus is not allowed to distribute.  This rule is very
773 # dependent on the workings of the gcc Makefile.in.
774 .PHONY: gcc-no-fixedincludes
775 gcc-no-fixedincludes:
776         @if [ -f ./gcc/Makefile ]; then \
777           rm -rf gcc/tmp-include; \
778           mv gcc/include gcc/tmp-include 2>/dev/null; \
779           mkdir gcc/include; \
780           cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
781           touch gcc/stmp-fixinc gcc/include/fixed; \
782           rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
783           r=`${PWD}`; export r; \
784           s=`cd $(srcdir); ${PWD}` ; export s; \
785           $(SET_LIB_PATH) \
786           (cd ./gcc; \
787            $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
788           rm -rf gcc/include; \
789           mv gcc/tmp-include gcc/include 2>/dev/null; \
790         else true; fi
792 # These rules are used to build the modules which are built with the
793 # build machine's native compiler.
794 [+ FOR build_modules +]
795 .PHONY: all-build-[+module+]
796 all-build-[+module+]:
797         @if [ -f ./[+module+]/Makefile ] ; then \
798           r=`${PWD}`; export r; \
799           s=`cd $(srcdir); ${PWD}`; export s; \
800           (cd $(BUILD_SUBDIR)/[+module+] && $(MAKE) all); \
801         else \
802           true; \
803         fi
805 .PHONY: configure-build-[+module+]
806 configure-build-[+module+]:
807         @if [ ! -d $(BUILD_SUBDIR) ]; then \
808           true; \
809         elif [ -f $(BUILD_SUBDIR)/[+module+]/Makefile ] ; then \
810           true; \
811         elif echo " $(BUILD_CONFIGDIRS) " | grep " [+module+] " >/dev/null 2>&1; then \
812           if [ -d $(srcdir)/[+module+] ]; then \
813             [ -d $(BUILD_SUBDIR)/[+module+] ] || mkdir $(BUILD_SUBDIR)/[+module+];\
814             r=`${PWD}`; export r; \
815             s=`cd $(srcdir); ${PWD}`; export s; \
816             AR="$(AR_FOR_BUILD)"; export AR; \
817             AS="$(AS_FOR_BUILD)"; export AS; \
818             CC="$(CC_FOR_BUILD)"; export CC; \
819             CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
820             CXX="$(CXX_FOR_BUILD)"; export CXX; \
821             CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
822             GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
823             DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
824             LD="$(LD_FOR_BUILD)"; export LD; \
825             LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
826             NM="$(NM_FOR_BUILD)"; export NM; \
827             RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
828             WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
829             echo Configuring in $(BUILD_SUBDIR)/[+module+]; \
830             cd "$(BUILD_SUBDIR)/[+module+]" || exit 1; \
831             case $(srcdir) in \
832             /* | [A-Za-z]:[\\/]*) \
833               topdir=$(srcdir) ;; \
834             *) \
835               case "$(BUILD_SUBDIR)" in \
836               .) topdir="../$(srcdir)" ;; \
837               *) topdir="../../$(srcdir)" ;; \
838               esac ;; \
839             esac; \
840             if [ "$(srcdir)" = "." ] ; then \
841               if [ "$(BUILD_SUBDIR)" != "." ] ; then \
842                 if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \
843                   if [ -f Makefile ]; then \
844                     if $(MAKE) distclean; then \
845                       true; \
846                     else \
847                       exit 1; \
848                     fi; \
849                   else \
850                     true; \
851                   fi; \
852                 else \
853                   exit 1; \
854                 fi; \
855               else \
856                 true; \
857               fi; \
858               srcdiroption="--srcdir=."; \
859               libsrcdir="."; \
860             else \
861               srcdiroption="--srcdir=$${topdir}/[+module+]"; \
862               libsrcdir="$$s/[+module+]"; \
863             fi; \
864             if [ -f $${libsrcdir}/configure ] ; then \
865               rm -f no-such-file skip-this-dir; \
866               CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
867                 $(BUILD_CONFIGARGS) $${srcdiroption} \
868                 --with-build-subdir="$(BUILD_SUBDIR)"; \
869             else \
870               rm -f no-such-file skip-this-dir; \
871               CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
872                 $(BUILD_CONFIGARGS) $${srcdiroption} \
873                 --with-build-subdir="$(BUILD_SUBDIR)"; \
874             fi || exit 1; \
875             if [ -f skip-this-dir ] ; then \
876               sh skip-this-dir; \
877               rm -f skip-this-dir; \
878               cd ..; rmdir [+module+] || true; \
879             else \
880               true; \
881             fi; \
882           else \
883             true; \
884           fi; \
885         else \
886           true; \
887         fi
888 [+ ENDFOR build_modules +]
890 # These rules are used to build the modules which use FLAGS_TO_PASS.  To
891 # build a target all-X means to cd to X and make all.
892 [+ FOR host_modules +]
893 .PHONY: all-[+module+]
894 all-[+module+]:
895         @dir=[+module+]; \
896         if [ -f ./[+module+]/Makefile ] ; then \
897           r=`${PWD}`; export r; \
898           s=`cd $(srcdir); ${PWD}`; export s; \
899           $(SET_LIB_PATH) \
900           (cd [+module+]; $(MAKE) $(FLAGS_TO_PASS)[+ 
901             IF with_x 
902               +] $(X11_FLAGS_TO_PASS)[+ 
903             ENDIF with_x +] all); \
904         else \
905           true; \
906         fi
908 [+ IF no_check +]
909 .PHONY: check-[+module+]
910 check-[+module+]:
911 [+ ELIF no_check_cross +]
912 .PHONY: check-[+module+]
913 # This module is only tested in a native toolchain.
914 check-[+module+]:
915         @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
916           dir=[+module+]; \
917           if [ -f ./[+module+]/Makefile ] ; then \
918             r=`${PWD}`; export r; \
919             s=`cd $(srcdir); ${PWD}`; export s; \
920             $(SET_LIB_PATH) \
921             (cd [+module+]; $(MAKE) $(FLAGS_TO_PASS)[+ 
922               IF with_x 
923                 +] $(X11_FLAGS_TO_PASS)[+ 
924               ENDIF with_x +] check); \
925           else \
926             true; \
927           fi; \
928         fi
929 [+ ELSE check +]
930 .PHONY: check-[+module+]
931 check-[+module+]:
932         @dir=[+module+]; \
933         if [ -f ./[+module+]/Makefile ] ; then \
934           r=`${PWD}`; export r; \
935           s=`cd $(srcdir); ${PWD}`; export s; \
936           $(SET_LIB_PATH) \
937           (cd [+module+]; $(MAKE) $(FLAGS_TO_PASS)[+ 
938             IF with_x 
939               +] $(X11_FLAGS_TO_PASS)[+ 
940             ENDIF with_x +] check); \
941         else \
942           true; \
943         fi
944 [+ ENDIF no_check +]
946 [+ IF no_install +]
947 .PHONY: install-[+module+]
948 install-[+module+]:
949 [+ ELSE install +]
950 .PHONY: install-[+module+]
951 install-[+module+]: installdirs
952         @dir=[+module+]; \
953         if [ -f ./[+module+]/Makefile ] ; then \
954           r=`${PWD}`; export r; \
955           s=`cd $(srcdir); ${PWD}`; export s; \
956           $(SET_LIB_PATH) \
957           (cd [+module+]; $(MAKE) $(FLAGS_TO_PASS)[+ 
958             IF with_x 
959               +] $(X11_FLAGS_TO_PASS)[+ 
960             ENDIF with_x +] install); \
961         else \
962           true; \
963         fi
964 [+ ENDIF no_install +]
965 [+ ENDFOR host_modules +]
967 # These rules are used to build the modules which are built with the target
968 # tools.  To make foo-X means to cd to X and make foo.
969 [+ FOR target_modules +]
970 .PHONY: configure-target-[+module+]
971 configure-target-[+module+]:
972         @if [ -d $(TARGET_SUBDIR)/[+module+] ]; then \
973           r=`${PWD}`; export r; \
974           $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/[+module+]/tmpmulti.out 2> /dev/null; \
975           if [ -s $(TARGET_SUBDIR)/[+module+]/tmpmulti.out ]; then \
976             if [ -f $(TARGET_SUBDIR)/[+module+]/multilib.out ]; then \
977               if cmp $(TARGET_SUBDIR)/[+module+]/multilib.out $(TARGET_SUBDIR)/[+module+]/tmpmulti.out > /dev/null; then \
978                 rm -f $(TARGET_SUBDIR)/[+module+]/tmpmulti.out; \
979               else \
980                 echo "Multilibs changed for [+module+], reconfiguring"; \
981                 rm -f $(TARGET_SUBDIR)/[+module+]/multilib.out $(TARGET_SUBDIR)/[+module+]/Makefile; \
982                 mv $(TARGET_SUBDIR)/[+module+]/tmpmulti.out $(TARGET_SUBDIR)/[+module+]/multilib.out; \
983               fi; \
984             else \
985               mv $(TARGET_SUBDIR)/[+module+]/tmpmulti.out $(TARGET_SUBDIR)/[+module+]/multilib.out; \
986             fi; \
987           fi; \
988         fi; exit 0      # break command into two pieces
989         @dir=[+module+] ; \
990         if [ ! -d $(TARGET_SUBDIR) ]; then \
991           true; \
992         elif [ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] ; then \
993           true; \
994         elif echo " $(TARGET_CONFIGDIRS) " | grep " [+module+] " >/dev/null 2>&1; then \
995           if [ -d $(srcdir)/[+module+] ]; then \
996             [ -d $(TARGET_SUBDIR)/[+module+] ] || mkdir $(TARGET_SUBDIR)/[+module+];\
997             r=`${PWD}`; export r; \
998             s=`cd $(srcdir); ${PWD}`; export s; \
999             $(SET_LIB_PATH) \
1000             AR="$(AR_FOR_TARGET)"; export AR; \
1001             AS="$(AS_FOR_TARGET)"; export AS; \
1002             CC="$(CC_FOR_TARGET)"; export CC; \
1003             CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
1004             CXX="$(CXX_FOR_TARGET)"; export CXX; \
1005             CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
1006             GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
1007             DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
1008             LD="$(LD_FOR_TARGET)"; export LD; \
1009             LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
1010             NM="$(NM_FOR_TARGET)"; export NM; \
1011             RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
1012             WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
1013             echo Configuring in $(TARGET_SUBDIR)/[+module+]; \
1014             cd "$(TARGET_SUBDIR)/[+module+]" || exit 1; \
1015             case $(srcdir) in \
1016             /* | [A-Za-z]:[\\/]*) \
1017               topdir=$(srcdir) ;; \
1018             *) \
1019               case "$(TARGET_SUBDIR)" in \
1020               .) topdir="../$(srcdir)" ;; \
1021               *) topdir="../../$(srcdir)" ;; \
1022               esac ;; \
1023             esac; \
1024             if [ "$(srcdir)" = "." ] ; then \
1025               if [ "$(TARGET_SUBDIR)" != "." ] ; then \
1026                 if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \
1027                   if [ -f Makefile ]; then \
1028                     if $(MAKE) distclean; then \
1029                       true; \
1030                     else \
1031                       exit 1; \
1032                     fi; \
1033                   else \
1034                     true; \
1035                   fi; \
1036                 else \
1037                   exit 1; \
1038                 fi; \
1039               else \
1040                 true; \
1041               fi; \
1042               srcdiroption="--srcdir=."; \
1043               libsrcdir="."; \
1044             else \
1045               srcdiroption="--srcdir=$${topdir}/[+module+]"; \
1046               libsrcdir="$$s/[+module+]"; \
1047             fi; \
1048             if [ -f $${libsrcdir}/configure ] ; then \
1049               rm -f no-such-file skip-this-dir; \
1050               CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
1051                 $(TARGET_CONFIGARGS) $${srcdiroption} \
1052                 --with-target-subdir="$(TARGET_SUBDIR)"; \
1053             else \
1054               rm -f no-such-file skip-this-dir; \
1055               CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
1056                 $(TARGET_CONFIGARGS) $${srcdiroption} \
1057                 --with-target-subdir="$(TARGET_SUBDIR)"; \
1058             fi || exit 1; \
1059             if [ -f skip-this-dir ] ; then \
1060               sh skip-this-dir; \
1061               rm -f skip-this-dir; \
1062               cd ..; rmdir [+module+] || true; \
1063             else \
1064               true; \
1065             fi; \
1066           else \
1067             true; \
1068           fi; \
1069         else \
1070           true; \
1071         fi
1073 .PHONY: all-target-[+module+]
1074 all-target-[+module+]:
1075         @dir=[+module+] ; \
1076         if [ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] ; then \
1077           r=`${PWD}`; export r; \
1078           s=`cd $(srcdir); ${PWD}`; export s; \
1079           $(SET_LIB_PATH) \
1080           (cd $(TARGET_SUBDIR)/[+module+]; \
1081             $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
1082         else \
1083           true; \
1084         fi
1085 [+ IF no_check +]
1086 # Dummy target for uncheckable module.
1087 .PHONY: check-target-[+module+]
1088 check-target-[+module+]:
1089 [+ ELSE check +]
1090 .PHONY: check-target-[+module+]
1091 check-target-[+module+]:
1092         @dir=[+module+] ; \
1093         if [ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] ; then \
1094           r=`${PWD}`; export r; \
1095           s=`cd $(srcdir); ${PWD}`; export s; \
1096           $(SET_LIB_PATH) \
1097           (cd $(TARGET_SUBDIR)/[+module+]; \
1098             $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
1099         else \
1100           true; \
1101         fi
1102 [+ ENDIF no_check +]
1103 [+ IF no_install +][+ ELSE install +]\
1104 .PHONY: install-target-[+module+]
1105 install-target-[+module+]: installdirs
1106         @dir=[+module+] ; \
1107         if [ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] ; then \
1108           r=`${PWD}`; export r; \
1109           s=`cd $(srcdir); ${PWD}`; export s; \
1110           $(SET_LIB_PATH) \
1111           (cd $(TARGET_SUBDIR)/[+module+]; \
1112             $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
1113         else \
1114           true; \
1115         fi
1116 [+ ENDIF no_install +]
1117 [+ ENDFOR target_modules +]
1119 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
1120 .PHONY: all-gcc
1121 all-gcc:
1122         @if [ -f ./gcc/Makefile ] ; then \
1123           r=`${PWD}`; export r; \
1124           s=`cd $(srcdir); ${PWD}`; export s; \
1125           $(SET_LIB_PATH) \
1126           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
1127         else \
1128           true; \
1129         fi
1131 # Building GCC uses some tools for rebuilding "source" files
1132 # like texinfo, bison/byacc, etc.  So we must depend on those.
1134 # While building GCC, it may be necessary to run various target
1135 # programs like the assembler, linker, etc.  So we depend on
1136 # those too.
1138 # In theory, on an SMP all those dependencies can be resolved
1139 # in parallel.
1141 .PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap
1142 bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap: all-bootstrap
1143         @r=`${PWD}`; export r; \
1144         s=`cd $(srcdir); ${PWD}`; export s; \
1145         $(SET_LIB_PATH) \
1146         echo "Bootstrapping the compiler"; \
1147         cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@
1148         @r=`${PWD}`; export r; \
1149         s=`cd $(srcdir); ${PWD}`; export s; \
1150         case "$@" in \
1151           *bootstrap4-lean ) \
1152                         msg="Comparing stage3 and stage4 of the compiler"; \
1153                         compare=compare3-lean ;; \
1154           *bootstrap4 ) msg="Comparing stage3 and stage4 of the compiler"; \
1155                         compare=compare3 ;; \
1156           *-lean )      msg="Comparing stage2 and stage3 of the compiler"; \
1157                         compare=compare-lean ;; \
1158           * )           msg="Comparing stage2 and stage3 of the compiler"; \
1159                         compare=compare ;; \
1160         esac; \
1161         $(SET_LIB_PATH) \
1162         echo "$$msg"; \
1163         cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
1164         @r=`${PWD}`; export r; \
1165         s=`cd $(srcdir); ${PWD}` ; export s; \
1166         $(SET_LIB_PATH) \
1167         echo "Building runtime libraries"; \
1168         $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
1170 .PHONY: cross
1171 cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
1172         @r=`${PWD}`; export r; \
1173         s=`cd $(srcdir); ${PWD}`; export s; \
1174         $(SET_LIB_PATH) \
1175         echo "Building the C and C++ compiler"; \
1176         cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
1177         @r=`${PWD}`; export r; \
1178         s=`cd $(srcdir); ${PWD}` ; export s; \
1179         $(SET_LIB_PATH) \
1180         echo "Building runtime libraries"; \
1181         $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \
1182           LANGUAGES="c c++" all
1184 .PHONY: check-gcc
1185 check-gcc:
1186         @if [ -f ./gcc/Makefile ] ; then \
1187           r=`${PWD}`; export r; \
1188           s=`cd $(srcdir); ${PWD}`; export s; \
1189           $(SET_LIB_PATH) \
1190           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
1191         else \
1192           true; \
1193         fi
1195 .PHONY: check-c++
1196 check-c++:
1197         @if [ -f ./gcc/Makefile ] ; then \
1198           r=`${PWD}`; export r; \
1199           s=`cd $(srcdir); ${PWD}`; export s; \
1200           $(SET_LIB_PATH) \
1201           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \
1202           $(MAKE) check-target-libstdc++-v3; \
1203         else \
1204           true; \
1205         fi 
1207 .PHONY: install-gcc
1208 install-gcc:
1209         @if [ -f ./gcc/Makefile ] ; then \
1210           r=`${PWD}`; export r; \
1211           s=`cd $(srcdir); ${PWD}`; export s; \
1212           $(SET_LIB_PATH) \
1213           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1214         else \
1215           true; \
1216         fi
1218 ALL_GCC = all-gcc
1219 ALL_GCC_C = $(ALL_GCC) all-target-newlib all-target-libgloss
1220 ALL_GCC_CXX = $(ALL_GCC_C) all-target-libstdc++-v3
1222 # This is a list of inter-dependencies among modules.
1223 all-autoconf: all-m4 all-texinfo
1224 all-automake: all-m4 all-texinfo
1225 all-bfd: all-libiberty all-intl
1226 all-binutils: all-libiberty all-opcodes all-bfd all-flex all-bison all-byacc all-intl
1227 all-bison: all-texinfo
1228 configure-target-boehm-gc: $(ALL_GCC_C) configure-target-qthreads
1229 all-dejagnu: all-tcl all-expect all-tk
1230 all-diff: all-libiberty
1231 configure-target-examples: $(ALL_GCC_C)
1232 all-expect: all-tcl all-tk
1233 all-fileutils: all-libiberty
1234 all-flex: all-libiberty all-bison all-byacc
1235 all-gas: all-libiberty all-opcodes all-bfd all-intl
1236 all-gcc: all-libiberty all-bison all-byacc all-binutils all-gas all-ld all-zlib
1237 all-bootstrap: all-libiberty all-texinfo all-bison all-byacc all-binutils all-gas all-ld all-zlib
1238 GDB_TK = @GDB_TK@
1239 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-bison all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
1240 configure-target-gperf: $(ALL_GCC_CXX)
1241 all-target-gperf: all-target-libiberty all-target-libstdc++-v3
1242 all-gprof: all-libiberty all-bfd all-opcodes all-intl
1243 all-grep: all-libiberty
1244 all-gzip: all-libiberty
1245 all-hello: all-libiberty
1246 all-itcl: all-tcl all-tk
1247 all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex all-intl
1248 configure-target-libgloss: $(ALL_GCC)
1249 all-target-libgloss: configure-target-newlib
1250 all-libgui: all-tcl all-tk all-itcl
1251 configure-target-libffi: $(ALL_GCC_C) 
1252 configure-target-libjava: $(ALL_GCC_C) configure-target-zlib configure-target-boehm-gc configure-target-qthreads configure-target-libffi
1253 all-target-libjava: all-fastjar all-target-zlib all-target-boehm-gc all-target-qthreads all-target-libffi
1254 configure-target-libstdc++-v3: $(ALL_GCC_C)
1255 all-target-libstdc++-v3: all-target-libiberty
1256 configure-target-libf2c: $(ALL_GCC_C)
1257 all-target-libf2c: all-target-libiberty
1258 configure-target-libobjc: $(ALL_GCC_C)
1259 all-target-libobjc: all-target-libiberty
1260 all-m4: all-libiberty all-texinfo
1261 all-make: all-libiberty
1262 configure-target-newlib: $(ALL_GCC)
1263 configure-target-libtermcap: $(ALL_GCC_C)
1264 all-opcodes: all-bfd all-libiberty
1265 all-patch: all-libiberty
1266 all-prms: all-libiberty
1267 configure-target-qthreads: $(ALL_GCC_C)
1268 all-recode: all-libiberty
1269 all-sed: all-libiberty
1270 all-send-pr: all-prms
1271 all-sid: all-tcl all-tk
1272 all-sim: all-libiberty all-bfd all-opcodes all-readline
1273 all-snavigator: all-tcl all-tk all-itcl all-tix all-db all-grep all-libgui
1274 all-tar: all-libiberty
1275 all-tclX: all-tcl all-tk
1276 all-tk: all-tcl
1277 all-texinfo: all-libiberty
1278 all-tix: all-tcl all-tk
1279 configure-target-winsup: $(ALL_GCC_C)
1280 all-target-winsup: all-target-libiberty all-target-libtermcap
1281 all-uudecode: all-libiberty
1282 configure-target-zlib: $(ALL_GCC_C)
1283 all-fastjar: all-zlib all-libiberty
1284 configure-target-fastjar: configure-target-zlib
1285 all-target-fastjar: all-target-zlib all-target-libiberty
1286 configure-target-libiberty: $(ALL_GCC_C)
1287 install-gdb: install-tcl install-tk install-itcl install-tix install-libgui
1288 install-sid: install-tcl install-tk
1290 # We put install-opcodes before install-binutils because the installed
1291 # binutils might be on PATH, and they might need the shared opcodes
1292 # library.
1293 install-binutils: install-opcodes
1295 # We put install-tcl before install-itcl because itcl wants to run a
1296 # program on installation which uses the Tcl libraries.
1297 install-itcl: install-tcl
1299 # This is a slightly kludgy method of getting dependencies on 
1300 # all-build-libiberty correct; it would be better to build it every time.
1301 all-gcc: @all_build_modules@
1303 # Dependencies of all-build-foo on configure-build-foo.
1304 all-build-libiberty: configure-build-libiberty
1306 # Dependencies of all-target-foo on configure-target-foo.
1307 [+ FOR target_modules +]all-target-[+module+]: configure-target-[+module+]
1308 [+ ENDFOR target_modules +]
1310 ### other supporting targets
1312 MAKEDIRS= \
1313         $(DESTDIR)$(prefix) \
1314         $(DESTDIR)$(exec_prefix)
1315 .PHONY: installdirs
1316 installdirs: mkinstalldirs
1317         $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
1319 dir.info: do-install-info
1320         if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
1321           $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
1322           mv -f dir.info.new dir.info ; \
1323         else true ; \
1324         fi
1326 dist:
1327         @echo "Building a full distribution of this tree isn't done"
1328         @echo "via 'make dist'.  Check out the etc/ subdirectory" 
1330 etags tags: TAGS
1332 # Right now this just builds TAGS in each subdirectory.  emacs19 has the
1333 # ability to use several tags files at once, so there is probably no need
1334 # to combine them into one big TAGS file (like CVS 1.3 does).  We could
1335 # (if we felt like it) have this Makefile write a piece of elisp which
1336 # the user could load to tell emacs19 where all the TAGS files we just
1337 # built are.
1338 TAGS: do-TAGS
1340 # Rebuilding Makefile.in, using autogen.
1341 $(srcdir)/Makefile.in: # $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def
1342         cd $(srcdir) && autogen Makefile.def
1344 # with the gnu make, this is done automatically.
1346 host_makefile_frag=@host_makefile_frag@
1347 target_makefile_frag=@target_makefile_frag@
1349 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag) $(gcc_version_trigger)
1350         $(SHELL) ./config.status
1354 .NOEXPORT:
1355 MAKEOVERRIDES=
1357 # end of Makefile.in