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