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