2002-10-01 Nathanael Nerode <neroden@gcc.gnu.org>
[binutils.git] / Makefile.tpl
blob2a423508771e321c1e3140db314cca148f8b45bb
1 [+ AutoGen5 template
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 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 # Tell GNU make 3.79 not to run the top level in parallel.  This 
27 # prevents contention for $builddir/$target/config.cache, as well
28 # as minimizing scatter in file system caches.
29 NOTPARALLEL = .NOTPARALLEL
30 $(NOTPARALLEL):
32 srcdir = @srcdir@
34 prefix = @prefix@
35 exec_prefix = @exec_prefix@
37 bindir = @bindir@
38 sbindir = @sbindir@
39 libexecdir = @libexecdir@
40 datadir = @datadir@
41 sysconfdir = @sysconfdir@
42 sharedstatedir = @sharedstatedir@
43 localstatedir = @localstatedir@
44 libdir = @libdir@
45 includedir = @includedir@
46 oldincludedir = @oldincludedir@
47 infodir = @infodir@
48 mandir = @mandir@
49 gxx_include_dir=@gxx_include_dir@
51 tooldir = @tooldir@
52 build_tooldir = @build_tooldir@
54 program_transform_name = @program_transform_name@
56 man1dir = $(mandir)/man1
57 man2dir = $(mandir)/man2
58 man3dir = $(mandir)/man3
59 man4dir = $(mandir)/man4
60 man5dir = $(mandir)/man5
61 man6dir = $(mandir)/man6
62 man7dir = $(mandir)/man7
63 man8dir = $(mandir)/man8
64 man9dir = $(mandir)/man9
65 # Directory in which the compiler finds executables, libraries, etc.
66 libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version)
67 GDB_NLM_DEPS = 
69 SHELL = @config_shell@
71 # pwd command to use.  Allow user to override default by setting PWDCMD in
72 # the environment to account for automounters.  The make variable must not
73 # be called PWDCMD, otherwise the value set here is passed to make
74 # subprocesses and overrides the setting from the user's environment.
75 PWD = $${PWDCMD-pwd}
77 # INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a
78 # cygwin host.
79 INSTALL_PROGRAM_ARGS =
81 INSTALL = $(SHELL) $$s/install-sh -c
82 INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS)
83 INSTALL_SCRIPT = $(INSTALL)
84 INSTALL_DATA = $(INSTALL) -m 644
86 INSTALL_DOSREL = install-dosrel-fake
88 AS = as
89 AR = ar
90 AR_FLAGS = rc
91 CC = cc
93 # Special variables passed down in EXTRA_GCC_FLAGS.  They are defined
94 # here so that they can be overridden by Makefile fragments.
95 HOST_CC = $(CC_FOR_BUILD)
96 BUILD_PREFIX = 
97 BUILD_PREFIX_1 = loser-
99 # These flag values are normally overridden by the configure script.
100 CFLAGS = -g
101 CXXFLAGS = -g -O2
103 LDFLAGS = 
104 LIBCFLAGS = $(CFLAGS)
105 CFLAGS_FOR_BUILD = $(CFLAGS)
106 # During gcc bootstrap, if we use some random cc for stage1 then
107 # CFLAGS will be just -g.  We want to ensure that TARGET libraries
108 # (which we know are built with gcc) are built with optimizations so
109 # prepend -O2 when setting CFLAGS_FOR_TARGET.
110 CFLAGS_FOR_TARGET = -O2 $(CFLAGS)
111 LDFLAGS_FOR_TARGET = 
112 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
113 PICFLAG = 
114 PICFLAG_FOR_TARGET = 
116 CXX = c++
118 # Use -O2 to stress test the compiler.
119 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
120 CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
121 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
123 DLLTOOL = dlltool
124 WINDRES = windres
126 NM = nm
128 LD = ld
130 BZIPPROG = bzip2
131 MD5PROG = md5sum
133 # These values are substituted by configure.
134 DEFAULT_YACC = @DEFAULT_YACC@
135 DEFAULT_LEX = @DEFAULT_LEX@
136 DEFAULT_M4 = @DEFAULT_M4@
138 BISON = `if [ -f $$r/bison/bison ] ; then \
139             echo $$r/bison/bison -L $$s/bison/ ; \
140          else \
141             echo bison ; \
142          fi`
144 YACC = `if [ -f $$r/bison/bison ] ; then \
145             echo $$r/bison/bison -y -L $$s/bison/ ; \
146         elif [ -f $$r/byacc/byacc ] ; then \
147             echo $$r/byacc/byacc ; \
148         else \
149             echo ${DEFAULT_YACC} ; \
150         fi`
152 LEX = `if [ -f $$r/flex/flex ] ; \
153         then echo $$r/flex/flex ; \
154         else echo ${DEFAULT_LEX} ; fi`
156 M4 = `if [ -f $$r/m4/m4 ] ; \
157         then echo $$r/m4/m4 ; \
158         else echo ${DEFAULT_M4} ; fi`
160 # For an installed makeinfo, we require it to be from texinfo 4 or
161 # higher, else we use the "missing" dummy.
162 MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
163         then echo $$r/texinfo/makeinfo/makeinfo ; \
164         else if (makeinfo --version \
165           | egrep 'texinfo[^0-9]*([1-3][0-9]|[4-9])') >/dev/null 2>&1; \
166         then echo makeinfo; else echo $$s/missing makeinfo; fi; fi`
168 # This just becomes part of the MAKEINFO definition passed down to
169 # sub-makes.  It lets flags be given on the command line while still
170 # using the makeinfo from the object tree.
171 MAKEINFOFLAGS =
173 EXPECT = `if [ -f $$r/expect/expect ] ; \
174         then echo $$r/expect/expect ; \
175         else echo expect ; fi`
177 RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \
178         then echo $$s/dejagnu/runtest ; \
179         else echo runtest ; fi`
182 # compilers to use to create programs which must be run in the build
183 # environment.
184 CC_FOR_BUILD = $(CC)
185 CXX_FOR_BUILD = $(CXX)
187 SUBDIRS = @configdirs@
189 # This is set by the configure script to the list of directories which
190 # should be built using the target tools.
191 TARGET_CONFIGDIRS = @target_configdirs@
193 # Target libraries are put under this directory:
194 # Changed by configure to $(target_alias) if cross.
195 TARGET_SUBDIR = @target_subdir@
197 BUILD_CONFIGDIRS = libiberty
198 BUILD_SUBDIR = @build_subdir@
200 # This is set by the configure script to the arguments to use when configuring
201 # directories built for the target.
202 TARGET_CONFIGARGS = @target_configargs@
204 # This is set by the configure script to the arguments to use when configuring
205 # directories built for the build system.
206 BUILD_CONFIGARGS = @build_configargs@
208 # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
209 # was used.
210 SET_LIB_PATH =
212 # This is the name of the environment variable used for the path to
213 # the libraries.  This may be changed by configure.in.
214 RPATH_ENVVAR = LD_LIBRARY_PATH
216 # This is the list of directories that may be needed in RPATH_ENVVAR
217 # so that programs built for the host machine work.
218 HOST_LIB_PATH = $$r/bfd:$$r/opcodes
220 # This is the list of directories that may be needed in RPATH_ENVVAR
221 # so that prorgams built for the target machine work.
222 TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:
224 # configure.in sets SET_LIB_PATH to this if --enable-shared was used.
225 # Some platforms don't like blank entries, so we remove duplicate,
226 # leading and trailing colons.
227 REALLY_SET_LIB_PATH = \
228   $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
230 ALL = all.normal
231 INSTALL_TARGET = installdirs \
232         install-gcc \
233         $(INSTALL_MODULES) \
234         $(INSTALL_TARGET_MODULES) \
235         $(INSTALL_X11_MODULES) \
236         $(INSTALL_DOSREL)
238 INSTALL_TARGET_CROSS = installdirs \
239         install-gcc-cross \
240         $(INSTALL_MODULES) \
241         $(INSTALL_TARGET_MODULES) \
242         $(INSTALL_X11_MODULES) \
243         $(INSTALL_DOSREL)
245 # Should be substed by configure.in
246 FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
247 CC_FOR_TARGET = @CC_FOR_TARGET@
248 CXX_FOR_TARGET = @CXX_FOR_TARGET@
249 CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
250 GCJ_FOR_TARGET = @GCJ_FOR_TARGET@
252 # If GCC_FOR_TARGET is not overriden on the command line, then this
253 # variable is passed down to the gcc Makefile, where it is used to
254 # build libgcc2.a.  We define it here so that it can itself be
255 # overridden on the command line.
256 GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET)
258 AS_FOR_TARGET = ` \
259   if [ -f $$r/gas/as-new ] ; then \
260     echo $$r/gas/as-new ; \
261   elif [ -f $$r/gcc/xgcc ]; then \
262     $(CC_FOR_TARGET) -print-prog-name=as ; \
263   else \
264     if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
265       echo $(AS); \
266     else \
267        t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \
268     fi; \
269   fi`
271 LD_FOR_TARGET = ` \
272   if [ -f $$r/ld/ld-new ] ; then \
273     echo $$r/ld/ld-new ; \
274   elif [ -f $$r/gcc/xgcc ]; then \
275     $(CC_FOR_TARGET) -print-prog-name=ld ; \
276   else \
277     if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
278       echo $(LD); \
279     else \
280        t='$(program_transform_name)'; echo ld | sed -e 's/x/x/' $$t ; \
281     fi; \
282   fi`
284 DLLTOOL_FOR_TARGET = ` \
285   if [ -f $$r/binutils/dlltool ] ; then \
286     echo $$r/binutils/dlltool ; \
287   else \
288     if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
289       echo $(DLLTOOL); \
290     else \
291        t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \
292     fi; \
293   fi`
295 WINDRES_FOR_TARGET = ` \
296   if [ -f $$r/binutils/windres ] ; then \
297     echo $$r/binutils/windres ; \
298   else \
299     if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
300       echo $(WINDRES); \
301     else \
302        t='$(program_transform_name)'; echo windres | sed -e 's/x/x/' $$t ; \
303     fi; \
304   fi`
306 AR_FOR_TARGET = ` \
307   if [ -f $$r/binutils/ar ] ; then \
308     echo $$r/binutils/ar ; \
309   else \
310     if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
311       echo $(AR); \
312     else \
313        t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
314     fi; \
315   fi`
317 RANLIB_FOR_TARGET = ` \
318   if [ -f $$r/binutils/ranlib ] ; then \
319     echo $$r/binutils/ranlib ; \
320   else \
321     if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
322       if [ x'$(RANLIB)' != x ]; then \
323          echo $(RANLIB); \
324       else \
325          echo ranlib; \
326       fi; \
327     else \
328        t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
329     fi; \
330   fi`
332 NM_FOR_TARGET = ` \
333   if [ -f $$r/binutils/nm-new ] ; then \
334     echo $$r/binutils/nm-new ; \
335   elif [ -f $$r/gcc/xgcc ]; then \
336     $(CC_FOR_TARGET) -print-prog-name=nm ; \
337   else \
338     if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
339       echo $(NM); \
340     else \
341        t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
342     fi; \
343   fi`
345 # The first rule in the file had better be this one.  Don't put any above it.
346 # This lives here to allow makefile fragments to contain dependencies.
347 all: all.normal
348 .PHONY: all
350 # These can be overridden by config/mt-*.
351 # The _TARGET_ is because they're specified in mt-foo.
352 # The _HOST_ is because they're programs that run on the host.
353 EXTRA_TARGET_HOST_ALL_MODULES =
354 EXTRA_TARGET_HOST_INSTALL_MODULES =
355 EXTRA_TARGET_HOST_CHECK_MODULES =
357 #### host and target specific makefile fragments come in here.
360 # Flags to pass down to all sub-makes.
361 # Please keep these in alphabetical order.
362 BASE_FLAGS_TO_PASS = \
363         "AR_FLAGS=$(AR_FLAGS)" \
364         "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
365         "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
366         "BISON=$(BISON)" \
367         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
368         "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
369         "CFLAGS=$(CFLAGS)" \
370         "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
371         "GCJ_FOR_TARGET=$(GCJ_FOR_TARGET)" \
372         "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
373         "CXXFLAGS=$(CXXFLAGS)" \
374         "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
375         "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
376         "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
377         "INSTALL=$(INSTALL)" \
378         "INSTALL_DATA=$(INSTALL_DATA)" \
379         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
380         "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
381         "LDFLAGS=$(LDFLAGS)" \
382         "LEX=$(LEX)" \
383         "LD_FOR_TARGET=$(LD_FOR_TARGET)" \
384         "LIBCFLAGS=$(LIBCFLAGS)" \
385         "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
386         "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
387         "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
388         "M4=$(M4)" \
389         "MAKE=$(MAKE)" \
390         "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
391         "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
392         "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
393         "RPATH_ENVVAR=$(RPATH_ENVVAR)" \
394         "SHELL=$(SHELL)" \
395         "EXPECT=$(EXPECT)" \
396         "RUNTEST=$(RUNTEST)" \
397         "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
398         "TARGET_SUBDIR=$(TARGET_SUBDIR)" \
399         "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \
400         "YACC=$(YACC)" \
401         "bindir=$(bindir)" \
402         "datadir=$(datadir)" \
403         "exec_prefix=$(exec_prefix)" \
404         "includedir=$(includedir)" \
405         "infodir=$(infodir)" \
406         "libdir=$(libdir)" \
407         "libexecdir=$(libexecdir)" \
408         "lispdir=$(lispdir)" \
409         "libstdcxx_incdir=$(libstdcxx_incdir)" \
410         "libsubdir=$(libsubdir)" \
411         "localstatedir=$(localstatedir)" \
412         "mandir=$(mandir)" \
413         "oldincludedir=$(oldincludedir)" \
414         "prefix=$(prefix)" \
415         "sbindir=$(sbindir)" \
416         "sharedstatedir=$(sharedstatedir)" \
417         "sysconfdir=$(sysconfdir)" \
418         "tooldir=$(tooldir)" \
419         "build_tooldir=$(build_tooldir)" \
420         "gxx_include_dir=$(gxx_include_dir)" \
421         "gcc_version=$(gcc_version)" \
422         "gcc_version_trigger=$(gcc_version_trigger)" \
423         "target_alias=$(target_alias)" 
425 # For any flags above that may contain shell code that varies from one
426 # target library to another.  When doing recursive invocations of the
427 # top-level Makefile, we don't want the outer make to evaluate them,
428 # so we pass these variables down unchanged.  They must not contain
429 # single nor double quotes.
430 RECURSE_FLAGS = \
431         CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)'
433 # Flags to pass down to most sub-makes, in which we're building with
434 # the host environment.
435 # If any variables are added here, they must be added to do-*, below.
436 EXTRA_HOST_FLAGS = \
437         'AR=$(AR)' \
438         'AS=$(AS)' \
439         'CC=$(CC)' \
440         'CXX=$(CXX)' \
441         'DLLTOOL=$(DLLTOOL)' \
442         'LD=$(LD)' \
443         'NM=$(NM)' \
444         "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \
445         'WINDRES=$(WINDRES)'
447 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
449 # Flags that are concerned with the location of the X11 include files
450 # and library files
452 # NOTE: until the top-level is getting the values via autoconf, it only
453 # causes problems to have this top-level Makefile overriding the autoconf-set
454 # values in child directories.  Only variables that don't conflict with
455 # autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
457 X11_FLAGS_TO_PASS = \
458         'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
459         'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
461 # Flags to pass down to makes which are built with the target environment.
462 # The double $ decreases the length of the command line; the variables
463 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
464 # If any variables are added here, they must be added to do-*, below.
465 EXTRA_TARGET_FLAGS = \
466         'AR=$$(AR_FOR_TARGET)' \
467         'AS=$$(AS_FOR_TARGET)' \
468         'CC=$$(CC_FOR_TARGET)' \
469         'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
470         'CXX=$$(CXX_FOR_TARGET)' \
471         'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
472         'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
473         'LD=$$(LD_FOR_TARGET)' \
474         'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
475         'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
476         'NM=$$(NM_FOR_TARGET)' \
477         'RANLIB=$$(RANLIB_FOR_TARGET)' \
478         'WINDRES=$$(WINDRES_FOR_TARGET)'
480 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
482 # Flags to pass down to gcc.  gcc builds a library, libgcc.a, so it
483 # unfortunately needs the native compiler and the target ar and
484 # ranlib.
485 # If any variables are added here, they must be added to do-*, below.
486 # The HOST_* variables are a special case, which are used for the gcc
487 # cross-building scheme.
488 EXTRA_GCC_FLAGS = \
489         'AR=$(AR)' \
490         'AS=$(AS)' \
491         'CC=$(CC)' \
492         'CXX=$(CXX)' \
493         'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
494         'HOST_CC=$(CC_FOR_BUILD)' \
495         'BUILD_PREFIX=$(BUILD_PREFIX)' \
496         'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \
497         'NM=$(NM)' \
498         "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \
499         'WINDRES=$$(WINDRES_FOR_TARGET)' \
500         "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
501         "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
502         "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s/.*=$$/XFOO=/`" \
503         "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s/.*=$$/XFOO=/`" \
504         "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s/.*=$$/XFOO=/`" \
505         "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
506         "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
507         "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \
508         "`echo 'ENQUIRE=$(ENQUIRE)' | sed -e s/.*=$$/XFOO=/`" \
509         "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
510         "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`"
512 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
514 # This is a list of the targets for all of the modules which are compiled
515 # using the build machine's native compiler.  Configure edits the second
516 # macro for build!=host builds.
517 ALL_BUILD_MODULES_LIST = \
518         all-build-libiberty
519 ALL_BUILD_MODULES = @all_build_modules@
521 # This is a list of the configure targets for all of the modules which
522 # are compiled using the native tools.
523 CONFIGURE_BUILD_MODULES = \
524         configure-build-libiberty
526 # This is a list of the targets for all of the modules which are compiled
527 # using $(FLAGS_TO_PASS).
528 ALL_MODULES = [+ FOR host_modules +]\
529         all-[+module+] [+ ENDFOR host_modules +]\
530         $(EXTRA_TARGET_HOST_ALL_MODULES)
532 # This is a list of the check targets for all of the modules which are
533 # compiled using $(FLAGS_TO_PASS).
535 # The list is in two parts.  The first lists those tools which
536 # are tested as part of the host's native tool-chain, and not
537 # tested in a cross configuration.
538 NATIVE_CHECK_MODULES = \
539         check-bison \
540         check-byacc \
541         check-fastjar \
542         check-flex \
543         check-zip
545 CROSS_CHECK_MODULES = [+ FOR host_modules +][+ IF no_check  +][+ ELIF no_check_cross +][+ ELSE x +]\
546         check-[+module+] [+ ENDIF no_check +][+ ENDFOR host_modules +]\
547         $(EXTRA_TARGET_HOST_CHECK_MODULES)
549 CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
551 # This is a list of the install targets for all of the modules which are
552 # compiled using $(FLAGS_TO_PASS).
553 # We put install-opcodes before install-binutils because the installed
554 # binutils might be on PATH, and they might need the shared opcodes
555 # library.
556 # We put install-tcl before install-itcl because itcl wants to run a
557 # program on installation which uses the Tcl libraries.
558 INSTALL_MODULES = [+ FOR host_modules+][+ IF no_install +][+ ELSE no_install +]\
559         install-[+module+] [+ ENDIF no_install +][+ ENDFOR host_modules +]\
560         $(EXTRA_TARGET_HOST_INSTALL_MODULES)
562 # This is a list of the targets for all of the modules which are compiled
563 # using $(X11_FLAGS_TO_PASS).
564 ALL_X11_MODULES = \
565         all-gdb \
566         all-expect \
567         all-guile \
568         all-tclX \
569         all-tk \
570         all-tix
572 # This is a list of the check targets for all of the modules which are
573 # compiled using $(X11_FLAGS_TO_PASS).
574 CHECK_X11_MODULES = \
575         check-gdb \
576         check-guile \
577         check-expect \
578         check-tclX \
579         check-tk \
580         check-tix
582 # This is a list of the install targets for all the modules which are
583 # compiled using $(X11_FLAGS_TO_PASS).
584 INSTALL_X11_MODULES = \
585         install-gdb \
586         install-guile \
587         install-expect \
588         install-tclX \
589         install-tk \
590         install-tix
592 # This is a list of the targets for all of the modules which are compiled
593 # using $(TARGET_FLAGS_TO_PASS).
594 ALL_TARGET_MODULES = [+ FOR target_modules +]\
595         all-target-[+module+] [+ ENDFOR target_modules +]
597 # This is a list of the configure targets for all of the modules which
598 # are compiled using the target tools.
599 CONFIGURE_TARGET_MODULES = [+ FOR target_modules +]\
600         configure-target-[+module+] [+ ENDFOR target_modules +]
602 # This is a list of the check targets for all of the modules which are
603 # compiled using $(TARGET_FLAGS_TO_PASS).
604 CHECK_TARGET_MODULES = [+ FOR target_modules +][+ IF no_check +][+ ELSE check +]\
605         check-target-[+module+] [+ ENDIF no_check +][+ ENDFOR target_modules +]
607 # This is a list of the install targets for all of the modules which are
608 # compiled using $(TARGET_FLAGS_TO_PASS).
609 INSTALL_TARGET_MODULES = [+ FOR target_modules +][+ IF no_install +][+ ELSE install +]\
610         install-target-[+module+] [+ ENDIF no_install +][+ ENDFOR target_modules +]
612 # This is a list of the targets for which we can do a clean-{target}.
613 CLEAN_MODULES = [+ FOR host_modules +][+ IF no_clean +][+ ELSE no_clean +]\
614         clean-[+module+] [+ ENDIF no_clean +][+ ENDFOR host_modules +]
616 # All of the target modules that can be cleaned
617 CLEAN_TARGET_MODULES = [+ FOR target_modules +][+ IF no_clean +][+ ELSE clean +]\
618         clean-target-[+module+] [+ ENDIF no_clean +][+ ENDFOR target_modules +]
620 # All of the x11 modules that can be cleaned
621 CLEAN_X11_MODULES = \
622         clean-gdb \
623         clean-expect \
624         clean-guile \
625         clean-tclX \
626         clean-tk \
627         clean-tix
629 # The target built for a native build.
630 .PHONY: all.normal
631 all.normal: \
632         $(ALL_BUILD_MODULES) \
633         $(ALL_MODULES) \
634         $(ALL_X11_MODULES) \
635         $(ALL_TARGET_MODULES) \
636         all-gcc
638 # Do a target for all the subdirectories.  A ``make do-X'' will do a
639 # ``make X'' in all subdirectories (because, in general, there is a
640 # dependency (below) of X upon do-X, a ``make X'' will also do this,
641 # but it may do additional work as well).
642 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
643 # because it is so large that it can easily overflow the command line
644 # length limit on some systems.
645 DO_X = \
646         do-clean \
647         do-distclean \
648         do-dvi \
649         do-info \
650         do-install-info \
651         do-installcheck \
652         do-mostlyclean \
653         do-maintainer-clean \
654         do-TAGS
655 .PHONY: $(DO_X)
656 $(DO_X):
657         @target=`echo $@ | sed -e 's/^do-//'`; \
658         r=`${PWD}`; export r; \
659         s=`cd $(srcdir); ${PWD}`; export s; \
660         $(SET_LIB_PATH) \
661         for i in $(SUBDIRS) -dummy-; do \
662           if [ -f ./$$i/Makefile ]; then \
663             case $$i in \
664             gcc) \
665               for flag in $(EXTRA_GCC_FLAGS); do \
666                 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
667               done; \
668               ;; \
669             *) \
670               for flag in $(EXTRA_HOST_FLAGS); do \
671                 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
672               done; \
673               ;; \
674             esac ; \
675             if (cd ./$$i; \
676                 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
677                         "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
678                         "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
679                         "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
680                         $${target}); \
681             then true; else exit 1; fi; \
682           else true; fi; \
683         done
684         @target=`echo $@ | sed -e 's/^do-//'`; \
685         r=`${PWD}`; export r; \
686         s=`cd $(srcdir); ${PWD}`; export s; \
687         $(SET_LIB_PATH) \
688         for i in $(TARGET_CONFIGDIRS) -dummy-; do \
689           if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \
690             for flag in $(EXTRA_TARGET_FLAGS); do \
691                 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
692             done; \
693             if (cd $(TARGET_SUBDIR)/$$i; \
694                 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
695                         "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
696                         "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
697                         "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
698                         $${target}); \
699             then true; else exit 1; fi; \
700           else true; fi; \
701         done
703 # Here are the targets which correspond to the do-X targets.
705 .PHONY: info installcheck dvi install-info
706 .PHONY: clean distclean mostlyclean maintainer-clean realclean
707 .PHONY: local-clean local-distclean local-maintainer-clean
708 info: do-info
709 installcheck: do-installcheck
710 dvi: do-dvi
712 # Make sure makeinfo is built before we do a `make info'.
713 do-info: all-texinfo
715 install-info: do-install-info dir.info
716         s=`cd $(srcdir); ${PWD}`; export s; \
717         if [ -f dir.info ] ; then \
718           $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
719         else true ; fi
721 local-clean:
722         -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
724 local-distclean:
725         -rm -f Makefile config.status config.cache mh-frag mt-frag
726         -if [ "$(TARGET_SUBDIR)" != "." ]; then \
727           rm -rf $(TARGET_SUBDIR); \
728         else true; fi
729         -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile
730         -rm -f texinfo/doc/Makefile texinfo/po/POTFILES
731         -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null
732         -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null
733         -rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null
735 local-maintainer-clean:
736         @echo "This command is intended for maintainers to use;"
737         @echo "it deletes files that may require special tools to rebuild."
739 clean: do-clean local-clean
740 mostlyclean: do-mostlyclean local-clean
741 distclean: do-distclean local-clean local-distclean
742 maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean 
743 maintainer-clean: local-distclean
744 realclean: maintainer-clean
746 # This rule is used to clean specific modules.
747 .PHONY: $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc
748 $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc:
749         @dir=`echo $@ | sed -e 's/clean-//'`; \
750         if [ -f ./$${dir}/Makefile ] ; then \
751           r=`${PWD}`; export r; \
752           s=`cd $(srcdir); ${PWD}`; export s; \
753           $(SET_LIB_PATH) \
754           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) clean); \
755         else \
756           true; \
757         fi
759 .PHONY: $(CLEAN_TARGET_MODULES)
760 $(CLEAN_TARGET_MODULES):
761         @dir=`echo $@ | sed -e 's/clean-target-//'`; \
762         rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
763         if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
764           r=`${PWD}`; export r; \
765           s=`cd $(srcdir); ${PWD}`; export s; \
766           $(SET_LIB_PATH) \
767           (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \
768         else \
769           true; \
770         fi
772 clean-target: $(CLEAN_TARGET_MODULES) clean-target-libgcc
773 clean-target-libgcc:
774         test ! -d gcc/libgcc || \
775         (cd gcc/libgcc && find . -type d -print) | \
776         while read d; do rm -f gcc/$$d/libgcc.a || : ; done
777         -rm -rf gcc/libgcc
779 # Check target.
781 .PHONY: check do-check
782 check:
783         $(MAKE) do-check NOTPARALLEL=parallel-ok
785 do-check: $(CHECK_MODULES) \
786         $(CHECK_TARGET_MODULES) \
787         $(CHECK_X11_MODULES) \
788         check-gcc
790 # Automated reporting of test results.
792 warning.log: build.log
793         $(srcdir)/contrib/warn_summary build.log > $@
795 mail-report.log:
796         if test x'$(BOOT_CFLAGS)' != x''; then \
797             BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
798         fi; \
799         $(srcdir)/contrib/test_summary -t >$@
800         chmod +x $@
801         echo If you really want to send e-mail, run ./$@ now
803 mail-report-with-warnings.log: warning.log
804         if test x'$(BOOT_CFLAGS)' != x''; then \
805             BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
806         fi; \
807         $(srcdir)/contrib/test_summary -t -i warning.log >$@
808         chmod +x $@
809         echo If you really want to send e-mail, run ./$@ now
811 # Installation targets.
813 .PHONY: install install-cross uninstall source-vault binary-vault vault-install
814 install: $(INSTALL_TARGET) 
815 install-cross: $(INSTALL_TARGET_CROSS) 
817 uninstall:
818         @echo "the uninstall target is not supported in this tree"
820 source-vault:
821         $(MAKE) -f ./release/Build-A-Release \
822                 host=$(host_alias) source-vault
824 binary-vault:
825         $(MAKE) -f ./release/Build-A-Release \
826                 host=$(host_alias) target=$(target_alias)
828 vault-install:
829         @if [ -f ./release/vault-install ] ; then \
830           ./release/vault-install $(host_alias) $(target_alias) ; \
831         else \
832           true ; \
833         fi
835 .PHONY: install.all
836 install.all: install-no-fixedincludes
837         @if [ -f ./gcc/Makefile ] ; then \
838                 r=`${PWD}` ; export r ; \
839                 $(SET_LIB_PATH) \
840                 (cd ./gcc; \
841                 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
842         else \
843                 true ; \
844         fi
846 # install-no-fixedincludes is used because Cygnus can not distribute
847 # the fixed header files.
848 .PHONY: install-no-fixedincludes
849 install-no-fixedincludes: \
850         installdirs \
851         $(INSTALL_MODULES) \
852         $(INSTALL_TARGET_MODULES) \
853         $(INSTALL_X11_MODULES) \
854         gcc-no-fixedincludes 
856 # Install the gcc headers files, but not the fixed include files,
857 # which Cygnus is not allowed to distribute.  This rule is very
858 # dependent on the workings of the gcc Makefile.in.
859 .PHONY: gcc-no-fixedincludes
860 gcc-no-fixedincludes:
861         @if [ -f ./gcc/Makefile ]; then \
862           rm -rf gcc/tmp-include; \
863           mv gcc/include gcc/tmp-include 2>/dev/null; \
864           mkdir gcc/include; \
865           cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
866           touch gcc/stmp-fixinc gcc/include/fixed; \
867           rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
868           r=`${PWD}`; export r; \
869           s=`cd $(srcdir); ${PWD}` ; export s; \
870           $(SET_LIB_PATH) \
871           (cd ./gcc; \
872            $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
873           rm -rf gcc/include; \
874           mv gcc/tmp-include gcc/include 2>/dev/null; \
875         else true; fi
877 # This rule is used to build the modules which are built with the
878 # build machine's native compiler.
879 .PHONY: $(ALL_BUILD_MODULES)
880 $(ALL_BUILD_MODULES):
881         dir=`echo $@ | sed -e 's/all-build-//'`; \
882         if [ -f ./$${dir}/Makefile ] ; then \
883           r=`${PWD}`; export r; \
884           s=`cd $(srcdir); ${PWD}`; export s; \
885           (cd $(BUILD_SUBDIR)/$${dir} && $(MAKE) all); \
886         else \
887           true; \
888         fi
890 # This rule is used to configure the modules which are built with the
891 # native tools.
892 .PHONY: $(CONFIGURE_BUILD_MODULES)
893 $(CONFIGURE_BUILD_MODULES):
894         @dir=`echo $@ | sed -e 's/configure-build-//'`; \
895         if [ ! -d $(BUILD_SUBDIR) ]; then \
896           true; \
897         elif [ -f $(BUILD_SUBDIR)/$${dir}/Makefile ] ; then \
898           true; \
899         elif echo " $(BUILD_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
900           if [ -d $(srcdir)/$${dir} ]; then \
901             [ -d $(BUILD_SUBDIR)/$${dir} ] || mkdir $(BUILD_SUBDIR)/$${dir};\
902             r=`${PWD}`; export r; \
903             s=`cd $(srcdir); ${PWD}`; export s; \
904             AR="$(AR_FOR_BUILD)"; export AR; \
905             AS="$(AS_FOR_BUILD)"; export AS; \
906             CC="$(CC_FOR_BUILD)"; export CC; \
907             CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
908             CXX="$(CXX_FOR_BUILD)"; export CXX; \
909             CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
910             GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
911             DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
912             LD="$(LD_FOR_BUILD)"; export LD; \
913             LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
914             NM="$(NM_FOR_BUILD)"; export NM; \
915             RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
916             WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
917             echo Configuring in $(BUILD_SUBDIR)/$${dir}; \
918             cd "$(BUILD_SUBDIR)/$${dir}" || exit 1; \
919             case $(srcdir) in \
920             /* | [A-Za-z]:[\\/]*) \
921               topdir=$(srcdir) ;; \
922             *) \
923               case "$(BUILD_SUBDIR)" in \
924               .) topdir="../$(srcdir)" ;; \
925               *) topdir="../../$(srcdir)" ;; \
926               esac ;; \
927             esac; \
928             if [ "$(srcdir)" = "." ] ; then \
929               if [ "$(BUILD_SUBDIR)" != "." ] ; then \
930                 if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
931                   if [ -f Makefile ]; then \
932                     if $(MAKE) distclean; then \
933                       true; \
934                     else \
935                       exit 1; \
936                     fi; \
937                   else \
938                     true; \
939                   fi; \
940                 else \
941                   exit 1; \
942                 fi; \
943               else \
944                 true; \
945               fi; \
946               srcdiroption="--srcdir=."; \
947               libsrcdir="."; \
948             else \
949               srcdiroption="--srcdir=$${topdir}/$${dir}"; \
950               libsrcdir="$$s/$${dir}"; \
951             fi; \
952             if [ -f $${libsrcdir}/configure ] ; then \
953               rm -f no-such-file skip-this-dir; \
954               CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
955                 $(BUILD_CONFIGARGS) $${srcdiroption} \
956                 --with-build-subdir="$(BUILD_SUBDIR)"; \
957             else \
958               rm -f no-such-file skip-this-dir; \
959               CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
960                 $(BUILD_CONFIGARGS) $${srcdiroption} \
961                 --with-build-subdir="$(BUILD_SUBDIR)"; \
962             fi || exit 1; \
963             if [ -f skip-this-dir ] ; then \
964               sh skip-this-dir; \
965               rm -f skip-this-dir; \
966               cd ..; rmdir $${dir} || true; \
967             else \
968               true; \
969             fi; \
970           else \
971             true; \
972           fi; \
973         else \
974           true; \
975         fi
977 # This rule is used to build the modules which use FLAGS_TO_PASS.  To
978 # build a target all-X means to cd to X and make all.
980 # all-gui, and all-libproc are handled specially because
981 # they are still experimental, and if they fail to build, that
982 # shouldn't stop "make all".
983 .PHONY: $(ALL_MODULES) all-gui all-libproc
984 $(ALL_MODULES) all-gui all-libproc:
985         @dir=`echo $@ | sed -e 's/all-//'`; \
986         if [ -f ./$${dir}/Makefile ] ; then \
987           r=`${PWD}`; export r; \
988           s=`cd $(srcdir); ${PWD}`; export s; \
989           $(SET_LIB_PATH) \
990           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
991         else \
992           true; \
993         fi
995 # These rules are used to check the modules which use FLAGS_TO_PASS.
996 # To build a target check-X means to cd to X and make check.  Some
997 # modules are only tested in a native toolchain.
999 .PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
1000 $(NATIVE_CHECK_MODULES):
1001         @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \
1002           dir=`echo $@ | sed -e 's/check-//'`; \
1003           if [ -f ./$${dir}/Makefile ] ; then \
1004             r=`${PWD}`; export r; \
1005             s=`cd $(srcdir); ${PWD}`; export s; \
1006             $(SET_LIB_PATH) \
1007             (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1008           else \
1009             true; \
1010           fi; \
1011         fi
1013 $(CROSS_CHECK_MODULES):
1014         @dir=`echo $@ | sed -e 's/check-//'`; \
1015         if [ -f ./$${dir}/Makefile ] ; then \
1016           r=`${PWD}`; export r; \
1017           s=`cd $(srcdir); ${PWD}`; export s; \
1018           $(SET_LIB_PATH) \
1019           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
1020         else \
1021           true; \
1022         fi
1024 # This rule is used to install the modules which use FLAGS_TO_PASS.
1025 # To build a target install-X means to cd to X and make install.
1026 .PHONY: $(INSTALL_MODULES)
1027 $(INSTALL_MODULES): installdirs
1028         @dir=`echo $@ | sed -e 's/install-//'`; \
1029         if [ -f ./$${dir}/Makefile ] ; then \
1030           r=`${PWD}`; export r; \
1031           s=`cd $(srcdir); ${PWD}`; export s; \
1032           $(SET_LIB_PATH) \
1033           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1034         else \
1035           true; \
1036         fi
1038 # This rule is used to configure the modules which are built with the
1039 # target tools.
1040 .PHONY: $(CONFIGURE_TARGET_MODULES)
1041 $(CONFIGURE_TARGET_MODULES):
1042         @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1043         if [ -d $(TARGET_SUBDIR)/$${dir} ]; then \
1044           r=`${PWD}`; export r; \
1045           $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/$${dir}/tmpmulti.out 2> /dev/null; \
1046           if [ -s $(TARGET_SUBDIR)/$${dir}/tmpmulti.out ]; then \
1047             if [ -f $(TARGET_SUBDIR)/$${dir}/multilib.out ]; then \
1048               if cmp $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out > /dev/null; then \
1049                 rm -f $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
1050               else \
1051                 echo "Multilibs changed for $${dir}, reconfiguring"; \
1052                 rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/Makefile; \
1053                 mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1054               fi; \
1055             else \
1056               mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
1057             fi; \
1058           fi; \
1059         fi; exit 0      # break command into two pieces
1060         @dir=`echo $@ | sed -e 's/configure-target-//'`; \
1061         if [ ! -d $(TARGET_SUBDIR) ]; then \
1062           true; \
1063         elif [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1064           true; \
1065         elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
1066           if [ -d $(srcdir)/$${dir} ]; then \
1067             [ -d $(TARGET_SUBDIR)/$${dir} ] || mkdir $(TARGET_SUBDIR)/$${dir};\
1068             r=`${PWD}`; export r; \
1069             s=`cd $(srcdir); ${PWD}`; export s; \
1070             $(SET_LIB_PATH) \
1071             AR="$(AR_FOR_TARGET)"; export AR; \
1072             AS="$(AS_FOR_TARGET)"; export AS; \
1073             CC="$(CC_FOR_TARGET)"; export CC; \
1074             CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
1075             CXX="$(CXX_FOR_TARGET)"; export CXX; \
1076             CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
1077             GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
1078             DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
1079             LD="$(LD_FOR_TARGET)"; export LD; \
1080             LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
1081             NM="$(NM_FOR_TARGET)"; export NM; \
1082             RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
1083             WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
1084             echo Configuring in $(TARGET_SUBDIR)/$${dir}; \
1085             cd "$(TARGET_SUBDIR)/$${dir}" || exit 1; \
1086             case $(srcdir) in \
1087             /* | [A-Za-z]:[\\/]*) \
1088               topdir=$(srcdir) ;; \
1089             *) \
1090               case "$(TARGET_SUBDIR)" in \
1091               .) topdir="../$(srcdir)" ;; \
1092               *) topdir="../../$(srcdir)" ;; \
1093               esac ;; \
1094             esac; \
1095             if [ "$(srcdir)" = "." ] ; then \
1096               if [ "$(TARGET_SUBDIR)" != "." ] ; then \
1097                 if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
1098                   if [ -f Makefile ]; then \
1099                     if $(MAKE) distclean; then \
1100                       true; \
1101                     else \
1102                       exit 1; \
1103                     fi; \
1104                   else \
1105                     true; \
1106                   fi; \
1107                 else \
1108                   exit 1; \
1109                 fi; \
1110               else \
1111                 true; \
1112               fi; \
1113               srcdiroption="--srcdir=."; \
1114               libsrcdir="."; \
1115             else \
1116               srcdiroption="--srcdir=$${topdir}/$${dir}"; \
1117               libsrcdir="$$s/$${dir}"; \
1118             fi; \
1119             if [ -f $${libsrcdir}/configure ] ; then \
1120               rm -f no-such-file skip-this-dir; \
1121               CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
1122                 $(TARGET_CONFIGARGS) $${srcdiroption} \
1123                 --with-target-subdir="$(TARGET_SUBDIR)"; \
1124             else \
1125               rm -f no-such-file skip-this-dir; \
1126               CONFIG_SITE=no-such-file $(SHELL) $$s/configure \
1127                 $(TARGET_CONFIGARGS) $${srcdiroption} \
1128                 --with-target-subdir="$(TARGET_SUBDIR)"; \
1129             fi || exit 1; \
1130             if [ -f skip-this-dir ] ; then \
1131               sh skip-this-dir; \
1132               rm -f skip-this-dir; \
1133               cd ..; rmdir $${dir} || true; \
1134             else \
1135               true; \
1136             fi; \
1137           else \
1138             true; \
1139           fi; \
1140         else \
1141           true; \
1142         fi
1144 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
1145 # To build a target all-X means to cd to X and make all.
1146 .PHONY: $(ALL_TARGET_MODULES)
1147 $(ALL_TARGET_MODULES):
1148         @dir=`echo $@ | sed -e 's/all-target-//'`; \
1149         if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1150           r=`${PWD}`; export r; \
1151           s=`cd $(srcdir); ${PWD}`; export s; \
1152           $(SET_LIB_PATH) \
1153           (cd $(TARGET_SUBDIR)/$${dir}; \
1154             $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
1155         else \
1156           true; \
1157         fi
1159 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
1160 # To build a target install-X means to cd to X and make install.
1161 .PHONY: $(CHECK_TARGET_MODULES)
1162 $(CHECK_TARGET_MODULES):
1163         @dir=`echo $@ | sed -e 's/check-target-//'`; \
1164         if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1165           r=`${PWD}`; export r; \
1166           s=`cd $(srcdir); ${PWD}`; export s; \
1167           $(SET_LIB_PATH) \
1168           (cd $(TARGET_SUBDIR)/$${dir}; \
1169             $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
1170         else \
1171           true; \
1172         fi
1174 # This rule is used to install the modules which use
1175 # TARGET_FLAGS_TO_PASS.  To build a target install-X means to cd to X
1176 # and make install.
1177 .PHONY: $(INSTALL_TARGET_MODULES)
1178 $(INSTALL_TARGET_MODULES): installdirs
1179         @dir=`echo $@ | sed -e 's/install-target-//'`; \
1180         if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1181           r=`${PWD}`; export r; \
1182           s=`cd $(srcdir); ${PWD}`; export s; \
1183           $(SET_LIB_PATH) \
1184           (cd $(TARGET_SUBDIR)/$${dir}; \
1185             $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
1186         else \
1187           true; \
1188         fi
1190 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
1191 # To build a target all-X means to cd to X and make all.
1192 .PHONY: $(ALL_X11_MODULES)
1193 $(ALL_X11_MODULES):
1194         @dir=`echo $@ | sed -e 's/all-//'`; \
1195         if [ -f ./$${dir}/Makefile ] ; then \
1196           r=`${PWD}`; export r; \
1197           s=`cd $(srcdir); ${PWD}`; export s; \
1198           $(SET_LIB_PATH) \
1199           (cd $${dir}; \
1200            $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
1201         else \
1202           true; \
1203         fi
1205 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
1206 # To build a target check-X means to cd to X and make all.
1207 .PHONY: $(CHECK_X11_MODULES)
1208 $(CHECK_X11_MODULES):
1209         @dir=`echo $@ | sed -e 's/check-//'`; \
1210         if [ -f ./$${dir}/Makefile ] ; then \
1211           r=`${PWD}`; export r; \
1212           s=`cd $(srcdir); ${PWD}`; export s; \
1213           $(SET_LIB_PATH) \
1214           (cd $${dir}; \
1215            $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
1216         else \
1217           true; \
1218         fi
1220 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
1221 # To build a target install-X means to cd to X and make install.
1222 .PHONY: $(INSTALL_X11_MODULES)
1223 $(INSTALL_X11_MODULES): installdirs
1224         @dir=`echo $@ | sed -e 's/install-//'`; \
1225         if [ -f ./$${dir}/Makefile ] ; then \
1226           r=`${PWD}`; export r; \
1227           s=`cd $(srcdir); ${PWD}`; export s; \
1228           $(SET_LIB_PATH) \
1229           (cd $${dir}; \
1230            $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
1231         else \
1232           true; \
1233         fi
1235 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
1236 .PHONY: all-gcc
1237 all-gcc:
1238         @if [ -f ./gcc/Makefile ] ; then \
1239           r=`${PWD}`; export r; \
1240           s=`cd $(srcdir); ${PWD}`; export s; \
1241           $(SET_LIB_PATH) \
1242           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
1243         else \
1244           true; \
1245         fi
1247 # Building GCC uses some tools for rebuilding "source" files
1248 # like texinfo, bison/byacc, etc.  So we must depend on those.
1250 # While building GCC, it may be necessary to run various target
1251 # programs like the assembler, linker, etc.  So we depend on
1252 # those too.
1254 # In theory, on an SMP all those dependencies can be resolved
1255 # in parallel.
1257 .PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean
1258 bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean: all-bootstrap
1259         @r=`${PWD}`; export r; \
1260         s=`cd $(srcdir); ${PWD}`; export s; \
1261         $(SET_LIB_PATH) \
1262         echo "Bootstrapping the compiler"; \
1263         cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@
1264         @r=`${PWD}`; export r; \
1265         s=`cd $(srcdir); ${PWD}`; export s; \
1266         case "$@" in \
1267           *bootstrap4-lean ) \
1268                         msg="Comparing stage3 and stage4 of the compiler"; \
1269                         compare=compare3-lean ;; \
1270           *bootstrap4 ) msg="Comparing stage3 and stage4 of the compiler"; \
1271                         compare=compare3 ;; \
1272           *-lean )      msg="Comparing stage2 and stage3 of the compiler"; \
1273                         compare=compare-lean ;; \
1274           * )           msg="Comparing stage2 and stage3 of the compiler"; \
1275                         compare=compare ;; \
1276         esac; \
1277         $(SET_LIB_PATH) \
1278         echo "$$msg"; \
1279         cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
1280         @r=`${PWD}`; export r; \
1281         s=`cd $(srcdir); ${PWD}` ; export s; \
1282         $(SET_LIB_PATH) \
1283         echo "Building runtime libraries"; \
1284         $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
1286 .PHONY: cross
1287 cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
1288         @r=`${PWD}`; export r; \
1289         s=`cd $(srcdir); ${PWD}`; export s; \
1290         $(SET_LIB_PATH) \
1291         echo "Building the C and C++ compiler"; \
1292         cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
1293         @r=`${PWD}`; export r; \
1294         s=`cd $(srcdir); ${PWD}` ; export s; \
1295         $(SET_LIB_PATH) \
1296         echo "Building runtime libraries"; \
1297         $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \
1298           LANGUAGES="c c++" all
1300 .PHONY: check-gcc
1301 check-gcc:
1302         @if [ -f ./gcc/Makefile ] ; then \
1303           r=`${PWD}`; export r; \
1304           s=`cd $(srcdir); ${PWD}`; export s; \
1305           $(SET_LIB_PATH) \
1306           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
1307         else \
1308           true; \
1309         fi
1311 .PHONY: check-c++
1312 check-c++:
1313         @if [ -f ./gcc/Makefile ] ; then \
1314           r=`${PWD}`; export r; \
1315           s=`cd $(srcdir); ${PWD}`; export s; \
1316           $(SET_LIB_PATH) \
1317           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \
1318           $(MAKE) check-target-libstdc++-v3; \
1319         else \
1320           true; \
1321         fi 
1323 .PHONY: install-gcc
1324 install-gcc:
1325         @if [ -f ./gcc/Makefile ] ; then \
1326           r=`${PWD}`; export r; \
1327           s=`cd $(srcdir); ${PWD}`; export s; \
1328           $(SET_LIB_PATH) \
1329           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1330         else \
1331           true; \
1332         fi
1334 .PHONY: install-gcc-cross
1335 install-gcc-cross:
1336         @if [ -f ./gcc/Makefile ] ; then \
1337           r=`${PWD}`; export r; \
1338           s=`cd $(srcdir); ${PWD}`; export s; \
1339           $(SET_LIB_PATH) \
1340           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" install); \
1341         else \
1342           true; \
1343         fi
1344 # EXPERIMENTAL STUFF
1345 # This rule is used to install the modules which use FLAGS_TO_PASS.
1346 # To build a target install-X means to cd to X and make install.
1347 .PHONY: install-dosrel
1348 install-dosrel: installdirs info
1349         @dir=`echo $@ | sed -e 's/install-//'`; \
1350         if [ -f ./$${dir}/Makefile ] ; then \
1351           r=`${PWD}`; export r; \
1352           s=`cd $(srcdir); ${PWD}`; export s; \
1353           $(SET_LIB_PATH) \
1354           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1355         else \
1356           true; \
1357         fi
1359 install-dosrel-fake:
1361 ALL_GCC = all-gcc
1362 ALL_GCC_C = $(ALL_GCC) all-target-newlib all-target-libgloss
1363 ALL_GCC_CXX = $(ALL_GCC_C) all-target-libstdc++-v3
1365 # This is a list of inter-dependencies among modules.
1366 all-ash:
1367 all-autoconf: all-m4 all-texinfo
1368 all-automake: all-m4 all-texinfo
1369 all-bash:
1370 all-bfd: all-libiberty all-intl
1371 all-binutils: all-libiberty all-opcodes all-bfd all-flex all-bison all-byacc all-intl
1372 all-bison: all-texinfo
1373 configure-target-boehm-gc: $(ALL_GCC_C) configure-target-qthreads
1374 all-byacc:
1375 all-bzip2:
1376 all-db:
1377 all-dejagnu: all-tcl all-expect all-tk
1378 all-diff: all-libiberty
1379 all-etc:
1380 configure-target-examples: $(ALL_GCC_C)
1381 all-expect: all-tcl all-tk
1382 all-fileutils: all-libiberty
1383 all-findutils:
1384 all-find:
1385 all-flex: all-libiberty all-bison all-byacc
1386 all-gas: all-libiberty all-opcodes all-bfd all-intl
1387 all-gawk:
1388 all-gcc: all-bison all-byacc all-binutils all-gas all-ld all-zlib
1389 all-bootstrap: all-libiberty all-texinfo all-bison all-byacc all-binutils all-gas all-ld all-zlib
1390 GDB_TK = @GDB_TK@
1391 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-bison all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
1392 all-gettext:
1393 all-gnuserv:
1394 configure-target-gperf: $(ALL_GCC_CXX)
1395 all-target-gperf: all-target-libiberty all-target-libstdc++-v3
1396 all-gprof: all-libiberty all-bfd all-opcodes all-intl
1397 all-grep: all-libiberty
1398 all-gui: all-gdb all-libproc
1399 all-guile:
1400 all-gzip: all-libiberty
1401 all-hello: all-libiberty
1402 all-indent:
1403 all-intl:
1404 all-itcl: all-tcl all-tk
1405 all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex all-intl
1406 configure-target-libgloss: $(ALL_GCC)
1407 all-target-libgloss: configure-target-newlib
1408 all-libgui: all-tcl all-tk all-itcl
1409 all-libiberty:
1411 all-build-libiberty: configure-build-libiberty
1413 configure-target-libffi: $(ALL_GCC_C) 
1414 configure-target-libjava: $(ALL_GCC_C) configure-target-zlib configure-target-boehm-gc configure-target-qthreads configure-target-libffi
1415 all-target-libjava: all-fastjar all-target-zlib all-target-boehm-gc all-target-qthreads all-target-libffi
1416 configure-target-libstdc++-v3: $(ALL_GCC_C)
1417 all-target-libstdc++-v3: all-target-libiberty
1418 all-libtool:
1419 configure-target-libf2c: $(ALL_GCC_C)
1420 all-target-libf2c: all-target-libiberty
1421 configure-target-libobjc: $(ALL_GCC_C)
1422 all-target-libobjc: all-target-libiberty
1423 all-m4: all-libiberty all-texinfo
1424 all-make: all-libiberty
1425 all-mmalloc:
1426 configure-target-newlib: $(ALL_GCC)
1427 configure-target-libtermcap: $(ALL_GCC_C)
1428 all-opcodes: all-bfd all-libiberty
1429 all-patch: all-libiberty
1430 all-perl:
1431 all-prms: all-libiberty
1432 configure-target-qthreads: $(ALL_GCC_C)
1433 all-rcs:
1434 all-readline:
1435 all-recode: all-libiberty
1436 all-sed: all-libiberty
1437 all-send-pr: all-prms
1438 all-shellutils:
1439 all-sid: all-tcl all-tk
1440 all-sim: all-libiberty all-bfd all-opcodes all-readline
1441 all-snavigator: all-tcl all-tk all-itcl all-tix all-db all-grep all-libgui
1442 all-tar: all-libiberty
1443 all-tcl:
1444 all-tclX: all-tcl all-tk
1445 all-tk: all-tcl
1446 all-texinfo: all-libiberty
1447 all-textutils:
1448 all-time:
1449 all-tix: all-tcl all-tk
1450 all-wdiff:
1451 configure-target-winsup: $(ALL_GCC_C)
1452 all-target-winsup: all-target-libiberty all-target-libtermcap
1453 all-uudecode: all-libiberty
1454 all-zip:
1455 all-zlib:
1456 configure-target-zlib: $(ALL_GCC_C)
1457 all-fastjar: all-zlib all-libiberty
1458 configure-target-fastjar: configure-target-zlib
1459 all-target-fastjar: configure-target-fastjar all-target-zlib all-target-libiberty
1460 configure-target-libiberty: $(ALL_GCC_C)
1461 all-target: $(ALL_TARGET_MODULES)
1462 install-target: $(INSTALL_TARGET_MODULES)
1463 install-gdb: install-tcl install-tk install-itcl install-tix install-libgui
1464 install-sid: install-tcl install-tk
1466 # Dependencies of all-target-foo on configure-target-foo.
1467 [+ FOR target_modules +]all-target-[+module+]: configure-target-[+module+]
1468 [+ ENDFOR target_modules +]
1470 ### other supporting targets
1472 MAKEDIRS= \
1473         $(DESTDIR)$(prefix) \
1474         $(DESTDIR)$(exec_prefix)
1475 .PHONY: installdirs
1476 installdirs: mkinstalldirs
1477         $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
1479 dir.info: do-install-info
1480         if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
1481           $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
1482           mv -f dir.info.new dir.info ; \
1483         else true ; \
1484         fi
1486 dist:
1487         @echo "Building a full distribution of this tree isn't done"
1488         @echo "via 'make dist'.  Check out the etc/ subdirectory" 
1490 etags tags: TAGS
1492 # Right now this just builds TAGS in each subdirectory.  emacs19 has the
1493 # ability to use several tags files at once, so there is probably no need
1494 # to combine them into one big TAGS file (like CVS 1.3 does).  We could
1495 # (if we felt like it) have this Makefile write a piece of elisp which
1496 # the user could load to tell emacs19 where all the TAGS files we just
1497 # built are.
1498 TAGS: do-TAGS
1500 # Rebuilding Makefile.in, using autogen.
1501 $(srcdir)/Makefile.in: # $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def
1502         cd $(srcdir) && autogen Makefile.def
1504 # with the gnu make, this is done automatically.
1506 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag) $(gcc_version_trigger)
1507         $(SHELL) ./config.status
1510 # Support for building net releases
1512 # Files in devo used in any net release.
1513 # ChangeLog omitted because it may refer to files which are not in this
1514 # distribution (perhaps it would be better to include it anyway).
1515 DEVO_SUPPORT= README Makefile.in configure configure.in \
1516         config.guess config.if config.sub config move-if-change \
1517         mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \
1518         COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
1519         mkinstalldirs ltconfig ltmain.sh missing ylwrap \
1520         libtool.m4 gettext.m4 ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh
1522 # Files in devo/etc used in any net release.
1523 # ChangeLog omitted because it may refer to files which are not in this
1524 # distribution (perhaps it would be better to include it anyway).
1525 ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
1526         make-stds.texi standards.info* configure.texi configure.info* \
1527         configbuild.* configdev.*
1530 # When you use `make setup-dirs' or `make taz' you should always redefine
1531 # this macro.
1532 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1534 # NOTE: No double quotes in the below.  It is used within shell script
1535 # as VER="$(VER)"
1536 VER = ` if grep 'AM_INIT_AUTOMAKE.*BFD_VERSION' $(TOOL)/configure.in >/dev/null 2>&1; then \
1537           sed < bfd/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
1538         elif grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
1539           sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
1540         elif test -f $(TOOL)/version.in; then \
1541           head -1 $(TOOL)/version.in; \
1542         elif grep VERSION $(TOOL)/Makefile.in > /dev/null 2>&1; then \
1543           sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \
1544         else \
1545           echo VERSION; \
1546         fi`
1547 PACKAGE = $(TOOL)
1549 .PHONY: taz
1550 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1551         $(MAKE) -f Makefile.in do-proto-toplev \
1552                 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1553                 MD5PROG="$(MD5PROG)" \
1554                 SUPPORT_FILES="$(SUPPORT_FILES)"
1555         $(MAKE) -f Makefile.in do-md5sum \
1556                 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1557                 MD5PROG="$(MD5PROG)" \
1558                 SUPPORT_FILES="$(SUPPORT_FILES)"
1559         $(MAKE) -f Makefile.in do-tar \
1560                 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1561                 MD5PROG="$(MD5PROG)" \
1562                 SUPPORT_FILES="$(SUPPORT_FILES)"
1563         $(MAKE) -f Makefile.in do-bz2 \
1564                 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1565                 MD5PROG="$(MD5PROG)" \
1566                 SUPPORT_FILES="$(SUPPORT_FILES)"
1568 .PHONY: gdb-tar
1569 gdb-tar: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1570         $(MAKE) -f Makefile.in do-proto-toplev \
1571                 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1572                 MD5PROG="$(MD5PROG)" \
1573                 SUPPORT_FILES="$(SUPPORT_FILES)"
1574         $(MAKE) -f Makefile.in do-md5sum \
1575                 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1576                 MD5PROG="$(MD5PROG)" \
1577                 SUPPORT_FILES="$(SUPPORT_FILES)"
1578         $(MAKE) -f Makefile.in do-djunpack \
1579                 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1580                 MD5PROG="$(MD5PROG)" \
1581                 SUPPORT_FILES="$(SUPPORT_FILES)"
1582         $(MAKE) -f Makefile.in do-tar \
1583                 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1584                 MD5PROG="$(MD5PROG)" \
1585                 SUPPORT_FILES="$(SUPPORT_FILES)"
1587 .PHONY: gdb-taz
1588 gdb-taz: gdb-tar $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1589         $(MAKE) -f Makefile.in gdb-tar \
1590                 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1591                 MD5PROG="$(MD5PROG)" \
1592                 SUPPORT_FILES="$(SUPPORT_FILES)"
1593         $(MAKE) -f Makefile.in do-bz2 \
1594                 TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
1595                 MD5PROG="$(MD5PROG)" \
1596                 SUPPORT_FILES="$(SUPPORT_FILES)"
1598 .PHONY: do-proto-toplev
1599 do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
1600         echo "==> Making $(PACKAGE)-$(VER)/"
1601         # Take out texinfo from a few places.
1602         sed -e '/^all\.normal: /s/\all-texinfo //' \
1603             -e '/^      install-texinfo /d' \
1604         <Makefile.in >tmp
1605         mv -f tmp Makefile.in
1606         #
1607         ./configure sun4
1608         [ -z "$(CONFIGURE_TARGET_MODULES)" ] \
1609           || $(MAKE) $(CONFIGURE_TARGET_MODULES) \
1610             ALL_GCC="" ALL_GCC_C="" ALL_GCC_CXX="" \
1611             CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
1612         # Make links, and run "make diststuff" or "make info" when needed.
1613         rm -rf proto-toplev ; mkdir proto-toplev
1614         set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1615         for d in $$dirs ; do \
1616           if [ -d $$d ]; then \
1617             if [ ! -f $$d/Makefile ] ; then true ; \
1618             elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
1619                 (cd $$d ; $(MAKE) diststuff ) || exit 1 ; \
1620             elif grep '^info:' $$d/Makefile >/dev/null ; then \
1621                 (cd $$d ; $(MAKE) info ) || exit 1 ; \
1622             fi ; \
1623             if [ -d $$d/proto-$$d.dir ]; then \
1624               ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1625             else \
1626               ln -s ../$$d proto-toplev/$$d ; \
1627             fi ; \
1628           else ln -s ../$$d proto-toplev/$$d ; fi ; \
1629         done
1630         cd etc && $(MAKE) info
1631         $(MAKE) distclean
1632         #
1633         mkdir proto-toplev/etc
1634         (cd proto-toplev/etc; \
1635          for i in $(ETC_SUPPORT); do \
1636                 ln -s ../../etc/$$i . ; \
1637          done)
1638         #
1639         # Take out texinfo from configurable dirs
1640         rm proto-toplev/configure.in
1641         sed -e '/^host_tools=/s/texinfo //' \
1642             <configure.in >proto-toplev/configure.in
1643         #
1644         mkdir proto-toplev/texinfo
1645         ln -s ../../texinfo/texinfo.tex         proto-toplev/texinfo/
1646         if test -r texinfo/util/tex3patch ; then \
1647           mkdir proto-toplev/texinfo/util && \
1648           ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
1649         else true; fi
1650         chmod -R og=u . || chmod og=u `find . -print`
1651         #
1652         # Create .gmo files from .po files.
1653         for f in `find . -name '*.po' -type f -print`; do \
1654              msgfmt -o `echo $$f | sed -e 's/\.po$$/.gmo/'` $$f ; \
1655         done
1656         #
1657         -rm -f $(PACKAGE)-$(VER)
1658         ln -s proto-toplev $(PACKAGE)-$(VER)
1660 .PHONY: do-tar
1661 do-tar:
1662         echo "==> Making $(PACKAGE)-$(VER).tar"
1663         -rm -f $(PACKAGE)-$(VER).tar
1664         find $(PACKAGE)-$(VER) -follow -name CVS -prune -o -type f -print \
1665                 | tar cTfh - $(PACKAGE)-$(VER).tar
1667 .PHONY: do-bz2
1668 do-bz2:
1669         echo "==> Bzipping $(PACKAGE)-$(VER).tar.bz2"
1670         -rm -f $(PACKAGE)-$(VER).tar.bz2
1671         $(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar
1673 .PHONY: do-md5sum
1674 do-md5sum:
1675         echo "==> Adding md5 checksum to top-level directory"
1676         cd proto-toplev && find * -follow -name CVS -prune -o -type f -print \
1677                 | xargs $(MD5PROG) > ../md5.sum
1678         mv md5.sum proto-toplev
1680 .PHONY: do-djunpack
1681 do-djunpack:
1682         echo "==> Adding updated djunpack.bat to top-level directory"
1683         echo - 's /gdb-[0-9\.]*/gdb-'"$(VER)"'/'
1684         sed < djunpack.bat > djunpack.new \
1685                 -e 's/gdb-[0-9][0-9\.]*/gdb-'"$(VER)"'/'
1686         mv djunpack.new djunpack.bat
1687         -rm -f proto-toplev/djunpack.bat
1688         ln -s ../djunpack.bat proto-toplev/djunpack.bat
1690 TEXINFO_SUPPORT= texinfo/texinfo.tex
1691 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1693 .PHONY: gas.tar.bz2
1694 GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep
1695 gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1696         $(MAKE) -f Makefile.in taz TOOL=gas \
1697                 MD5PROG="$(MD5PROG)" \
1698                 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1700 # The FSF "binutils" release includes gprof and ld.
1701 .PHONY: binutils.tar.bz2
1702 BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms mkdep
1703 binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1704         $(MAKE) -f Makefile.in taz TOOL=binutils \
1705                 MD5PROG="$(MD5PROG)" \
1706                 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
1708 .PHONY: gas+binutils.tar.bz2
1709 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1710 gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1711         $(MAKE) -f Makefile.in taz TOOL=gas \
1712                 MD5PROG="$(MD5PROG)" \
1713                 SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
1715 GNATS_SUPPORT_DIRS=include libiberty send-pr
1716 gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
1717         $(MAKE) -f  Makefile.in taz TOOL=gnats \
1718                 MD5PROG="$(MD5PROG)" \
1719                 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1721 .PHONY: gdb.tar.bz2
1722 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils intl
1723 gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1724         $(MAKE) -f Makefile.in gdb-taz TOOL=gdb \
1725                 MD5PROG="$(MD5PROG)" \
1726                 SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
1727 .PHONY: gdb.tar
1728 gdb.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1729         $(MAKE) -f Makefile.in gdb-tar TOOL=gdb \
1730                 MD5PROG="$(MD5PROG)" \
1731                 SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
1733 DEJAGNU_SUPPORT_DIRS=  tcl expect libiberty
1734 .PHONY: dejagnu.tar.bz2
1735 dejagnu.tar.bz2: $(DIST_SUPPORT) $(DEJAGNU_SUPPORT_DIRS) dejagnu
1736         $(MAKE) -f Makefile.in taz TOOL=dejagnu \
1737                 MD5PROG="$(MD5PROG)" \
1738                 SUPPORT_FILES="$(DEJAGNU_SUPPORT_DIRS)"
1740 .PHONY: gdb+dejagnu.tar.bz2
1741 GDBD_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl expect dejagnu
1742 gdb+dejagnu.tar.bz2: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb
1743         $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE=gdb+dejagnu \
1744                 MD5PROG="$(MD5PROG)" \
1745                 SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"
1746 .PHONY: gdb+dejagnu.tar
1747 gdb+dejagnu.tar: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb
1748         $(MAKE) -f Makefile.in gdb-tar TOOL=gdb PACKAGE=gdb+dejagnu \
1749                 MD5PROG="$(MD5PROG)" \
1750                 SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"
1752 .PHONY: insight.tar.bz2
1753 INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl tix libgui
1754 insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1755         $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE=insight \
1756                 MD5PROG="$(MD5PROG)" \
1757                 SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
1758 .PHONY: insight.tar
1759 insight.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1760         $(MAKE) -f Makefile.in gdb-tar TOOL=gdb PACKAGE=insight \
1761                 MD5PROG="$(MD5PROG)" \
1762                 SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
1764 .PHONY: insight+dejagnu.tar.bz2
1765 INSIGHTD_SUPPORT_DIRS= $(INSIGHT_SUPPORT_DIRS) expect dejagnu
1766 insight+dejagnu.tar.bz2: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
1767         $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE="insight+dejagnu" \
1768                 MD5PROG="$(MD5PROG)" \
1769                 SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"
1770 .PHONY: insight+dejagnu.tar
1771 insight+dejagnu.tar: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
1772         $(MAKE) -f Makefile.in gdb-tar TOOL=gdb PACKAGE="insight+dejagnu" \
1773                 MD5PROG="$(MD5PROG)" \
1774                 SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"
1776 .PHONY: newlib.tar.bz2
1777 NEWLIB_SUPPORT_DIRS=libgloss
1778 # taz configures for the sun4 target which won't configure newlib.
1779 # We need newlib configured so that the .info files are made.
1780 # Unfortunately, it is not enough to just configure newlib separately:
1781 # taz will build the .info files but since SUBDIRS won't contain newlib,
1782 # distclean won't be run (leaving Makefile, config.status, and the tmp files
1783 # used in building the .info files, eg: *.def, *.ref).
1784 # The problem isn't solvable however without a lot of extra work because
1785 # target libraries are built in subdir $(target_alias) which gets nuked during
1786 # the make distclean.  For now punt on the issue of shipping newlib info files
1787 # with newlib net releases and wait for a day when some native target (sun4?)
1788 # supports newlib (if only minimally).
1789 newlib.tar.bz2: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
1790         $(MAKE) -f Makefile.in taz TOOL=newlib \
1791                 MD5PROG="$(MD5PROG)" \
1792                 SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
1793                 DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
1795 .NOEXPORT:
1796 MAKEOVERRIDES=
1798 # end of Makefile.in