OSDN Git Service

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