OSDN Git Service

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