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