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