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