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