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