OSDN Git Service

top:
[pf3gnuchains/gcc-fork.git] / Makefile.tpl
1 [+ AutoGen5 template -*- Mode: Makefile -*-
2 in
3 +]
4
5 # Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'.
6 #
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, 2003 Free Software Foundation
10 #
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.
24 #
25
26 # -------------------------------
27 # Standard Autoconf-set variables
28 # -------------------------------
29 VPATH=@srcdir@
30
31 build_alias=@build_alias@
32 build=@build@
33 host_alias=@host_alias@
34 host=@host@
35 target_alias=@target_alias@
36 target=@target@
37
38 program_transform_name = @program_transform_name@
39
40 prefix = @prefix@
41 exec_prefix = @exec_prefix@
42
43 srcdir = @srcdir@
44
45 bindir = @bindir@
46 sbindir = @sbindir@
47 libexecdir = @libexecdir@
48 datadir = @datadir@
49 sysconfdir = @sysconfdir@
50 sharedstatedir = @sharedstatedir@
51 localstatedir = @localstatedir@
52 libdir = @libdir@
53 includedir = @includedir@
54 oldincludedir = @oldincludedir@
55 infodir = @infodir@
56 mandir = @mandir@
57 man1dir = $(mandir)/man1
58 man2dir = $(mandir)/man2
59 man3dir = $(mandir)/man3
60 man4dir = $(mandir)/man4
61 man5dir = $(mandir)/man5
62 man6dir = $(mandir)/man6
63 man7dir = $(mandir)/man7
64 man8dir = $(mandir)/man8
65 man9dir = $(mandir)/man9
66
67 # INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a
68 # cygwin host.
69 INSTALL_PROGRAM_ARGS =
70
71 INSTALL = $(SHELL) $$s/install-sh -c
72 INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS)
73 INSTALL_SCRIPT = $(INSTALL)
74 INSTALL_DATA = $(INSTALL) -m 644
75
76 # -------------------------------------------------
77 # Miscellaneous non-standard autoconf-set variables
78 # -------------------------------------------------
79
80 links=@configlinks@
81 # The file containing GCC's version number.
82 gcc_version_trigger = @gcc_version_trigger@
83 gcc_version = @gcc_version@
84
85 # The gcc driver likes to know the arguments it was configured with.
86 TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@
87
88 gxx_include_dir = @gxx_include_dir@
89 libstdcxx_incdir = @libstdcxx_incdir@
90
91 tooldir = @tooldir@
92 build_tooldir = @build_tooldir@
93
94 # Directory in which the compiler finds executables, libraries, etc.
95 libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
96 GDB_NLM_DEPS = 
97
98 # This is the name of the environment variable used for the path to
99 # the libraries.
100 RPATH_ENVVAR = @RPATH_ENVVAR@
101
102 # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
103 # was used.
104 SET_LIB_PATH = @SET_LIB_PATH@
105
106 # configure.in sets SET_LIB_PATH to this if --enable-shared was used.
107 # Some platforms don't like blank entries, so we remove duplicate,
108 # leading and trailing colons.
109 REALLY_SET_LIB_PATH = \
110   $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
111
112 # This is the list of directories to be built for the build system.
113 BUILD_CONFIGDIRS = libiberty
114 # Build programs are put under this directory.
115 BUILD_SUBDIR = @build_subdir@
116 # This is set by the configure script to the arguments to use when configuring
117 # directories built for the build system.
118 BUILD_CONFIGARGS = @build_configargs@
119
120 # This is the list of directories to built for the host system.
121 SUBDIRS = @configdirs@
122 # This is set by the configure script to the arguments to use when configuring
123 # directories built for the host system.
124 HOST_CONFIGARGS = @host_configargs@
125
126 # This is set by the configure script to the list of directories which
127 # should be built using the target tools.
128 TARGET_CONFIGDIRS = @target_configdirs@
129 # Target libraries are put under this directory:
130 TARGET_SUBDIR = @target_subdir@
131 # This is set by the configure script to the arguments to use when configuring
132 # directories built for the target.
133 TARGET_CONFIGARGS = @target_configargs@
134
135 # ----------------------------------------------
136 # Programs producing files for the BUILD machine
137 # ----------------------------------------------
138
139 SHELL = @config_shell@
140
141 # pwd command to use.  Allow user to override default by setting PWDCMD in
142 # the environment to account for automounters.  The make variable must not
143 # be called PWDCMD, otherwise the value set here is passed to make
144 # subprocesses and overrides the setting from the user's environment.
145 PWD = $${PWDCMD-pwd}
146
147 # compilers to use to create programs which must be run in the build
148 # environment.
149 CC_FOR_BUILD = @CC_FOR_BUILD@
150 CFLAGS_FOR_BUILD = $(CFLAGS)
151
152 CXX_FOR_BUILD = $(CXX)
153
154 # Special variables passed down in EXTRA_GCC_FLAGS.  They are defined
155 # here so that they can be overridden by Makefile fragments.
156 BUILD_PREFIX = @BUILD_PREFIX@
157 BUILD_PREFIX_1 = @BUILD_PREFIX_1@
158
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`
165
166 DEFAULT_YACC = @DEFAULT_YACC@
167 YACC=@YACC@
168 USUAL_YACC = `if [ -f $$r/bison/bison ] ; then \
169             echo $$r/bison/bison -y -L $$s/bison/ ; \
170         elif [ -f $$r/byacc/byacc ] ; then \
171             echo $$r/byacc/byacc ; \
172         else \
173             echo ${DEFAULT_YACC} ; \
174         fi`
175
176 DEFAULT_LEX = @DEFAULT_LEX@
177 LEX=@LEX@
178 USUAL_LEX = `if [ -f $$r/flex/flex ] ; \
179         then echo $$r/flex/flex ; \
180         else echo ${DEFAULT_LEX} ; fi`
181
182 DEFAULT_M4 = @DEFAULT_M4@
183 M4 = `if [ -f $$r/m4/m4 ] ; \
184         then echo $$r/m4/m4 ; \
185         else echo ${DEFAULT_M4} ; fi`
186
187 # For an installed makeinfo, we require it to be from texinfo 4.2 or
188 # higher, else we use the "missing" dummy.
189 MAKEINFO=@MAKEINFO@
190 USUAL_MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
191         then echo $$r/texinfo/makeinfo/makeinfo ; \
192         else if (makeinfo --version \
193           | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])') >/dev/null 2>&1; \
194         then echo makeinfo; else echo $$s/missing makeinfo; fi; fi`
195
196 # This just becomes part of the MAKEINFO definition passed down to
197 # sub-makes.  It lets flags be given on the command line while still
198 # using the makeinfo from the object tree.
199 # (Default to avoid splitting info files by setting the threshold high.)
200 MAKEINFOFLAGS = --split-size=5000000
201
202 EXPECT = `if [ -f $$r/expect/expect ] ; \
203         then echo $$r/expect/expect ; \
204         else echo expect ; fi`
205
206 RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \
207         then echo $$s/dejagnu/runtest ; \
208         else echo runtest ; fi`
209
210 # ---------------------------------------------
211 # Programs producing files for the HOST machine
212 # ---------------------------------------------
213
214 # This is the list of directories that may be needed in RPATH_ENVVAR
215 # so that programs built for the host machine work.
216 HOST_LIB_PATH = $$r/bfd:$$r/opcodes
217
218 AS = @AS@
219
220 AR = @AR@
221 AR_FLAGS = rc
222
223 CC = @CC@
224 CFLAGS = @CFLAGS@
225 LIBCFLAGS = $(CFLAGS)
226
227 CXX = @CXX@
228 CXXFLAGS = @CXXFLAGS@
229 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
230
231 DLLTOOL = @DLLTOOL@
232
233 NM = @NM@
234
235 LD = @LD@
236 LDFLAGS = 
237
238 RANLIB = @RANLIB@
239
240 WINDRES = @WINDRES@
241
242 PICFLAG = 
243
244 # -----------------------------------------------
245 # Programs producing files for the TARGET machine
246 # -----------------------------------------------
247
248 # This is the list of directories that may be needed in RPATH_ENVVAR
249 # so that prorgams built for the target machine work.
250 TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:
251
252 FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
253
254 AR_FOR_TARGET=@AR_FOR_TARGET@
255 USUAL_AR_FOR_TARGET = ` \
256   if [ -f $$r/binutils/ar ] ; then \
257     echo $$r/binutils/ar ; \
258   else \
259     if [ '$(host)' = '$(target)' ] ; then \
260       echo $(AR); \
261     else \
262        echo ar | sed '$(program_transform_name)' ; \
263     fi; \
264   fi`
265
266 AS_FOR_TARGET=@AS_FOR_TARGET@
267 USUAL_AS_FOR_TARGET = ` \
268   if [ -f $$r/gas/as-new ] ; then \
269     echo $$r/gas/as-new ; \
270   elif [ -f $$r/gcc/xgcc ]; then \
271     $(CC_FOR_TARGET) -print-prog-name=as ; \
272   else \
273     if [ '$(host)' = '$(target)' ] ; then \
274       echo $(AS); \
275     else \
276        echo as | sed '$(program_transform_name)' ; \
277     fi; \
278   fi`
279
280 CC_FOR_TARGET = @CC_FOR_TARGET@
281 # During gcc bootstrap, if we use some random cc for stage1 then
282 # CFLAGS will be just -g.  We want to ensure that TARGET libraries
283 # (which we know are built with gcc) are built with optimizations so
284 # prepend -O2 when setting CFLAGS_FOR_TARGET.
285 CFLAGS_FOR_TARGET = -O2 $(CFLAGS)
286 # If GCC_FOR_TARGET is not overriden on the command line, then this
287 # variable is passed down to the gcc Makefile, where it is used to
288 # build libgcc2.a.  We define it here so that it can itself be
289 # overridden on the command line.
290 GCC_FOR_TARGET=@GCC_FOR_TARGET@
291 USUAL_GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET)
292 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
293
294 CXX_FOR_TARGET = @CXX_FOR_TARGET@
295 RAW_CXX_FOR_TARGET = @RAW_CXX_FOR_TARGET@
296 CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
297 RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
298 CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
299 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
300
301 DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
302 USUAL_DLLTOOL_FOR_TARGET = ` \
303   if [ -f $$r/binutils/dlltool ] ; then \
304     echo $$r/binutils/dlltool ; \
305   else \
306     if [ '$(host)' = '$(target)' ] ; then \
307       echo $(DLLTOOL); \
308     else \
309        echo dlltool | sed '$(program_transform_name)' ; \
310     fi; \
311   fi`
312
313 GCJ_FOR_TARGET = @GCJ_FOR_TARGET@
314
315 LD_FOR_TARGET=@LD_FOR_TARGET@
316 USUAL_LD_FOR_TARGET = ` \
317   if [ -f $$r/ld/ld-new ] ; then \
318     echo $$r/ld/ld-new ; \
319   elif [ -f $$r/gcc/xgcc ]; then \
320     $(CC_FOR_TARGET) -print-prog-name=ld ; \
321   else \
322     if [ '$(host)' = '$(target)' ] ; then \
323       echo $(LD); \
324     else \
325        echo ld | sed '$(program_transform_name)' ; \
326     fi; \
327   fi`
328
329 LDFLAGS_FOR_TARGET = 
330
331 NM_FOR_TARGET=@NM_FOR_TARGET@
332 USUAL_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)' = '$(target)' ] ; then \
339       echo $(NM); \
340     else \
341        echo nm | sed '$(program_transform_name)' ; \
342     fi; \
343   fi`
344
345 RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@
346 USUAL_RANLIB_FOR_TARGET = ` \
347   if [ -f $$r/binutils/ranlib ] ; then \
348     echo $$r/binutils/ranlib ; \
349   else \
350     if [ '$(host)' = '$(target)' ] ; then \
351       if [ x'$(RANLIB)' != x ]; then \
352          echo $(RANLIB); \
353       else \
354          echo ranlib; \
355       fi; \
356     else \
357        echo ranlib | sed '$(program_transform_name)' ; \
358     fi; \
359   fi`
360
361 WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@
362 USUAL_WINDRES_FOR_TARGET = ` \
363   if [ -f $$r/binutils/windres ] ; then \
364     echo $$r/binutils/windres ; \
365   else \
366     if [ '$(host)' = '$(target)' ] ; then \
367       echo $(WINDRES); \
368     else \
369        echo windres | sed '$(program_transform_name)' ; \
370     fi; \
371   fi`
372
373 PICFLAG_FOR_TARGET = 
374
375 # ------------------------------------
376 # Miscellaneous targets and flag lists
377 # ------------------------------------
378
379 # The first rule in the file had better be this one.  Don't put any above it.
380 # This lives here to allow makefile fragments to contain dependencies.
381 all: all.normal
382 .PHONY: all
383
384 #### host and target specific makefile fragments come in here.
385 @target_makefile_frag@
386 @alphaieee_frag@
387 @ospace_frag@
388 @host_makefile_frag@
389 ###
390
391 # Flags to pass down to all sub-makes.
392 BASE_FLAGS_TO_PASS = [+ FOR flags_to_pass +]\
393         "[+flag+]=$([+flag+])" [+ ENDFOR flags_to_pass +]\
394         "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" 
395
396 # For any flags above that may contain shell code that varies from one
397 # target library to another.  When doing recursive invocations of the
398 # top-level Makefile, we don't want the outer make to evaluate them,
399 # so we pass these variables down unchanged.  They must not contain
400 # single nor double quotes.
401 RECURSE_FLAGS = \
402         CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \
403         RAW_CXX_FOR_TARGET='$(RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \
404
405 # Flags to pass down to most sub-makes, in which we're building with
406 # the host environment.
407 EXTRA_HOST_FLAGS = \
408         'AR=$(AR)' \
409         'AS=$(AS)' \
410         'CC=$(CC)' \
411         'CXX=$(CXX)' \
412         'DLLTOOL=$(DLLTOOL)' \
413         'LD=$(LD)' \
414         'NM=$(NM)' \
415         'RANLIB=$(RANLIB)' \
416         'WINDRES=$(WINDRES)'
417
418 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
419
420 # Flags that are concerned with the location of the X11 include files
421 # and library files
422 #
423 # NOTE: until the top-level is getting the values via autoconf, it only
424 # causes problems to have this top-level Makefile overriding the autoconf-set
425 # values in child directories.  Only variables that don't conflict with
426 # autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
427 #
428 X11_FLAGS_TO_PASS = \
429         'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
430         'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
431
432 # Flags to pass down to makes which are built with the target environment.
433 # The double $ decreases the length of the command line; the variables
434 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
435 EXTRA_TARGET_FLAGS = \
436         'AR=$$(AR_FOR_TARGET)' \
437         'AS=$$(AS_FOR_TARGET)' \
438         'CC=$$(CC_FOR_TARGET)' \
439         'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
440         'CXX=$$(CXX_FOR_TARGET)' \
441         'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
442         'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
443         'LD=$$(LD_FOR_TARGET)' \
444         'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
445         'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
446         'NM=$$(NM_FOR_TARGET)' \
447         'RANLIB=$$(RANLIB_FOR_TARGET)' \
448         'WINDRES=$$(WINDRES_FOR_TARGET)'
449
450 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
451
452 # Flags to pass down to gcc.  gcc builds a library, libgcc.a, so it
453 # unfortunately needs the native compiler and the target ar and
454 # ranlib.
455 # If any variables are added here, they must be added to do-*, below.
456 # The BUILD_* variables are a special case, which are used for the gcc
457 # cross-building scheme.
458 EXTRA_GCC_FLAGS = \
459         'AR=$(AR)' \
460         'AS=$(AS)' \
461         'CC=$(CC)' \
462         'CXX=$(CXX)' \
463         'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
464         'BUILD_PREFIX=$(BUILD_PREFIX)' \
465         'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \
466         'NM=$(NM)' \
467         'RANLIB=$(RANLIB)' \
468         'WINDRES=$$(WINDRES_FOR_TARGET)' \
469         "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
470         "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
471         "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s/.*=$$/XFOO=/`" \
472         "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s/.*=$$/XFOO=/`" \
473         "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s/.*=$$/XFOO=/`" \
474         "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
475         "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
476         "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \
477         "`echo 'ENQUIRE=$(ENQUIRE)' | sed -e s/.*=$$/XFOO=/`" \
478         "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
479         "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`"
480
481 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
482
483 .PHONY: configure-host
484 configure-host: maybe-configure-gcc [+
485   FOR host_modules +] \
486     maybe-configure-[+module+][+
487   ENDFOR host_modules +]
488 .PHONY: configure-target
489 configure-target: [+
490   FOR target_modules +] \
491     maybe-configure-target-[+module+][+
492   ENDFOR target_modules +]
493
494 # The target built for a native build.
495 .PHONY: all.normal
496 all.normal: @all_build_modules@ all-host all-target
497
498 .PHONY: all-host
499 all-host: maybe-all-gcc [+
500   FOR host_modules +] \
501     maybe-all-[+module+][+
502   ENDFOR host_modules +]
503 .PHONY: all-target
504 all-target: [+
505   FOR target_modules +] \
506     maybe-all-target-[+module+][+
507   ENDFOR target_modules +]
508
509 # Do a target for all the subdirectories.  A ``make do-X'' will do a
510 # ``make X'' in all subdirectories (because, in general, there is a
511 # dependency (below) of X upon do-X, a ``make X'' will also do this,
512 # but it may do additional work as well).
513 [+ FOR recursive_targets +]
514 .PHONY: do-[+make_target+]
515 do-[+make_target+]: [+make_target+]-host [+make_target+]-target
516
517 .PHONY: [+make_target+]-host
518 [+make_target+]-host: maybe-[+make_target+]-gcc [+
519   FOR host_modules +] \
520     maybe-[+make_target+]-[+module+][+
521   ENDFOR host_modules +]
522
523 .PHONY: [+make_target+]-target
524 [+make_target+]-target: [+
525   FOR target_modules +] \
526     maybe-[+make_target+]-target-[+module+][+
527   ENDFOR target_modules +]
528
529 # GCC, the eternal special case
530 .PHONY: maybe-[+make_target+]-gcc [+make_target+]-gcc
531 maybe-[+make_target+]-gcc:
532 [+make_target+]-gcc: [+
533   FOR depend +]\
534     [+depend+]-gcc [+
535   ENDFOR depend +]
536         @[ -f ./gcc/Makefile ] || exit 0; \
537         r=`${PWD}`; export r; \
538         s=`cd $(srcdir); ${PWD}`; export s; \
539         $(SET_LIB_PATH) \
540         for flag in $(EXTRA_GCC_FLAGS); do \
541           eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
542         done; \
543         echo "Doing [+make_target+] in gcc" ; \
544         (cd gcc && \
545           $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
546                   "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
547                   "RANLIB=$${RANLIB}" \
548                   "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
549                   [+make_target+]) \
550           || exit 1
551
552 # Host modules.
553 [+ FOR host_modules +]
554 .PHONY: maybe-[+make_target+]-[+module+] [+make_target+]-[+module+]
555 maybe-[+make_target+]-[+module+]:
556 [+ IF (match-value? = "missing" (get "make_target") ) +]
557 # [+module+] doesn't support [+make_target+].
558 [+make_target+]-[+module+]:
559 [+ ELSE +]
560 [+make_target+]-[+module+]: [+
561   FOR depend +]\
562     [+depend+]-[+module+] [+
563   ENDFOR depend +]
564         @[ -f ./[+module+]/Makefile ] || exit 0; \
565         r=`${PWD}`; export r; \
566         s=`cd $(srcdir); ${PWD}`; export s; \
567         $(SET_LIB_PATH) \
568         for flag in $(EXTRA_HOST_FLAGS); do \
569           eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
570         done; \
571         echo "Doing [+make_target+] in [+module+]" ; \
572         (cd [+module+] && \
573           $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
574                   "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
575                   "RANLIB=$${RANLIB}" \
576                   "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
577                   [+make_target+]) \
578           || exit 1
579 [+ ENDIF +]
580 [+ ENDFOR host_modules +]
581
582 # Target modules.
583 [+ FOR target_modules +]
584 .PHONY: maybe-[+make_target+]-target-[+module+] [+make_target+]-target-[+module+]
585 maybe-[+make_target+]-target-[+module+]:
586 [+ IF (match-value? = "missing" (get "make_target") ) +]
587 # [+module+] doesn't support [+make_target+].
588 [+make_target+]-target-[+module+]:
589 [+ ELSE +]
590 [+make_target+]-target-[+module+]: [+
591   FOR depend +]\
592     [+depend+]-target-[+module+] [+
593   ENDFOR depend +]
594         @[ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] || exit 0 ; \
595         r=`${PWD}`; export r; \
596         s=`cd $(srcdir); ${PWD}`; export s; \
597         $(SET_LIB_PATH) \
598         echo "Doing [+make_target+] in $(TARGET_SUBDIR)/[+module+]" ; \
599         for flag in $(EXTRA_TARGET_FLAGS); do \
600           eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
601         done; \
602         (cd $(TARGET_SUBDIR)/[+module+] && \
603           $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
604                   "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
605                   "RANLIB=$${RANLIB}" \
606                   "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
607                   [+make_target+]) \
608           || exit 1
609 [+ ENDIF +]
610 [+ ENDFOR target_modules +]
611 [+ ENDFOR recursive_targets +]
612
613 # Here are the targets which correspond to the do-X targets.
614
615 .PHONY: info installcheck dvi install-info
616 .PHONY: clean distclean mostlyclean maintainer-clean realclean
617 .PHONY: local-clean local-distclean local-maintainer-clean
618 info: do-info
619 installcheck: do-installcheck
620 dvi: do-dvi
621
622 # Make sure makeinfo is built before we do a `make info', if we're
623 # in fact building texinfo.
624 do-info: maybe-all-texinfo
625
626 install-info: do-install-info dir.info
627         s=`cd $(srcdir); ${PWD}`; export s; \
628         if [ -f dir.info ] ; then \
629           $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \
630         else true ; fi
631
632 local-clean:
633         -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
634
635 local-distclean:
636         -rm -f Makefile config.status config.cache mh-frag mt-frag
637         -rm -f multilib.out multilib.tmp maybedep.tmp serdep.tmp
638         -if [ "$(TARGET_SUBDIR)" != "." ]; then \
639           rm -rf $(TARGET_SUBDIR); \
640         else true; fi
641         -rm -rf $(BUILD_SUBDIR)
642         -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile
643         -rm -f texinfo/doc/Makefile texinfo/po/POTFILES
644         -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null
645         -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null
646         -rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null
647
648 local-maintainer-clean:
649         @echo "This command is intended for maintainers to use;"
650         @echo "it deletes files that may require special tools to rebuild."
651
652 clean: do-clean local-clean
653 mostlyclean: do-mostlyclean local-clean
654 distclean: do-distclean local-clean local-distclean
655 maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean 
656 maintainer-clean: local-distclean
657 realclean: maintainer-clean
658
659 # Extra dependency for clean-target, owing to the mixed nature of gcc
660 clean-target: clean-target-libgcc
661 clean-target-libgcc:
662         test ! -d gcc/libgcc || \
663         (cd gcc/libgcc && find . -type d -print) | \
664         while read d; do rm -f gcc/$$d/libgcc.a || : ; done
665         -rm -rf gcc/libgcc
666
667 # Check target.
668
669 .PHONY: check do-check
670 check:
671         $(MAKE) do-check
672
673 # Only include modules actually being configured and built.
674 do-check: maybe-check-gcc [+
675   FOR host_modules +] \
676     maybe-check-[+module+][+
677   ENDFOR host_modules +][+
678   FOR target_modules +] \
679     maybe-check-target-[+module+][+
680   ENDFOR target_modules +]
681
682 # Automated reporting of test results.
683
684 warning.log: build.log
685         $(srcdir)/contrib/warn_summary build.log > $@
686
687 mail-report.log:
688         if test x'$(BOOT_CFLAGS)' != x''; then \
689             BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
690         fi; \
691         $(srcdir)/contrib/test_summary -t >$@
692         chmod +x $@
693         echo If you really want to send e-mail, run ./$@ now
694
695 mail-report-with-warnings.log: warning.log
696         if test x'$(BOOT_CFLAGS)' != x''; then \
697             BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
698         fi; \
699         $(srcdir)/contrib/test_summary -t -i warning.log >$@
700         chmod +x $@
701         echo If you really want to send e-mail, run ./$@ now
702
703 # Installation targets.
704
705 .PHONY: install uninstall
706 install: installdirs install-host install-target
707
708 .PHONY: install-host-nogcc
709 install-host-nogcc: [+
710   FOR host_modules +] \
711     maybe-install-[+module+][+
712   ENDFOR host_modules +]
713
714 .PHONY: install-host
715 install-host: maybe-install-gcc [+
716   FOR host_modules +] \
717     maybe-install-[+module+][+
718   ENDFOR host_modules +]
719
720 .PHONY: install-target
721 install-target: [+
722   FOR target_modules +] \
723     maybe-install-target-[+module+][+
724   ENDFOR target_modules +]
725
726 uninstall:
727         @echo "the uninstall target is not supported in this tree"
728
729 .PHONY: install.all
730 install.all: install-no-fixedincludes
731         @if [ -f ./gcc/Makefile ] ; then \
732                 r=`${PWD}` ; export r ; \
733                 $(SET_LIB_PATH) \
734                 (cd ./gcc && \
735                 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
736         else \
737                 true ; \
738         fi
739
740 # install-no-fixedincludes is used because Cygnus can not distribute
741 # the fixed header files.
742 .PHONY: install-no-fixedincludes
743 install-no-fixedincludes: installdirs install-host-nogcc \
744         install-target gcc-no-fixedincludes
745
746 ### other supporting targets
747
748 MAKEDIRS= \
749         $(DESTDIR)$(prefix) \
750         $(DESTDIR)$(exec_prefix)
751 .PHONY: installdirs
752 installdirs: mkinstalldirs
753         $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
754
755 dir.info: do-install-info
756         if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
757           $(srcdir)/texinfo/gen-info-dir $(DESTDIR)$(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
758           mv -f dir.info.new dir.info ; \
759         else true ; \
760         fi
761
762 dist:
763         @echo "Building a full distribution of this tree isn't done"
764         @echo "via 'make dist'.  Check out the etc/ subdirectory" 
765
766 etags tags: TAGS
767
768 # Right now this just builds TAGS in each subdirectory.  emacs19 has the
769 # ability to use several tags files at once, so there is probably no need
770 # to combine them into one big TAGS file (like CVS 1.3 does).  We could
771 # (if we felt like it) have this Makefile write a piece of elisp which
772 # the user could load to tell emacs19 where all the TAGS files we just
773 # built are.
774 TAGS: do-TAGS
775
776 # --------------------------------------
777 # Modules which run on the build machine
778 # --------------------------------------
779 [+ FOR build_modules +]
780 .PHONY: configure-build-[+module+] maybe-configure-build-[+module+]
781 maybe-configure-build-[+module+]:
782 configure-build-[+module+]:
783         @test ! -f $(BUILD_SUBDIR)/[+module+]/Makefile || exit 0; \
784         [ -d $(BUILD_SUBDIR)/[+module+] ] || \
785           mkdir $(BUILD_SUBDIR)/[+module+];\
786         r=`${PWD}`; export r; \
787         s=`cd $(srcdir); ${PWD}`; export s; \
788         AR="$(AR_FOR_BUILD)"; export AR; \
789         AS="$(AS_FOR_BUILD)"; export AS; \
790         CC="$(CC_FOR_BUILD)"; export CC; \
791         CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
792         CXX="$(CXX_FOR_BUILD)"; export CXX; \
793         CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
794         GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
795         DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
796         LD="$(LD_FOR_BUILD)"; export LD; \
797         LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
798         NM="$(NM_FOR_BUILD)"; export NM; \
799         RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
800         WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
801         echo Configuring in $(BUILD_SUBDIR)/[+module+]; \
802         cd "$(BUILD_SUBDIR)/[+module+]" || exit 1; \
803         case $(srcdir) in \
804           /* | [A-Za-z]:[\\/]*) \
805             topdir=$(srcdir) ;; \
806           *) \
807             case "$(BUILD_SUBDIR)" in \
808               .) topdir="../$(srcdir)" ;; \
809               *) topdir="../../$(srcdir)" ;; \
810             esac ;; \
811         esac; \
812         if [ "$(srcdir)" = "." ] ; then \
813           if [ "$(BUILD_SUBDIR)" != "." ] ; then \
814             if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \
815               if [ -f Makefile ]; then \
816                 if $(MAKE) distclean; then \
817                   true; \
818                 else \
819                   exit 1; \
820                 fi; \
821               else \
822                 true; \
823               fi; \
824             else \
825               exit 1; \
826             fi; \
827           else \
828             true; \
829           fi; \
830           srcdiroption="--srcdir=."; \
831           libsrcdir="."; \
832         else \
833           srcdiroption="--srcdir=$${topdir}/[+module+]"; \
834           libsrcdir="$$s/[+module+]"; \
835         fi; \
836         rm -f no-such-file || : ; \
837         CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
838           $(BUILD_CONFIGARGS) $${srcdiroption} \
839           --with-build-subdir="$(BUILD_SUBDIR)" \
840           || exit 1
841
842 .PHONY: all-build-[+module+] maybe-all-build-[+module+]
843 maybe-all-build-[+module+]:
844 all-build-[+module+]: configure-build-[+module+]
845         @r=`${PWD}`; export r; \
846         s=`cd $(srcdir); ${PWD}`; export s; \
847         (cd $(BUILD_SUBDIR)/[+module+] && $(MAKE) all)
848 [+ ENDFOR build_modules +]
849
850 # --------------------------------------
851 # Modules which run on the host machine
852 # --------------------------------------
853 [+ FOR host_modules +]
854 .PHONY: configure-[+module+] maybe-configure-[+module+]
855 maybe-configure-[+module+]:
856 configure-[+module+]:
857         @test ! -f [+module+]/Makefile || exit 0; \
858         [ -d [+module+] ] || mkdir [+module+]; \
859         r=`${PWD}`; export r; \
860         s=`cd $(srcdir); ${PWD}`; export s; \
861         CC="$(CC)"; export CC; \
862         CFLAGS="$(CFLAGS)"; export CFLAGS; \
863         CXX="$(CXX)"; export CXX; \
864         CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
865         AR="$(AR)"; export AR; \
866         AS="$(AS)"; export AS; \
867         CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
868         DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
869         LD="$(LD)"; export LD; \
870         NM="$(NM)"; export NM; \
871         RANLIB="$(RANLIB)"; export RANLIB; \
872         WINDRES="$(WINDRES)"; export WINDRES; \
873         OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
874         OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
875         echo Configuring in [+module+]; \
876         cd [+module+] || exit 1; \
877         case $(srcdir) in \
878           \.) \
879             srcdiroption="--srcdir=."; \
880             libsrcdir=".";; \
881           /* | [A-Za-z]:[\\/]*) \
882             srcdiroption="--srcdir=$(srcdir)/[+module+]"; \
883             libsrcdir="$$s/[+module+]";; \
884           *) \
885             srcdiroption="--srcdir=../$(srcdir)/[+module+]"; \
886             libsrcdir="$$s/[+module+]";; \
887         esac; \
888         $(SHELL) $${libsrcdir}/configure \
889           $(HOST_CONFIGARGS) $${srcdiroption} \
890           || exit 1
891
892 .PHONY: all-[+module+] maybe-all-[+module+]
893 maybe-all-[+module+]:
894 all-[+module+]: configure-[+module+]
895         @r=`${PWD}`; export r; \
896         s=`cd $(srcdir); ${PWD}`; export s; \
897         $(SET_LIB_PATH) \
898         (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ 
899           IF with_x 
900             +] $(X11_FLAGS_TO_PASS)[+ 
901           ENDIF with_x +] all)
902
903 .PHONY: check-[+module+] maybe-check-[+module+]
904 maybe-check-[+module+]:
905 [+ IF no_check +]
906 check-[+module+]:
907 [+ ELIF no_check_cross +]
908 # This module is only tested in a native toolchain.
909 check-[+module+]:
910         @if [ '$(host)' = '$(target)' ] ; then \
911           r=`${PWD}`; export r; \
912           s=`cd $(srcdir); ${PWD}`; export s; \
913           $(SET_LIB_PATH) \
914           (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ 
915             IF with_x 
916               +] $(X11_FLAGS_TO_PASS)[+ 
917             ENDIF with_x +] check); \
918         fi
919 [+ ELSE check +]
920 check-[+module+]:
921         @r=`${PWD}`; export r; \
922         s=`cd $(srcdir); ${PWD}`; export s; \
923         $(SET_LIB_PATH) \
924         (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ 
925           IF with_x 
926             +] $(X11_FLAGS_TO_PASS)[+ 
927           ENDIF with_x +] check)
928 [+ ENDIF no_check +]
929
930 .PHONY: install-[+module+] maybe-install-[+module+]
931 maybe-install-[+module+]:
932 [+ IF no_install +]
933 install-[+module+]:
934 [+ ELSE install +]
935 install-[+module+]: installdirs
936         @r=`${PWD}`; export r; \
937         s=`cd $(srcdir); ${PWD}`; export s; \
938         $(SET_LIB_PATH) \
939         (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ 
940           IF with_x 
941             +] $(X11_FLAGS_TO_PASS)[+ 
942           ENDIF with_x +] install)
943 [+ ENDIF no_install +]
944 [+ ENDFOR host_modules +]
945
946 # ---------------------------------------
947 # Modules which run on the target machine
948 # ---------------------------------------
949 [+ FOR target_modules +]
950 .PHONY: configure-target-[+module+] maybe-configure-target-[+module+]
951 maybe-configure-target-[+module+]:
952
953 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
954 $(TARGET_SUBDIR)/[+module+]/multilib.out: multilib.out
955         @[ -d $(TARGET_SUBDIR)/[+module+] ] || \
956           mkdir $(TARGET_SUBDIR)/[+module+]; \
957         rm -f $(TARGET_SUBDIR)/[+module+]/Makefile || : ; \
958         cp multilib.out $(TARGET_SUBDIR)/[+module+]/multilib.out
959
960 configure-target-[+module+]: $(TARGET_SUBDIR)/[+module+]/multilib.out
961         @test ! -f $(TARGET_SUBDIR)/[+module+]/Makefile || exit 0; \
962         [ -d $(TARGET_SUBDIR)/[+module+] ] || \
963           mkdir $(TARGET_SUBDIR)/[+module+];\
964         r=`${PWD}`; export r; \
965         s=`cd $(srcdir); ${PWD}`; export s; \
966         $(SET_LIB_PATH) \
967         AR="$(AR_FOR_TARGET)"; export AR; \
968         AS="$(AS_FOR_TARGET)"; export AS; \
969         CC="$(CC_FOR_TARGET)"; export CC; \
970         CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
971         CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \[+ 
972 IF raw_cxx +]
973         CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
974         CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \[+ 
975 ELSE normal_cxx +]
976         CXX="$(CXX_FOR_TARGET)"; export CXX; \[+ 
977 ENDIF raw_cxx +]
978         CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
979         GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
980         DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
981         LD="$(LD_FOR_TARGET)"; export LD; \
982         LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
983         NM="$(NM_FOR_TARGET)"; export NM; \
984         RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
985         WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
986         echo Configuring in $(TARGET_SUBDIR)/[+module+]; \
987         cd "$(TARGET_SUBDIR)/[+module+]" || exit 1; \
988         case $(srcdir) in \
989           /* | [A-Za-z]:[\\/]*) \
990             topdir=$(srcdir) ;; \
991           *) \
992             case "$(TARGET_SUBDIR)" in \
993               .) topdir="../$(srcdir)" ;; \
994               *) topdir="../../$(srcdir)" ;; \
995             esac ;; \
996         esac; \
997         if [ "$(srcdir)" = "." ] ; then \
998           if [ "$(TARGET_SUBDIR)" != "." ] ; then \
999             if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \
1000               if [ -f Makefile ]; then \
1001                 if $(MAKE) distclean; then \
1002                   true; \
1003                 else \
1004                   exit 1; \
1005                 fi; \
1006               else \
1007                 true; \
1008               fi; \
1009             else \
1010               exit 1; \
1011             fi; \
1012           else \
1013             true; \
1014           fi; \
1015           srcdiroption="--srcdir=."; \
1016           libsrcdir="."; \
1017         else \
1018           srcdiroption="--srcdir=$${topdir}/[+module+]"; \
1019           libsrcdir="$$s/[+module+]"; \
1020         fi; \
1021         rm -f no-such-file || : ; \
1022         CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
1023           $(TARGET_CONFIGARGS) $${srcdiroption} \
1024           --with-target-subdir="$(TARGET_SUBDIR)" \
1025           || exit 1
1026
1027 .PHONY: all-target-[+module+] maybe-all-target-[+module+]
1028 maybe-all-target-[+module+]:
1029 all-target-[+module+]: configure-target-[+module+]
1030         @r=`${PWD}`; export r; \
1031         s=`cd $(srcdir); ${PWD}`; export s; \
1032         $(SET_LIB_PATH) \
1033         (cd $(TARGET_SUBDIR)/[+module+] && \
1034           $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
1035             IF raw_cxx 
1036           +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ 
1037             ENDIF raw_cxx 
1038           +] all)
1039
1040 .PHONY: check-target-[+module+] maybe-check-target-[+module+]
1041 maybe-check-target-[+module+]:
1042 [+ IF no_check +]
1043 # Dummy target for uncheckable module.
1044 check-target-[+module+]:
1045 [+ ELSE check +]
1046 check-target-[+module+]:
1047         @r=`${PWD}`; export r; \
1048         s=`cd $(srcdir); ${PWD}`; export s; \
1049         $(SET_LIB_PATH) \
1050         (cd $(TARGET_SUBDIR)/[+module+] && \
1051           $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
1052             IF raw_cxx 
1053               +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ 
1054             ENDIF raw_cxx 
1055           +] check)
1056 [+ ENDIF no_check +]
1057
1058 .PHONY: install-target-[+module+] maybe-install-target-[+module+]
1059 maybe-install-target-[+module+]:
1060 [+ IF no_install +]
1061 # Dummy target for uninstallable.
1062 install-target-[+module+]:
1063 [+ ELSE install +]
1064 install-target-[+module+]: installdirs
1065         @r=`${PWD}`; export r; \
1066         s=`cd $(srcdir); ${PWD}`; export s; \
1067         $(SET_LIB_PATH) \
1068         (cd $(TARGET_SUBDIR)/[+module+] && \
1069           $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
1070 [+ ENDIF no_install +]
1071 [+ ENDFOR target_modules +]
1072
1073 # ----------
1074 # GCC module
1075 # ----------
1076
1077 # Unfortunately, while gcc _should_ be a host module,
1078 # libgcc is a target module, and gen* programs are
1079 # build modules.  So GCC is a sort of hybrid.
1080
1081 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
1082 .PHONY: configure-gcc maybe-configure-gcc
1083 maybe-configure-gcc:
1084 configure-gcc:
1085         @test ! -f gcc/Makefile || exit 0; \
1086         [ -d gcc ] || mkdir gcc; \
1087         r=`${PWD}`; export r; \
1088         s=`cd $(srcdir); ${PWD}`; export s; \
1089         CC="$(CC)"; export CC; \
1090         CFLAGS="$(CFLAGS)"; export CFLAGS; \
1091         CXX="$(CXX)"; export CXX; \
1092         CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
1093         TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
1094         AR="$(AR)"; export AR; \
1095         AS="$(AS)"; export AS; \
1096         CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
1097         DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
1098         LD="$(LD)"; export LD; \
1099         NM="$(NM)"; export NM; \
1100         RANLIB="$(RANLIB)"; export RANLIB; \
1101         WINDRES="$(WINDRES)"; export WINDRES; \
1102         OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
1103         OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
1104         echo Configuring in gcc; \
1105         cd gcc || exit 1; \
1106         case $(srcdir) in \
1107           \.) \
1108             srcdiroption="--srcdir=."; \
1109             libsrcdir=".";; \
1110           /* | [A-Za-z]:[\\/]*) \
1111             srcdiroption="--srcdir=$(srcdir)/gcc"; \
1112             libsrcdir="$$s/gcc";; \
1113           *) \
1114             srcdiroption="--srcdir=../$(srcdir)/gcc"; \
1115             libsrcdir="$$s/gcc";; \
1116         esac; \
1117         $(SHELL) $${libsrcdir}/configure \
1118           $(HOST_CONFIGARGS) $${srcdiroption} \
1119           || exit 1
1120
1121 # Don't 'make all' in gcc if it's already been made by 'bootstrap'; that
1122 # causes trouble.  This wart will be fixed eventually by moving
1123 # the bootstrap behavior to this file.
1124 .PHONY: all-gcc maybe-all-gcc
1125 maybe-all-gcc:
1126 all-gcc: configure-gcc
1127         @if [ -f gcc/stage_last ] ; then \
1128           r=`${PWD}`; export r; \
1129           s=`cd $(srcdir); ${PWD}`; export s; \
1130           $(SET_LIB_PATH) \
1131           (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) quickstrap); \
1132         else \
1133           r=`${PWD}`; export r; \
1134           s=`cd $(srcdir); ${PWD}`; export s; \
1135           $(SET_LIB_PATH) \
1136           (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
1137         fi
1138
1139 # Building GCC uses some tools for rebuilding "source" files
1140 # like texinfo, bison/byacc, etc.  So we must depend on those.
1141 #
1142 # While building GCC, it may be necessary to run various target
1143 # programs like the assembler, linker, etc.  So we depend on
1144 # those too.
1145 #
1146 # In theory, on an SMP all those dependencies can be resolved
1147 # in parallel.
1148 #
1149 GCC_STRAP_TARGETS = bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap
1150 .PHONY: $(GCC_STRAP_TARGETS)
1151 $(GCC_STRAP_TARGETS): all-bootstrap configure-gcc
1152         @r=`${PWD}`; export r; \
1153         s=`cd $(srcdir); ${PWD}`; export s; \
1154         $(SET_LIB_PATH) \
1155         echo "Bootstrapping the compiler"; \
1156         cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@
1157         @r=`${PWD}`; export r; \
1158         s=`cd $(srcdir); ${PWD}`; export s; \
1159         case "$@" in \
1160           *bootstrap4-lean ) \
1161             msg="Comparing stage3 and stage4 of the compiler"; \
1162             compare=compare3-lean ;; \
1163           *bootstrap4 ) \
1164             msg="Comparing stage3 and stage4 of the compiler"; \
1165             compare=compare3 ;; \
1166           *-lean ) \
1167             msg="Comparing stage2 and stage3 of the compiler"; \
1168             compare=compare-lean ;; \
1169           * ) \
1170             msg="Comparing stage2 and stage3 of the compiler"; \
1171             compare=compare ;; \
1172         esac; \
1173         $(SET_LIB_PATH) \
1174         echo "$$msg"; \
1175         cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
1176         @r=`${PWD}`; export r; \
1177         s=`cd $(srcdir); ${PWD}` ; export s; \
1178         $(SET_LIB_PATH) \
1179         echo "Building runtime libraries"; \
1180         $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
1181
1182 profiledbootstrap: all-bootstrap configure-gcc
1183         @r=`${PWD}`; export r; \
1184         s=`cd $(srcdir); ${PWD}`; export s; \
1185         $(SET_LIB_PATH) \
1186         echo "Bootstrapping the compiler"; \
1187         cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stageprofile_build
1188         @r=`${PWD}`; export r; \
1189         s=`cd $(srcdir); ${PWD}` ; export s; \
1190         $(SET_LIB_PATH) \
1191         echo "Building runtime libraries and training compiler"; \
1192         $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
1193         @r=`${PWD}`; export r; \
1194         s=`cd $(srcdir); ${PWD}`; export s; \
1195         $(SET_LIB_PATH) \
1196         echo "Building feedback based compiler"; \
1197         cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stagefeedback_build
1198
1199 .PHONY: cross
1200 cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
1201         @r=`${PWD}`; export r; \
1202         s=`cd $(srcdir); ${PWD}`; export s; \
1203         $(SET_LIB_PATH) \
1204         echo "Building the C and C++ compiler"; \
1205         cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
1206         @r=`${PWD}`; export r; \
1207         s=`cd $(srcdir); ${PWD}` ; export s; \
1208         $(SET_LIB_PATH) \
1209         echo "Building runtime libraries"; \
1210         $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \
1211           LANGUAGES="c c++" all
1212
1213 .PHONY: check-gcc maybe-check-gcc
1214 maybe-check-gcc:
1215 check-gcc:
1216         @if [ -f ./gcc/Makefile ] ; then \
1217           r=`${PWD}`; export r; \
1218           s=`cd $(srcdir); ${PWD}`; export s; \
1219           $(SET_LIB_PATH) \
1220           (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
1221         else \
1222           true; \
1223         fi
1224
1225 .PHONY: check-gcc-c++
1226 check-gcc-c++:
1227         @if [ -f ./gcc/Makefile ] ; then \
1228           r=`${PWD}`; export r; \
1229           s=`cd $(srcdir); ${PWD}`; export s; \
1230           $(SET_LIB_PATH) \
1231           (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \
1232         else \
1233           true; \
1234         fi
1235
1236 .PHONY: check-c++
1237 check-c++:
1238         $(MAKE) check-target-libstdc++-v3 check-gcc-c++
1239
1240 .PHONY: install-gcc maybe-install-gcc
1241 maybe-install-gcc:
1242 install-gcc:
1243         @if [ -f ./gcc/Makefile ] ; then \
1244           r=`${PWD}`; export r; \
1245           s=`cd $(srcdir); ${PWD}`; export s; \
1246           $(SET_LIB_PATH) \
1247           (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1248         else \
1249           true; \
1250         fi
1251
1252 # Install the gcc headers files, but not the fixed include files,
1253 # which Cygnus is not allowed to distribute.  This rule is very
1254 # dependent on the workings of the gcc Makefile.in.
1255 .PHONY: gcc-no-fixedincludes
1256 gcc-no-fixedincludes:
1257         @if [ -f ./gcc/Makefile ]; then \
1258           rm -rf gcc/tmp-include; \
1259           mv gcc/include gcc/tmp-include 2>/dev/null; \
1260           mkdir gcc/include; \
1261           cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
1262           touch gcc/stmp-fixinc gcc/include/fixed; \
1263           rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
1264           r=`${PWD}`; export r; \
1265           s=`cd $(srcdir); ${PWD}` ; export s; \
1266           $(SET_LIB_PATH) \
1267           (cd ./gcc && \
1268            $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1269           rm -rf gcc/include; \
1270           mv gcc/tmp-include gcc/include 2>/dev/null; \
1271         else true; fi
1272
1273 # --------------------------------------
1274 # Dependencies between different modules
1275 # --------------------------------------
1276
1277 # There are two types of dependencies here: 'hard' dependencies, where one
1278 # module simply won't build without the other; and 'soft' dependencies, where
1279 # if the depended-on module is missing, the depending module will do without
1280 # or find a substitute somewhere (perhaps installed).  Soft dependencies
1281 # are specified by depending on a 'maybe-' target.  If you're not sure,
1282 # it's safer to use a soft dependency.
1283
1284 # Host modules specific to gcc.
1285 # GCC needs to identify certain tools.
1286 configure-gcc: maybe-configure-binutils maybe-configure-gas maybe-configure-ld maybe-configure-bison maybe-configure-flex
1287 all-gcc: maybe-all-libiberty maybe-all-intl maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib
1288 # This is a slightly kludgy method of getting dependencies on 
1289 # all-build-libiberty correct; it would be better to build it every time.
1290 all-gcc: maybe-all-build-libiberty
1291 all-bootstrap: maybe-all-libiberty maybe-all-texinfo maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib
1292
1293 # Host modules specific to gdb.
1294 # GDB needs to know that the simulator is being built.
1295 configure-gdb: maybe-configure-itcl maybe-configure-tcl maybe-configure-tk maybe-configure-sim
1296 GDB_TK = @GDB_TK@
1297 all-gdb: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-mmalloc maybe-all-readline maybe-all-bison maybe-all-byacc maybe-all-sim $(gdbnlmrequirements) $(GDB_TK)
1298 install-gdb: maybe-install-tcl maybe-install-tk maybe-install-itcl maybe-install-tix maybe-install-libgui
1299 configure-libgui: maybe-configure-tcl maybe-configure-tk
1300 all-libgui: maybe-all-tcl maybe-all-tk maybe-all-itcl
1301
1302 # Host modules specific to binutils.
1303 configure-bfd: configure-libiberty
1304 all-bfd: maybe-all-libiberty maybe-all-intl
1305 all-binutils: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-flex maybe-all-bison maybe-all-byacc maybe-all-intl
1306 # We put install-opcodes before install-binutils because the installed
1307 # binutils might be on PATH, and they might need the shared opcodes
1308 # library.
1309 install-binutils: maybe-install-opcodes
1310 # libopcodes depends on libbfd
1311 install-opcodes: maybe-install-bfd
1312 all-gas: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-intl
1313 all-gprof: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-intl
1314 all-ld: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-bison maybe-all-byacc maybe-all-flex maybe-all-intl
1315 all-opcodes: maybe-all-bfd maybe-all-libiberty
1316
1317 # Other host modules in the 'src' repository.
1318 all-dejagnu: maybe-all-tcl maybe-all-expect maybe-all-tk
1319 configure-expect: maybe-configure-tcl maybe-configure-tk
1320 all-expect: maybe-all-tcl maybe-all-tk
1321 configure-itcl: maybe-configure-tcl maybe-configure-tk
1322 all-itcl: maybe-all-tcl maybe-all-tk
1323 # We put install-tcl before install-itcl because itcl wants to run a
1324 # program on installation which uses the Tcl libraries.
1325 install-itcl: maybe-install-tcl
1326 all-sid: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-tcl maybe-all-tk
1327 install-sid: maybe-install-tcl maybe-install-tk
1328 all-sim: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-readline maybe-configure-gdb
1329 configure-tk: maybe-configure-tcl
1330 all-tk: maybe-all-tcl
1331 configure-tix: maybe-configure-tcl maybe-configure-tk
1332 all-tix: maybe-all-tcl maybe-all-tk
1333 all-texinfo: maybe-all-libiberty
1334
1335 # Other host modules.  Warning, these are not well tested.
1336 all-autoconf: maybe-all-m4 maybe-all-texinfo
1337 all-automake: maybe-all-m4 maybe-all-texinfo
1338 all-bison: maybe-all-texinfo
1339 all-diff: maybe-all-libiberty
1340 all-fastjar: maybe-all-zlib maybe-all-libiberty
1341 all-fileutils: maybe-all-libiberty
1342 all-flex: maybe-all-libiberty maybe-all-bison maybe-all-byacc
1343 all-gzip: maybe-all-libiberty
1344 all-hello: maybe-all-libiberty
1345 all-m4: maybe-all-libiberty maybe-all-texinfo
1346 all-make: maybe-all-libiberty
1347 all-patch: maybe-all-libiberty
1348 all-prms: maybe-all-libiberty
1349 all-recode: maybe-all-libiberty
1350 all-sed: maybe-all-libiberty
1351 all-send-pr: maybe-all-prms
1352 all-tar: maybe-all-libiberty
1353 all-uudecode: maybe-all-libiberty
1354
1355 ALL_GCC = maybe-all-gcc
1356 ALL_GCC_C = $(ALL_GCC) maybe-all-target-newlib maybe-all-target-libgloss
1357 ALL_GCC_CXX = $(ALL_GCC_C) maybe-all-target-libstdc++-v3
1358
1359 # Target modules specific to gcc.
1360 configure-target-boehm-gc: $(ALL_GCC_C) maybe-configure-target-qthreads
1361 configure-target-fastjar: maybe-configure-target-zlib
1362 all-target-fastjar: maybe-all-target-zlib maybe-all-target-libiberty
1363 configure-target-libf2c: $(ALL_GCC_C)
1364 all-target-libf2c: maybe-all-target-libiberty
1365 configure-target-libffi: $(ALL_GCC_C) 
1366 configure-target-libjava: $(ALL_GCC_C) maybe-configure-target-zlib maybe-configure-target-boehm-gc maybe-configure-target-qthreads maybe-configure-target-libffi
1367 all-target-libjava: maybe-all-fastjar maybe-all-target-zlib maybe-all-target-boehm-gc maybe-all-target-qthreads maybe-all-target-libffi
1368 configure-target-libobjc: $(ALL_GCC_C)
1369 all-target-libobjc: maybe-all-target-libiberty
1370 configure-target-libstdc++-v3: $(ALL_GCC_C)
1371 all-target-libstdc++-v3: maybe-all-target-libiberty
1372 configure-target-zlib: $(ALL_GCC_C)
1373
1374 # Target modules in the 'src' repository.
1375 configure-target-examples: $(ALL_GCC_C)
1376 configure-target-libgloss: $(ALL_GCC)
1377 all-target-libgloss: maybe-configure-target-newlib
1378 configure-target-libiberty: $(ALL_GCC)
1379 configure-target-libtermcap: $(ALL_GCC_C)
1380 configure-target-newlib: $(ALL_GCC)
1381 configure-target-rda: $(ALL_GCC_C)
1382 configure-target-winsup: $(ALL_GCC_C)
1383 all-target-winsup: maybe-all-target-libiberty maybe-all-target-libtermcap
1384
1385 # Other target modules.  Warning, these are not well tested.
1386 configure-target-gperf: $(ALL_GCC_CXX)
1387 all-target-gperf: maybe-all-target-libiberty maybe-all-target-libstdc++-v3
1388 configure-target-qthreads: $(ALL_GCC_C)
1389
1390 # Dependencies of maybe-foo on foo.  These are used because, for example,
1391 # all-gcc only depends on all-gas if gas is present and being configured.
1392 @maybe_dependencies@
1393
1394 # Serialization dependencies.  Host configures don't work well in parallel to
1395 # each other, due to contention over config.cache.  Target configures and 
1396 # build configures are similar.
1397 @serialization_dependencies@
1398
1399 # --------------------------------
1400 # Regenerating top level configury
1401 # --------------------------------
1402
1403 # Multilib.out tells target dirs what multilibs they should build.
1404 # There is really only one copy.  We use the 'timestamp' method to
1405 # work around various timestamp bugs on some systems.
1406 # We use move-if-change so that it's only considered updated when it
1407 # actually changes, because it has to depend on a phony target.
1408 multilib.out: maybe-all-gcc
1409         @r=`${PWD}`; export r; \
1410         echo "Checking multilib configuration..."; \
1411         $(CC_FOR_TARGET) --print-multi-lib > multilib.tmp 2> /dev/null ; \
1412         $(SHELL) $(srcdir)/move-if-change multilib.tmp multilib.out ; \
1413
1414 # Rebuilding Makefile.in, using autogen.
1415 AUTOGEN = autogen
1416 $(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def
1417         cd $(srcdir) && $(AUTOGEN) Makefile.def
1418
1419 # Rebuilding Makefile.
1420 Makefile: $(srcdir)/Makefile.in config.status
1421         CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
1422
1423 config.status: configure $(gcc_version_trigger)
1424         $(SHELL) ./config.status --recheck
1425
1426 # Rebuilding configure.
1427 AUTOCONF = autoconf
1428 $(srcdir)/configure: @MAINT@ $(srcdir)/configure.in $(srcdir)/config/acx.m4
1429         cd $(srcdir) && $(AUTOCONF)
1430
1431 # ------------------------------
1432 # Special directives to GNU Make
1433 # ------------------------------
1434
1435 # Don't pass command-line variables to submakes.
1436 .NOEXPORT:
1437 MAKEOVERRIDES=
1438
1439 # end of Makefile.in