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