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