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