* Makefile.in (FLAGS_TO_PASS): Add $(HOST_FLAGS) to allow the
[external/binutils.git] / Makefile.in
1 #
2 # Makefile for directory with subdirs to build.
3 #   Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation
4 #
5 # This file is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 #
19
20 srcdir = .
21
22 prefix = /usr/local
23
24 exec_prefix = $(prefix)
25 bindir = $(exec_prefix)/bin
26 libdir = $(exec_prefix)/lib
27 tooldir = $(exec_prefix)/$(target)
28
29 program_transform_name =
30
31 datadir = $(prefix)/share
32 mandir = $(prefix)/man
33 man1dir = $(mandir)/man1
34 man2dir = $(mandir)/man2
35 man3dir = $(mandir)/man3
36 man4dir = $(mandir)/man4
37 man5dir = $(mandir)/man5
38 man6dir = $(mandir)/man6
39 man7dir = $(mandir)/man7
40 man8dir = $(mandir)/man8
41 man9dir = $(mandir)/man9
42 infodir = $(prefix)/info
43 includedir = $(prefix)/include
44 GDB_NLM_DEPS = 
45
46 SHELL = /bin/sh
47
48 INSTALL = $$s/install.sh -c
49 INSTALL_PROGRAM = $(INSTALL)
50 INSTALL_DATA = $(INSTALL) -m 644
51 INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
52
53 INSTALL_DOSREL = install-dosrel-fake
54
55 AS = as
56 AR = ar
57 AR_FLAGS = rc
58 CC = cc
59
60 # Special variables passed down in EXTRA_GCC_FLAGS.  They are defined
61 # here so that they can be overridden by Makefile fragments.
62 HOST_CC = $(CC_FOR_BUILD)
63 HOST_PREFIX = 
64 HOST_PREFIX_1 = loser-
65
66 # We don't specify -g -O because many compilers don't support -g -O,
67 # and/or -O is broken in and of itself.
68 CFLAGS = -g
69 LIBCFLAGS = $(CFLAGS)
70 CFLAGS_FOR_TARGET = $(CFLAGS)
71 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
72 PICFLAG = 
73 PICFLAG_FOR_TARGET = 
74
75 # start-sanitize-chill
76 CHILLFLAGS = $(CFLAGS)
77 CHILL_LIB = -lchill
78 # end-sanitize-chill
79 CXX = gcc
80
81 # Use -O2 to stress test the compiler.
82 CXXFLAGS = -g -O2
83 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
84 CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
85 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
86
87 RANLIB = ranlib
88
89 DLLTOOL = dlltool
90
91 NM = nm
92 # Not plain GZIP, since gzip looks there for extra command-line options.
93 GZIPPROG = gzip
94
95 # These values are substituted by configure.
96 DEFAULT_YACC = yacc
97 DEFAULT_LEX = lex
98
99 # BISON: This line sed'ed to BISON = bison -y for FSF releases, don't remove.
100 BISON = `if [ -f $$r/byacc/byacc ] ; \
101             then echo $$r/byacc/byacc ; \
102             else echo ${DEFAULT_YACC} ; \
103         fi`
104
105 LEX = `if [ -f $$r/flex/flex ] ; \
106         then echo $$r/flex/flex ; \
107         else echo ${DEFAULT_LEX} ; fi`
108
109 M4 = `if [ -f $$r/m4/m4 ] ; \
110         then echo $$r/m4/m4 ; \
111         else echo m4 ; fi`
112
113 MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
114         then echo $$r/texinfo/makeinfo/makeinfo ; \
115         else echo makeinfo ; fi`
116
117 # This just becomes part of the MAKEINFO definition passed down to
118 # sub-makes.  It lets flags be given on the command line while still
119 # using the makeinfo from the object tree.
120 MAKEINFOFLAGS =
121
122 EXPECT = `if [ -f $$r/expect/expect ] ; \
123         then echo $$r/expect/expect ; \
124         else echo expect ; fi`
125
126 RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \
127         then echo $$s/dejagnu/runtest ; \
128         else echo runtest ; fi`
129
130
131 # compilers to use to create programs which must be run in the build
132 # environment.
133 CC_FOR_BUILD = $(CC)
134 CXX_FOR_BUILD = $(CXX)
135
136 SUBDIRS = "this is set via configure, don't edit this"
137 OTHERS = 
138
139 # This is set by the configure script to the list of directories which
140 # should be built using the target tools.
141 TARGET_CONFIGDIRS = libiberty libgloss newlib libio librx libstdc++ libg++ winsup
142
143 # Target libraries are put under this directory:
144 # Changed by configure to $(target_alias) if cross.
145 TARGET_SUBDIR = .
146
147 # This is set by the configure script to the arguments passed to configure.
148 CONFIG_ARGUMENTS = 
149
150 # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
151 # was used.
152 SET_LIB_PATH =
153
154 # This is the name of the environment variable used for the path to
155 # the libraries.  This may be changed by configure.in.
156 RPATH_ENVVAR = LD_LIBRARY_PATH
157
158 # configure.in sets SET_LIB_PATH to this if --enable-shared was used.
159 REALLY_SET_LIB_PATH = \
160   $(RPATH_ENVVAR)=$$r/bfd:$$r/opcodes:$$$(RPATH_ENVVAR); \
161   export $(RPATH_ENVVAR);
162
163 ALL = all.normal
164 INSTALL_TARGET = install-dirs \
165         $(INSTALL_MODULES) \
166         $(INSTALL_TARGET_MODULES) \
167         $(INSTALL_X11_MODULES) \
168         install-gcc \
169         $(INSTALL_DOSREL)
170
171
172 CC_FOR_TARGET = ` \
173   if [ -f $$r/gcc/xgcc ] ; then \
174     if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
175       if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \
176         echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/newlib/ -L$$r/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
177       else \
178         echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
179       fi; \
180     else \
181       echo $$r/gcc/xgcc -B$$r/gcc/; \
182     fi; \
183   else \
184     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
185       echo $(CC); \
186     else \
187       t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
188     fi; \
189   fi`
190
191 # If CC_FOR_TARGET is not overriden on the command line, then this
192 # variable is passed down to the gcc Makefile, where it is used to
193 # build libgcc2.a.  We define it here so that it can itself be
194 # overridden on the command line.
195 GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/
196
197 # start-sanitize-chill
198 CHILL_FOR_TARGET = ` \
199   if [ -f $$r/gcc/xgcc ] ; then \
200     echo $$r/gcc/xgcc -B$$r/gcc/ -L$$r/gcc/ch/runtime/; \
201   else \
202     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
203       echo $(CC); \
204     else \
205       t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
206     fi; \
207   fi`
208
209 # end-sanitize-chill
210
211 CXX_FOR_TARGET = ` \
212   if [ -f $$r/gcc/xgcc ] ; then \
213     if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
214       if [ -f $$r/$(TARGET_SUBDIR)/winsup/Makefile ] ; then \
215         echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/newlib/ -L$$r/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
216       else \
217         echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \
218       fi; \
219     else \
220       echo $$r/gcc/xgcc -B$$r/gcc/; \
221     fi; \
222   else \
223     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
224       echo $(CXX); \
225     else \
226       t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
227     fi; \
228   fi`
229
230 AS_FOR_TARGET = ` \
231   if [ -f $$r/gas/as.new ] ; then \
232     echo $$r/gas/as.new ; \
233   else \
234     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
235       echo $(AS); \
236     else \
237        t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \
238     fi; \
239   fi`
240
241 LD_FOR_TARGET = ` \
242   if [ -f $$r/ld/ld.new ] ; then \
243     echo $$r/ld/ld.new ; \
244   else \
245     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
246       echo $(LD); \
247     else \
248        t='$(program_transform_name)'; echo ld | sed -e 's/x/x/' $$t ; \
249     fi; \
250   fi`
251
252 DLLTOOL_FOR_TARGET = ` \
253   if [ -f $$r/binutils/dlltool ] ; then \
254     echo $$r/binutils/dlltool ; \
255   else \
256     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
257       echo $(DLLTOOL); \
258     else \
259        t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \
260     fi; \
261   fi`
262
263 AR_FOR_TARGET = ` \
264   if [ -f $$r/binutils/ar ] ; then \
265     echo $$r/binutils/ar ; \
266   else \
267     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
268       echo $(AR); \
269     else \
270        t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
271     fi; \
272   fi`
273
274 RANLIB_FOR_TARGET = ` \
275   if [ -f $$r/binutils/ranlib ] ; then \
276     echo $$r/binutils/ranlib ; \
277   else \
278     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
279       echo $(RANLIB); \
280     else \
281        t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
282     fi; \
283   fi`
284
285 NM_FOR_TARGET = ` \
286   if [ -f $$r/binutils/nm.new ] ; then \
287     echo $$r/binutils/nm.new ; \
288   else \
289     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
290       echo $(NM); \
291     else \
292        t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
293     fi; \
294   fi`
295
296 #### host and target specific makefile fragments come in here.
297 ###
298
299 # Flags to pass down to all sub-makes.
300 # Please keep these in alphabetical order.
301 BASE_FLAGS_TO_PASS = \
302         "AR_FLAGS=$(AR_FLAGS)" \
303         "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
304         "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
305         "BISON=$(BISON)" \
306         "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
307         "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
308         "CFLAGS=$(CFLAGS)" \
309         "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
310         $(start-sanitize-chill)\
311         "CHILLFLAGS=$(CHILLFLAGS)" \
312         "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
313         "CHILL_LIB=$(CHILL_LIB)" \
314         $(end-sanitize-chill)\
315         "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
316         "CXXFLAGS=$(CXXFLAGS)" \
317         "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
318         "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
319         "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
320         "INSTALL=$(INSTALL)" \
321         "INSTALL_DATA=$(INSTALL_DATA)" \
322         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
323         "INSTALL_XFORM=$(INSTALL_XFORM)" \
324         "LDFLAGS=$(LDFLAGS)" \
325         "LEX=$(LEX)" \
326         "LD_FOR_TARGET=$(LD_FOR_TARGET)" \
327         "LIBCFLAGS=$(LIBCFLAGS)" \
328         "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
329         "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
330         "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
331         "M4=$(M4)" \
332         "MAKE=$(MAKE)" \
333         "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
334         "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
335         "PICFLAG=$(PICFLAG)" \
336         "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
337         "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
338         "SHELL=$(SHELL)" \
339         "EXPECT=$(EXPECT)" \
340         "RUNTEST=$(RUNTEST)" \
341         "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
342         "YACC=$(BISON)" \
343         "exec_prefix=$(exec_prefix)" \
344         "prefix=$(prefix)" \
345         "tooldir=$(tooldir)" 
346
347 # Flags to pass down to most sub-makes, in which we're building with
348 # the host environment.
349 # If any variables are added here, they must be added to do-*, below.
350 EXTRA_HOST_FLAGS = \
351         'AR=$(AR)' \
352         'AS=$(AS)' \
353         'CC=$(CC)' \
354         'CXX=$(CXX)' \
355         'DLLTOOL=$(DLLTOOL)' \
356         'NM=$(NM)' \
357         'RANLIB=$(RANLIB)' 
358
359
360 FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(HOST_FLAGS)
361
362 # Flags that are concerned with the location of the X11 include files
363 # and library files
364 #
365 # NOTE: until the top-level is getting the values via autoconf, it only
366 # causes problems to have this top-level Makefile overriding the autoconf-set
367 # values in child directories.  Only variables that don't conflict with
368 # autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
369 #
370 X11_FLAGS_TO_PASS = \
371         'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
372         'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
373
374 # Flags to pass down to makes which are built with the target environment.
375 # The double $ decreases the length of the command line; the variables
376 # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
377 # If any variables are added here, they must be added to do-*, below.
378 EXTRA_TARGET_FLAGS = \
379         'AR=$$(AR_FOR_TARGET)' \
380         'AS=$$(AS_FOR_TARGET)' \
381         'CC=$$(CC_FOR_TARGET)' \
382         'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
383         'CXX=$$(CXX_FOR_TARGET)' \
384         'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
385         'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
386         'LD=$$(LD_FOR_TARGET)' \
387         'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
388         'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
389         'NM=$$(NM_FOR_TARGET)' \
390         'PICFLAG=$$(PICFLAG_FOR_TARGET)' \
391         'RANLIB=$$(RANLIB_FOR_TARGET)'
392
393 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
394
395 # Flags to pass down to gcc.  gcc builds a library, libgcc.a, so it
396 # unfortunately needs the native compiler and the target ar and
397 # ranlib.
398 # If any variables are added here, they must be added to do-*, below.
399 # The HOST_* variables are a special case, which are used for the gcc
400 # cross-building scheme.
401 # The condition for setting GCC_FOR_TARGET is so that if CC_FOR_TARGET
402 # is overridden on the command line we use that value for
403 # GCC_FOR_TARGET, and, if it is not, we use the value of
404 # GCC_FOR_TARGET.  We do this because the default value of
405 # CC_FOR_TARGET depends on gcc/xgcc, which won't exist when we first
406 # go into the gcc directory.  FIXME: The test won't work correctly for
407 # older non-Posix make programs that do not set MAKEFLAGS; in that
408 # case, overriding CC_FOR_TARGET on the command line will not affect
409 # GCC_FOR_TARGET.
410 EXTRA_GCC_FLAGS = \
411         'AR=$$(AR_FOR_TARGET)' \
412         'AS=$(AS)' \
413         'CC=$(CC)' \
414         'CXX=$(CXX)' \
415         'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
416         'HOST_CC=$(CC_FOR_BUILD)' \
417         'HOST_PREFIX=$(HOST_PREFIX)' \
418         'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
419         'NM=$(NM)' \
420         'RANLIB=$$(RANLIB_FOR_TARGET)' \
421         "GCC_FOR_TARGET=`if echo '$(MAKEFLAGS)' | grep CC_FOR_TARGET >/dev/null 2>&1; then \
422           echo '$$(CC_FOR_TARGET)'; \
423         else \
424           echo $(GCC_FOR_TARGET); \
425         fi`" \
426         `if test x"$(LANGUAGES)" != x; then echo "LANGUAGES=$(LANGUAGES)"; fi` \
427         `if test x"$(STMP_FIXPROTO)" != x; then echo "STMP_FIXPROTO=$(STMP_FIXPROTO)"; fi` \
428         `if test x"$(LIMITS_H_TEST)" != x; then echo "LIMITS_H_TEST=$(LIMITS_H_TEST)"; fi` \
429         `if test x"$(LIBGCC1_TEST)" != x; then echo "LIBGCC1_TEST=$(LIBGCC1_TEST)"; fi` \
430         `if test x"$(LIBGCC2_CFLAGS)" != x; then echo "LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)"; fi` \
431         `if test x"$(LIBGCC2_INCLUDES)" != x; then echo "LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)"; fi` \
432         `if test x"$(ENQUIRE)" != x; then echo "ENQUIRE=$(ENQUIRE)"; fi` \
433         `if test x"$(BOOT_CFLAGS)" != x; then echo "BOOT_CFLAGS=$(BOOT_CFLAGS)"; fi`
434
435 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
436
437 # This is a list of the targets for all of the modules which are compiled
438 # using $(FLAGS_TO_PASS).
439 ALL_MODULES = \
440         all-apache \
441         all-autoconf \
442         all-bash \
443         all-bfd \
444         all-binutils \
445         all-byacc \
446         all-cvs \
447         all-dejagnu \
448         all-diff \
449         all-dosutils \
450         all-etc \
451         all-fileutils \
452         all-find \
453         all-flex \
454         all-gas \
455         all-gawk \
456         all-gprof \
457         all-grep \
458         all-grez \
459         all-gzip \
460         all-hello \
461         all-indent \
462         all-inet \
463         all-ispell \
464         all-ld \
465         all-libiberty \
466         all-m4 \
467         all-make \
468         all-mmalloc \
469         all-opcodes \
470         all-patch \
471         all-perl \
472         all-prms \
473         all-rcs \
474         all-readline \
475         all-release \
476         all-recode \
477         all-sed \
478         all-send-pr \
479         all-shellutils \
480         all-sim \
481         all-tar \
482         all-tcl \
483         all-texinfo \
484         all-textutils \
485         all-tgas \
486         all-time \
487         all-uudecode \
488         all-wdiff 
489
490 # This is a list of the check targets for all of the modules which are
491 # compiled using $(FLAGS_TO_PASS).
492 #
493 # The list is in two parts.  The first lists those tools which
494 # are tested as part of the host's native tool-chain, and not
495 # tested in a cross configuration.
496 NATIVE_CHECK_MODULES = \
497         check-byacc \
498         check-flex
499
500 CROSS_CHECK_MODULES = \
501         check-apache \
502         check-autoconf \
503         check-bash \
504         check-bfd \
505         check-binutils \
506         check-cvs \
507         check-dejagnu \
508         check-diff \
509         check-etc \
510         check-fileutils \
511         check-find \
512         check-gas \
513         check-gawk \
514         check-gprof \
515         check-grep \
516         check-gzip \
517         check-hello \
518         check-indent \
519         check-inet \
520         check-ispell \
521         check-ld \
522         check-libiberty \
523         check-m4 \
524         check-make \
525         check-mmcheckoc \
526         check-opcodes \
527         check-patch \
528         check-perl \
529         check-prms \
530         check-rcs \
531         check-readline \
532         check-recode \
533         check-sed \
534         check-send-pr \
535         check-shellutils \
536         check-sim \
537         check-tar \
538         check-tcl \
539         check-texinfo \
540         check-textutils \
541         check-tgas \
542         check-time \
543         check-uudecode \
544         check-wdiff
545
546 CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
547
548 # This is a list of the install targets for all of the modules which are
549 # compiled using $(FLAGS_TO_PASS).
550 INSTALL_MODULES = \
551         install-apache \
552         install-autoconf \
553         install-bash \
554         install-bfd \
555         install-binutils \
556         install-byacc \
557         install-cvs \
558         install-dejagnu \
559         install-diff \
560         install-dosutils \
561         install-etc \
562         install-fileutils \
563         install-find \
564         install-flex \
565         install-gas \
566         install-gawk \
567         install-gprof \
568         install-grep \
569         install-grez \
570         install-gzip \
571         install-hello \
572         install-indent \
573         install-inet \
574         install-ispell \
575         install-ld \
576         install-libiberty \
577         install-m4 \
578         install-make \
579         install-mmalloc \
580         install-opcodes \
581         install-patch \
582         install-perl \
583         install-prms \
584         install-rcs \
585         install-readline \
586         install-recode \
587         install-sed \
588         install-send-pr \
589         install-shellutils \
590         install-sim \
591         install-tar \
592         install-tcl \
593         install-texinfo \
594         install-textutils \
595         install-tgas \
596         install-time \
597         install-uudecode \
598         install-wdiff
599
600 # This is a list of the targets for all of the modules which are compiled
601 # using $(X11_FLAGS_TO_PASS).
602 ALL_X11_MODULES = \
603         all-emacs \
604         all-emacs19 \
605         all-gdb \
606         all-expect \
607         all-gash \
608         all-guile \
609         all-tclX \
610         all-tk
611
612 # This is a list of the check targets for all of the modules which are
613 # compiled using $(X11_FLAGS_TO_PASS).
614 CHECK_X11_MODULES = \
615         check-emacs \
616         check-gdb \
617         check-guile \
618         check-expect \
619         check-gash \
620         check-tclX \
621         check-tk
622
623 # This is a list of the install targets for all the modules which are
624 # compiled using $(X11_FLAGS_TO_PASS).
625 INSTALL_X11_MODULES = \
626         install-emacs \
627         install-emacs19 \
628         install-gdb \
629         install-guile \
630         install-expect \
631         install-gash \
632         install-tclX \
633         install-tk
634
635 # This is a list of the targets for all of the modules which are compiled
636 # using $(TARGET_FLAGS_TO_PASS).
637 ALL_TARGET_MODULES = \
638         all-target-libio \
639         all-target-libstdc++ \
640         all-target-librx \
641         all-target-libg++ \
642         all-target-newlib \
643         all-target-winsup \
644         all-target-libgloss \
645         all-target-libiberty \
646         all-target-examples
647
648 # This is a list of the configure targets for all of the modules which
649 # are compiled using the target tools.
650 CONFIGURE_TARGET_MODULES = \
651         configure-target-libio \
652         configure-target-libstdc++ \
653         configure-target-librx \
654         configure-target-libg++ \
655         configure-target-newlib \
656         configure-target-winsup \
657         configure-target-libgloss \
658         configure-target-libiberty \
659         configure-target-examples
660
661 # This is a list of the check targets for all of the modules which are
662 # compiled using $(TARGET_FLAGS_TO_PASS).
663 CHECK_TARGET_MODULES = \
664         check-target-libio \
665         check-target-libstdc++ \
666         check-target-libg++ \
667         check-target-newlib \
668         check-target-winsup \
669         check-target-libiberty
670
671 # This is a list of the install targets for all of the modules which are
672 # compiled using $(TARGET_FLAGS_TO_PASS).
673 INSTALL_TARGET_MODULES = \
674         install-target-libio \
675         install-target-libstdc++ \
676         install-target-libg++ \
677         install-target-newlib \
678         install-target-winsup \
679         install-target-libgloss \
680         install-target-libiberty
681
682 # This is a list of the targets for which we can do a clean-{target}.
683 CLEAN_MODULES = \
684         clean-apache \
685         clean-autoconf \
686         clean-bash \
687         clean-bfd \
688         clean-binutils \
689         clean-byacc \
690         clean-cvs \
691         clean-dejagnu \
692         clean-diff \
693         clean-dosutils \
694         clean-etc \
695         clean-fileutils \
696         clean-find \
697         clean-flex \
698         clean-gas \
699         clean-gawk \
700         clean-gprof \
701         clean-grep \
702         clean-grez \
703         clean-gzip \
704         clean-hello \
705         clean-indent \
706         clean-inet \
707         clean-ispell \
708         clean-ld \
709         clean-libiberty \
710         clean-m4 \
711         clean-make \
712         clean-mmalloc \
713         clean-opcodes \
714         clean-patch \
715         clean-perl \
716         clean-prms \
717         clean-rcs \
718         clean-readline \
719         clean-release \
720         clean-recode \
721         clean-sed \
722         clean-send-pr \
723         clean-shellutils \
724         clean-sim \
725         clean-tar \
726         clean-tcl \
727         clean-texinfo \
728         clean-textutils \
729         clean-tgas \
730         clean-time \
731         clean-uudecode \
732         clean-wdiff
733
734 # All of the target modules that can be cleaned
735 CLEAN_TARGET_MODULES = \
736         clean-target-libio \
737         clean-target-libstdc++ \
738         clean-target-librx \
739         clean-target-libg++ \
740         clean-target-newlib \
741         clean-target-winsup \
742         clean-target-libgloss \
743         clean-target-libiberty \
744         clean-target-examples
745
746 # All of the x11 modules that can be cleaned
747 CLEAN_X11_MODULES = \
748         clean-emacs \
749         clean-emacs19 \
750         clean-gdb \
751         clean-expect \
752         clean-gash \
753         clean-guile \
754         clean-tclX \
755         clean-tk
756
757 # The first rule in the file had better be this one.  Don't put any above it.
758 all: all.normal
759 .PHONY: all
760
761 # The target built for a native build.
762 .PHONY: all.normal
763 all.normal: \
764         $(ALL_MODULES) \
765         $(ALL_TARGET_MODULES) \
766         $(ALL_X11_MODULES) \
767         all-gcc
768
769 # Do a target for all the subdirectories.  A ``make do-X'' will do a
770 # ``make X'' in all subdirectories (because, in general, there is a
771 # dependency (below) of X upon do-X, a ``make X'' will also do this,
772 # but it may do additional work as well).
773 # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
774 # because it is so large that it can easily overflow the command line
775 # length limit on some systems.
776 DO_X = \
777         do-clean \
778         do-distclean \
779         do-dvi \
780         do-info \
781         do-install-info \
782         do-installcheck \
783         do-mostlyclean \
784         do-maintainer-clean \
785         do-TAGS
786 .PHONY: $(DO_X)
787 $(DO_X):
788         @target=`echo $@ | sed -e 's/^do-//'`; \
789         r=`pwd`; export r; \
790         s=`cd $(srcdir); pwd`; export s; \
791         $(SET_LIB_PATH) \
792         for i in $(SUBDIRS) -dummy-; do \
793           if [ -f ./$$i/Makefile ]; then \
794             case $$i in \
795             gcc) \
796               for flag in $(EXTRA_GCC_FLAGS); do \
797                 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
798               done; \
799               ;; \
800             *) \
801               for flag in $(EXTRA_HOST_FLAGS); do \
802                 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
803               done; \
804               ;; \
805             esac ; \
806             export AR AS CC CXX NM RANLIB DLLTOOL; \
807             if (cd ./$$i; \
808                 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
809                         "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
810                         "RANLIB=$${RANLIB}" \
811                         "DLLTOOL=$${DLLTOOL}" \
812                         $${target}); \
813             then true; else exit 1; fi; \
814           else true; fi; \
815         done
816         @target=`echo $@ | sed -e 's/^do-//'`; \
817         r=`pwd`; export r; \
818         s=`cd $(srcdir); pwd`; export s; \
819         $(SET_LIB_PATH) \
820         for i in $(TARGET_CONFIGDIRS) -dummy-; do \
821           if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \
822             for flag in $(EXTRA_TARGET_FLAGS); do \
823                 eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
824             done; \
825             export AR AS CC CXX NM RANLIB DLLTOOL; \
826             if (cd $(TARGET_SUBDIR)/$$i; \
827                 $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
828                         "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
829                         "RANLIB=$${RANLIB}" \
830                         "DLLTOOL=$${DLLTOOL}" \
831                         $${target}); \
832             then true; else exit 1; fi; \
833           else true; fi; \
834         done
835
836 # Here are the targets which correspond to the do-X targets.
837
838 .PHONY: info installcheck dvi install-info
839 .PHONY: clean distclean mostlyclean maintainer-clean realclean
840 .PHONY: local-clean local-distclean local-maintainer-clean
841 info: do-info
842 installcheck: do-installcheck
843 dvi: do-dvi
844
845 install-info: do-install-info dir.info
846         s=`cd $(srcdir); pwd`; export s; \
847         if [ -f dir.info ] ; then \
848           $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
849         else true ; fi
850
851 local-clean:
852         -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
853
854 local-distclean:
855         -rm -f Makefile config.status
856         -if [ "$(TARGET_SUBDIR)" != "." ]; then \
857           rm -rf $(TARGET_SUBDIR); \
858         else true; fi
859
860 local-maintainer-clean:
861         @echo "This command is intended for maintainers to use;"
862         @echo "it deletes files that may require special tools to rebuild."
863
864 clean: do-clean local-clean
865 mostlyclean: do-mostlyclean local-clean
866 distclean: do-distclean local-clean local-distclean
867 maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean 
868 maintainer-clean: local-distclean
869 realclean: maintainer-clean
870
871 # This rule is used to clean specific modules.
872 .PHONY: $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc
873 $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc:
874         @dir=`echo $@ | sed -e 's/clean-//'`; \
875         if [ -f ./$${dir}/Makefile ] ; then \
876           r=`pwd`; export r; \
877           s=`cd $(srcdir); pwd`; export s; \
878           $(SET_LIB_PATH) \
879           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) clean); \
880         else \
881           true; \
882         fi
883
884 .PHONY: $(CLEAN_TARGET_MODULES)
885 $(CLEAN_TARGET_MODULES):
886         @dir=`echo $@ | sed -e 's/clean-target-//'`; \
887         rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \
888         if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
889           r=`pwd`; export r; \
890           s=`cd $(srcdir); pwd`; export s; \
891           $(SET_LIB_PATH) \
892           (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \
893         else \
894           true; \
895         fi
896
897 clean-target: $(CLEAN_TARGET_MODULES)
898
899 # Check target.
900
901 .PHONY: check
902 check: $(CHECK_MODULES) \
903         $(CHECK_TARGET_MODULES) \
904         $(CHECK_X11_MODULES) \
905         check-gcc
906
907 # Installation targets.
908
909 .PHONY: install uninstall source-vault binary-vault vault-install
910 install: $(INSTALL_TARGET) 
911
912 uninstall:
913         @echo "the uninstall target is not supported in this tree"
914
915 source-vault:
916         $(MAKE) -f ./release/Build-A-Release \
917                 host=$(host_alias) source-vault
918
919 binary-vault:
920         $(MAKE) -f ./release/Build-A-Release \
921                 host=$(host_alias) target=$(target_alias)
922
923 vault-install:
924         @if [ -f ./release/vault-install ] ; then \
925           ./release/vault-install $(host_alias) $(target_alias) ; \
926         else \
927           true ; \
928         fi
929
930 .PHONY: install.all
931 install.all: install-no-fixedincludes
932         @if [ -f ./gcc/Makefile ] ; then \
933                 r=`pwd` ; export r ; \
934                 $(SET_LIB_PATH) \
935                 (cd ./gcc; \
936                 $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
937         else \
938                 true ; \
939         fi
940
941 # inet-install is used because the I*Net wants DejaGNU installed but
942 # not built.  Similarly, gzip is built but not installed.
943 inet-install:
944         $(MAKE) INSTALL_MODULES="`echo $(INSTALL_MODULES) | sed -e 's/install-dejagnu//' -e 's/install-gzip//'`" install
945
946 # install-no-fixedincludes is used because Cygnus can not distribute
947 # the fixed header files.
948 .PHONY: install-no-fixedincludes
949 install-no-fixedincludes: \
950         install-dirs \
951         $(INSTALL_MODULES) \
952         $(INSTALL_TARGET_MODULES) \
953         $(INSTALL_X11_MODULES) \
954         gcc-no-fixedincludes 
955
956 # Install the gcc headers files, but not the fixed include files,
957 # which Cygnus is not allowed to distribute.  This rule is very
958 # dependent on the workings of the gcc Makefile.in.
959 .PHONY: gcc-no-fixedincludes
960 gcc-no-fixedincludes:
961         @if [ -f ./gcc/Makefile ]; then \
962           rm -rf gcc/tmp-include; \
963           mv gcc/include gcc/tmp-include 2>/dev/null; \
964           mkdir gcc/include; \
965           cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
966           touch gcc/stmp-fixinc gcc/include/fixed; \
967           rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
968           r=`pwd`; export r; \
969           s=`cd $(srcdir); pwd` ; export s; \
970           $(SET_LIB_PATH) \
971           (cd ./gcc; \
972            $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
973           rm -rf gcc/include; \
974           mv gcc/tmp-include gcc/include 2>/dev/null; \
975         else true; fi
976
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.
979 #
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
994
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.
998
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
1012
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
1023
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): install-dirs
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
1037
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             DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
1078             LD="$(LD_FOR_TARGET)"; export LD; \
1079             NM="$(NM_FOR_TARGET)"; export NM; \
1080             RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
1081             echo Configuring in $(TARGET_SUBDIR)/$${dir}; \
1082             cd $(TARGET_SUBDIR)/$${dir}; \
1083             case $(srcdir) in \
1084             /*) \
1085               topdir=$(srcdir) ;; \
1086             *) \
1087               case "$(TARGET_SUBDIR)" in \
1088               .) topdir="../$(srcdir)" ;; \
1089               *) topdir="../../$(srcdir)" ;; \
1090               esac ;; \
1091             esac; \
1092             if [ "$(srcdir)" = "." ] ; then \
1093               if [ "$(TARGET_SUBDIR)" != "." ] ; then \
1094                 if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
1095                   if [ -f Makefile ]; then \
1096                     if $(MAKE) distclean; then \
1097                       true; \
1098                     else \
1099                       exit 1; \
1100                     fi; \
1101                   else \
1102                     true; \
1103                   fi; \
1104                 else \
1105                   exit 1; \
1106                 fi; \
1107               else \
1108                 true; \
1109               fi; \
1110               srcdiroption="--srcdir=."; \
1111               libsrcdir="."; \
1112             else \
1113               srcdiroption="--srcdir=$${topdir}/$${dir}"; \
1114               libsrcdir="$$s/$${dir}"; \
1115             fi; \
1116             if [ -f $${libsrcdir}/configure ] ; then \
1117               $(SHELL) $${libsrcdir}/configure \
1118                 $(CONFIG_ARGUMENTS) $${srcdiroption} \
1119                 --with-target-subdir="$(TARGET_SUBDIR)"; \
1120             else \
1121               $(SHELL) $$s/configure \
1122                 $(CONFIG_ARGUMENTS) $${srcdiroption} \
1123                 --with-target-subdir="$(TARGET_SUBDIR)"; \
1124             fi; \
1125           else \
1126             true; \
1127           fi; \
1128         else \
1129           true; \
1130         fi
1131
1132 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
1133 # To build a target all-X means to cd to X and make all.
1134 .PHONY: $(ALL_TARGET_MODULES)
1135 $(ALL_TARGET_MODULES):
1136         @dir=`echo $@ | sed -e 's/all-target-//'`; \
1137         if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1138           r=`pwd`; export r; \
1139           s=`cd $(srcdir); pwd`; export s; \
1140           $(SET_LIB_PATH) \
1141           (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
1142         else \
1143           true; \
1144         fi
1145
1146 # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
1147 # To build a target install-X means to cd to X and make install.
1148 .PHONY: $(CHECK_TARGET_MODULES)
1149 $(CHECK_TARGET_MODULES):
1150         @dir=`echo $@ | sed -e 's/check-target-//'`; \
1151         if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1152           r=`pwd`; export r; \
1153           s=`cd $(srcdir); pwd`; export s; \
1154           $(SET_LIB_PATH) \
1155           (cd $(TARGET_SUBDIR)/$${dir};$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
1156         else \
1157           true; \
1158         fi
1159
1160 # This rule is used to install the modules which use
1161 # TARGET_FLAGS_TO_PASS.  To build a target install-X means to cd to X
1162 # and make install.
1163 .PHONY: $(INSTALL_TARGET_MODULES)
1164 $(INSTALL_TARGET_MODULES): install-dirs
1165         @dir=`echo $@ | sed -e 's/install-target-//'`; \
1166         if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
1167           r=`pwd`; export r; \
1168           s=`cd $(srcdir); pwd`; export s; \
1169           $(SET_LIB_PATH) \
1170           (cd $(TARGET_SUBDIR)/$${dir}; \
1171             $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
1172         else \
1173           true; \
1174         fi
1175
1176 # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
1177 # To build a target all-X means to cd to X and make all.
1178 .PHONY: $(ALL_X11_MODULES)
1179 $(ALL_X11_MODULES):
1180         @dir=`echo $@ | sed -e 's/all-//'`; \
1181         if [ -f ./$${dir}/Makefile ] ; then \
1182           r=`pwd`; export r; \
1183           s=`cd $(srcdir); pwd`; export s; \
1184           $(SET_LIB_PATH) \
1185           (cd $${dir}; \
1186            $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
1187         else \
1188           true; \
1189         fi
1190
1191 # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
1192 # To build a target check-X means to cd to X and make all.
1193 .PHONY: $(CHECK_X11_MODULES)
1194 $(CHECK_X11_MODULES):
1195         @dir=`echo $@ | sed -e 's/check-//'`; \
1196         if [ -f ./$${dir}/Makefile ] ; then \
1197           r=`pwd`; export r; \
1198           s=`cd $(srcdir); pwd`; export s; \
1199           $(SET_LIB_PATH) \
1200           (cd $${dir}; \
1201            $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
1202         else \
1203           true; \
1204         fi
1205
1206 # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
1207 # To build a target install-X means to cd to X and make install.
1208 .PHONY: $(INSTALL_X11_MODULES)
1209 $(INSTALL_X11_MODULES):
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}; \
1216            $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
1217         else \
1218           true; \
1219         fi
1220
1221 # gcc is the only module which uses GCC_FLAGS_TO_PASS.
1222 .PHONY: all-gcc
1223 all-gcc:
1224         @if [ -f ./gcc/Makefile ] ; then \
1225           r=`pwd`; export r; \
1226           s=`cd $(srcdir); pwd`; export s; \
1227           $(SET_LIB_PATH) \
1228           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
1229         else \
1230           true; \
1231         fi
1232
1233 .PHONY: all-bootstrap
1234 all-bootstrap:
1235         @if [ -f ./gcc/Makefile ] ; then \
1236           r=`pwd`; export r; \
1237           s=`cd $(srcdir); pwd`; export s; \
1238           $(SET_LIB_PATH) \
1239           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) bootstrap); \
1240         else \
1241           true; \
1242         fi
1243
1244 .PHONY: check-gcc
1245 check-gcc:
1246         @if [ -f ./gcc/Makefile ] ; then \
1247           r=`pwd`; export r; \
1248           s=`cd $(srcdir); pwd`; export s; \
1249           $(SET_LIB_PATH) \
1250           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
1251         else \
1252           true; \
1253         fi
1254
1255 .PHONY: install-gcc
1256 install-gcc:
1257         @if [ -f ./gcc/Makefile ] ; then \
1258           r=`pwd`; export r; \
1259           s=`cd $(srcdir); pwd`; export s; \
1260           $(SET_LIB_PATH) \
1261           (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
1262         else \
1263           true; \
1264         fi
1265
1266
1267 # EXPERIMENTAL STUFF
1268 # This rule is used to install the modules which use FLAGS_TO_PASS.
1269 # To build a target install-X means to cd to X and make install.
1270 .PHONY: install-dosrel
1271 install-dosrel: install-dirs info
1272         @dir=`echo $@ | sed -e 's/install-//'`; \
1273         if [ -f ./$${dir}/Makefile ] ; then \
1274           r=`pwd`; export r; \
1275           s=`cd $(srcdir); pwd`; export s; \
1276           $(SET_LIB_PATH) \
1277           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
1278         else \
1279           true; \
1280         fi
1281
1282 install-dosrel-fake:
1283
1284
1285 # This is a list of inter-dependencies among modules.
1286 all-apache:
1287 all-autoconf: all-m4
1288 all-bash:
1289 all-bfd:
1290 all-binutils: all-libiberty all-opcodes all-bfd all-flex all-byacc
1291 all-byacc:
1292 all-cvs:
1293 all-dejagnu: all-tcl all-expect all-tk
1294 all-diff: all-libiberty
1295 all-emacs:
1296 all-emacs19: all-byacc
1297 all-etc:
1298 configure-target-examples: $(ALL_GCC)
1299 all-target-examples: configure-target-examples
1300 all-expect: all-tcl all-tk
1301 all-fileutils: all-libiberty
1302 all-find:
1303 all-flex: all-libiberty all-byacc
1304 all-gas: all-libiberty all-opcodes all-bfd
1305 all-gash: all-tcl
1306 all-gawk:
1307 ALL_GCC = all-gcc
1308 all-gcc: all-libiberty all-byacc all-binutils all-gas all-ld
1309 all-bootstrap: all-libiberty all-byacc all-binutils all-gas all-ld
1310 GDB_TK = all-tk all-tcl
1311 all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
1312 all-gprof: all-libiberty all-bfd all-opcodes
1313 all-grep: all-libiberty
1314 all-grez: all-libiberty all-bfd all-opcodes
1315 all-gui: all-gdb all-libproc all-target-librx
1316 all-guile:
1317 all-gzip: all-libiberty
1318 all-hello: all-libiberty
1319 all-indent:
1320 all-inet: all-tcl all-send-pr all-perl
1321 all-ispell: all-emacs19
1322 all-ld: all-libiberty all-bfd all-opcodes all-byacc all-flex
1323 configure-target-libg++: $(ALL_GCC) configure-target-librx
1324 all-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++
1325 configure-target-libgloss: $(ALL_GCC)
1326 all-target-libgloss: configure-target-libgloss configure-target-newlib
1327 configure-target-libio: $(ALL_GCC)
1328 all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libiberty all-target-newlib
1329 all-libiberty:
1330 configure-target-librx: $(ALL_GCC) configure-target-newlib
1331 all-target-librx: configure-target-librx
1332 configure-target-libstdc++: $(ALL_GCC)
1333 all-target-libstdc++: configure-target-libstdc++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio
1334 all-m4: all-libiberty
1335 all-make: all-libiberty
1336 all-mmalloc:
1337 configure-target-newlib: $(ALL_GCC)
1338 all-target-newlib: configure-target-newlib all-binutils all-gas all-gcc
1339 all-opcodes: all-bfd all-libiberty
1340 all-patch: all-libiberty
1341 all-perl:
1342 all-prms: all-libiberty
1343 all-rcs:
1344 all-readline:
1345 all-recode: all-libiberty
1346 all-sed: all-libiberty
1347 all-send-pr: all-prms
1348 all-shellutils:
1349 all-sim: all-libiberty all-bfd all-opcodes
1350 all-tar: all-libiberty
1351 all-tcl:
1352 all-tclX: all-tcl all-tk
1353 all-tk: all-tcl
1354 all-texinfo: all-libiberty
1355 all-textutils:
1356 all-tgas: all-libiberty all-bfd all-opcodes
1357 all-time:
1358 all-wdiff:
1359 all-target-winsup: all-target-newlib all-target-libiberty configure-target-winsup 
1360 configure-target-winsup: configure-target-newlib
1361 all-uudecode: all-libiberty
1362 configure-target-libiberty: $(ALL_GCC)
1363 all-target-libiberty: configure-target-libiberty all-gcc all-ld all-target-newlib
1364 all-target: $(ALL_TARGET_MODULES)
1365 install-target: $(INSTALL_TARGET_MODULES)
1366
1367 ### other supporting targets
1368
1369 MAKEDIRS= \
1370         $(prefix) \
1371         $(exec_prefix)
1372 .PHONY: install-dirs
1373 install-dirs:
1374         @for i in $(MAKEDIRS) ; do \
1375                 echo Making $$i... ; \
1376                 parent=`echo $$i | sed -e 's@/[^/]*$$@@' | sed -e 's@^$$@/@'`; \
1377                 if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
1378                 if [ ! -d $$i ] ; then \
1379                         if mkdir $$i ; then \
1380                                 true ; \
1381                         else \
1382                                 exit 1 ; \
1383                         fi ; \
1384                 else \
1385                         true ; \
1386                 fi ; \
1387         done
1388
1389
1390 dir.info: do-install-info
1391         if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
1392           $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
1393           mv -f dir.info.new dir.info ; \
1394         else true ; \
1395         fi
1396
1397 dist:
1398         @echo "Building a full distribution of this tree isn't done"
1399         @echo "via 'make dist'.  Check out the etc/ subdirectory" 
1400
1401 etags tags: TAGS
1402
1403 # Right now this just builds TAGS in each subdirectory.  emacs19 has the
1404 # ability to use several tags files at once, so there is probably no need
1405 # to combine them into one big TAGS file (like CVS 1.3 does).  We could
1406 # (if we felt like it) have this Makefile write a piece of elisp which
1407 # the user could load to tell emacs19 where all the TAGS files we just
1408 # built are.
1409 TAGS: do-TAGS
1410
1411 # with the gnu make, this is done automatically.
1412
1413 Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
1414         $(SHELL) ./config.status
1415
1416 #
1417 # Support for building net releases
1418
1419 # Files in devo used in any net release.
1420 # ChangeLog omitted because it may refer to files which are not in this
1421 # distribution (perhaps it would be better to include it anyway).
1422 DEVO_SUPPORT= README Makefile.in configure configure.in \
1423         config.guess config.sub config move-if-change \
1424         mpw-README mpw-build.in mpw-config.in mpw-configure \
1425         COPYING COPYING.LIB install.sh config-ml.in symlink-tree
1426
1427 # Files in devo/etc used in any net release.
1428 # ChangeLog omitted because it may refer to files which are not in this
1429 # distribution (perhaps it would be better to include it anyway).
1430 ETC_SUPPORT= Makefile.in cfg-paper.texi configure configure.in configure.man \
1431         configure.texi standards.texi make-stds.texi \
1432         configure.info* standards.info* cfg-paper.info*
1433
1434 # When you use `make setup-dirs' or `make taz' you should always redefine
1435 # this macro.
1436 SUPPORT_FILES = list-of-support-files-for-tool-in-question
1437 # Files where "byacc" (Cygnus version) should be changed to "bison -y" (FSF).
1438 DISTBISONFILES= binutils/Makefile.in gas/Makefile.in gdb/Makefile.in
1439
1440 .PHONY: taz
1441
1442 taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
1443   texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1444         # Make sure "diststuff" files get built properly.
1445         for f in $(DISTBISONFILES) ; do \
1446           if [ -r $$f ]; then \
1447             sed '/^BISON *=.*$$/s/.*/BISON = bison -y/' <$$f >tmp ; \
1448             mv -f tmp $$f ; \
1449           else true; fi ; \
1450         done
1451         # Take out texinfo from a few places; make simple BISON=bison line.
1452         sed -e '/^all\.normal: /s/\all-texinfo //' \
1453             -e '/^      install-texinfo /d' \
1454             -e '/^BISON = /,/^$$/d' \
1455             -e '/^# BISON:/s/.*/BISON = bison -y/' \
1456         <Makefile.in >tmp
1457         mv -f tmp Makefile.in
1458         #
1459         $(start-sanitize-Sanitize)
1460         @if [ -f .Sanitize ] ; then echo "RUN Sanitize FIRST!" ; false ; fi ;
1461         $(end-sanitize-Sanitize)
1462         ./configure sun4
1463         [ -z "$(CONFIGURE_TARGET_MODULES)" ] \
1464           || $(MAKE) $(CONFIGURE_TARGET_MODULES) ALL_GCC="" \
1465             CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
1466         # Make links, and run "make diststuff" or "make info" when needed.
1467         rm -rf proto-toplev ; mkdir proto-toplev
1468         set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
1469         for d in $$dirs ; do \
1470           if [ -d $$d ]; then \
1471             if [ ! -f $$d/Makefile ] ; then true ; \
1472             elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
1473                 (cd $$d ; $(MAKE) diststuff ) || exit 1 ; \
1474             elif grep '^info:' $$d/Makefile >/dev/null ; then \
1475                 (cd $$d ; $(MAKE) info ) || exit 1 ; \
1476             fi ; \
1477             if [ -d $$d/proto-$$d.dir ]; then \
1478               ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
1479             else \
1480               ln -s ../$$d proto-toplev/$$d ; \
1481             fi ; \
1482           else ln -s ../$$d proto-toplev/$$d ; fi ; \
1483         done
1484         cd etc ; $(MAKE) info
1485         $(MAKE) distclean
1486         #
1487         mkdir proto-toplev/etc
1488         (cd proto-toplev/etc; \
1489          for i in $(ETC_SUPPORT); do \
1490                 ln -s ../../etc/$$i . ; \
1491          done)
1492         #
1493         # Take out texinfo from configurable dirs
1494         rm proto-toplev/configure.in
1495         sed -e '/^host_tools=/s/texinfo //' \
1496             <configure.in >proto-toplev/configure.in
1497         #
1498         mkdir proto-toplev/texinfo
1499         ln -s ../../texinfo/texinfo.tex         proto-toplev/texinfo/
1500         ln -s ../../texinfo/gpl.texinfo         proto-toplev/texinfo/
1501         ln -s ../../texinfo/lgpl.texinfo        proto-toplev/texinfo/
1502         if test -r texinfo/util/tex3patch ; then \
1503           mkdir proto-toplev/texinfo/util && \
1504           ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
1505         else true; fi
1506         chmod og=u `find . -print`
1507         $(MAKE) -f Makefile.in do-tar-gz TOOL=$(TOOL) \
1508                 VER=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`
1509
1510 do-tar-gz:
1511         echo "==> Making $(TOOL)-$(VER).tar.gz"
1512         -rm -f $(TOOL)-$(VER)
1513         ln -s proto-toplev $(TOOL)-$(VER)
1514         tar cfh $(TOOL)-$(VER).tar $(TOOL)-$(VER)
1515         $(GZIPPROG) -v -9 $(TOOL)-$(VER).tar
1516
1517 TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
1518 DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
1519
1520 .PHONY: gas.tar.gz
1521 GAS_SUPPORT_DIRS= bfd include libiberty opcodes make-all.com setup.com
1522 gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
1523         $(MAKE) -f Makefile.in taz TOOL=gas \
1524                 SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
1525
1526 # The FSF "binutils" release includes gprof and ld.
1527 .PHONY: binutils.tar.gz
1528 BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof make-all.com setup.com
1529 binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
1530         $(MAKE) -f Makefile.in taz TOOL=binutils \
1531                 SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat"
1532
1533 .PHONY: gas+binutils.tar.gz
1534 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
1535 gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
1536         $(MAKE) -f Makefile.in taz TOOL=gas \
1537                 SUPPORT_FILES="$(GASB_SUPPORT_DIRS) makeall.bat configure.bat"
1538
1539 .PHONY: libg++.tar.gz
1540 LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty
1541 libg++.tar.gz: $(DIST_SUPPORT) libg++
1542         $(MAKE) -f Makefile.in taz TOOL=libg++ \
1543                 SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
1544
1545 GNATS_SUPPORT_DIRS=include libiberty send-pr
1546 gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
1547         $(MAKE) -f  Makefile.in taz TOOL=gnats \
1548                 SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
1549
1550 .PHONY: gdb.tar.gz
1551 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils
1552 GDBTK_SUPPORT_DIRS= `if [ -d tcl -a -d tk ] ; then echo tcl tk ; fi`
1553 gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
1554         $(MAKE) -f Makefile.in taz TOOL=gdb \
1555                 SUPPORT_FILES="$(GDB_SUPPORT_DIRS) $(GDBTK_SUPPORT_DIRS)"
1556
1557 .PHONY: newlib.tar.gz
1558 NEWLIB_SUPPORT_DIRS=libgloss
1559 # taz configures for the sun4 target which won't configure newlib.
1560 # We need newlib configured so that the .info files are made.
1561 # Unfortunately, it is not enough to just configure newlib separately:
1562 # taz will build the .info files but since SUBDIRS won't contain newlib,
1563 # distclean won't be run (leaving Makefile, config.status, and the tmp files
1564 # used in building the .info files, eg: *.def, *.ref).
1565 # The problem isn't solvable however without a lot of extra work because
1566 # target libraries are built in subdir $(target_alias) which gets nuked during
1567 # the make distclean.  For now punt on the issue of shipping newlib info files
1568 # with newlib net releases and wait for a day when some native target (sun4?)
1569 # supports newlib (if only minimally).
1570 newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
1571         $(MAKE) -f Makefile.in taz TOOL=newlib \
1572                 SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
1573                 DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
1574
1575 .NOEXPORT:
1576
1577 # start-sanitize-chill
1578 ## This is ugly, but I don't want GNU make to put these variables in
1579 ## the environment.  Older makes will see this as a set of targets
1580 ## with no dependencies and no actions.
1581 unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
1582 # end-sanitize-chill
1583
1584 # end of Makefile.in