OSDN Git Service

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