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