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