OSDN Git Service

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