OSDN Git Service

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