OSDN Git Service

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